bahai-reflib-data
Advanced tools
Comparing version 0.5.1 to 0.5.2
# CHANGES for `bahai-reflib-data` | ||
## 0.5.2 | ||
- fix: due to Reflib sometimes using different characters for their | ||
Table of Contents and headings (at least in Persian), with ID not available, | ||
we match by URL instead | ||
## 0.5.1 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "bahai-reflib-data", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"author": "Brett Zamir <brettz9@yahoo.com>", | ||
@@ -5,0 +5,0 @@ "contributors": [], |
@@ -106,6 +106,19 @@ import { | ||
async function getSectionNamesForWork (work, language) { | ||
const sections = await getSections(language); | ||
const [works, sections] = await Promise.all([ | ||
getWorks(language), | ||
getSections(language) | ||
]); | ||
return sections.subSections.filter(({parentUrl}) => { | ||
const mainSection = sections.mainSections.find(({title}) => { | ||
return title === work; | ||
// Due to a mismatch between the title found on the Table of Contents, | ||
// and the one found as a heading on the page (e.g., | ||
// 'سراپردۀ يگانگی' and 'سراپردهٔ یگانگی', we need to match another way | ||
// between section and work. But since the Table of Contents | ||
// apparently doesn't store the ID, we need to check the works, | ||
// directly, cross-referenced by parentUrl/url | ||
const mainSection = sections.mainSections.find(({ | ||
parentUrl: mainSectionParentUrl | ||
}) => { | ||
return mainSectionParentUrl === works.find(({url, title}) => { | ||
return work === title; | ||
}).url; | ||
}); | ||
@@ -112,0 +125,0 @@ return mainSection && mainSection.parentUrl === parentUrl; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8442020
327392