Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bahai-reflib-data

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bahai-reflib-data - npm Package Compare versions

Comparing version 0.3.2 to 0.4.0

4

CHANGES.md
# CHANGES for `bahai-reflib-data`
## 0.4.0
- feat: adds `getWorkNames`, `getSectionNamesForWork`
## 0.3.2

@@ -4,0 +8,0 @@

2

package.json
{
"name": "bahai-reflib-data",
"version": "0.3.2",
"version": "0.4.0",
"author": "Brett Zamir <brettz9@yahoo.com>",

@@ -5,0 +5,0 @@ "contributors": [],

import {
getIdsToSectionsAndParagraphs, getSectionsAndParagraphsToIds, getSections
getIdsToSectionsAndParagraphs, getSectionsAndParagraphsToIds, getSections,
getWorks
} from './getData.js';

@@ -78,2 +79,28 @@

/**
* @returns {string[]}
*/
async function getWorkNames () {
const works = (await getWorks()).map(({title}) => {
return title;
});
return works;
}
/**
* @param {string} work
* @returns {string[]}
*/
async function getSectionNamesForWork (work) {
const sections = await getSections();
return sections.subSections.filter(({parentUrl}) => {
const mainSection = sections.mainSections.find(({title}) => {
return title === work;
});
return mainSection && mainSection.parentUrl === parentUrl;
}).map(({title}) => {
return title;
});
}
export {

@@ -85,3 +112,5 @@ getWorkSectionAndParagraphForId,

getInfoForId,
getUrlForId
getUrlForId,
getWorkNames,
getSectionNamesForWork
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc