henkan 2.4.2 → 2.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1780,44 +1780,34 @@ function createEntryMaps(jmDict, kanjiDic, tanakaExamples, wordDefinitionPairs,
1780
1780
  for (const ex of tanakaExamples)
1781
1781
  for (const part of ex.parts) {
1782
1782
  if (entryParts.has(part.baseForm)) {
1783
- let exList = partExamplesMap.get(
1783
+ const exList = partExamplesMap.get(
1784
1784
  part.baseForm
1785
1785
  );
1786
- if (exList === void 0) {
1787
- exList = [];
1788
- partExamplesMap.set(part.baseForm, exList);
1789
- }
1790
- exList.push(ex);
1786
+ if (exList === void 0) partExamplesMap.set(part.baseForm, [ex]);
1787
+ else exList.push(ex);
1791
1788
  }
1792
1789
  if (part.reading !== void 0 && entryParts.has(part.reading)) {
1793
- let exList = partExamplesMap.get(
1790
+ const exList = partExamplesMap.get(
1794
1791
  part.reading
1795
1792
  );
1796
- if (exList === void 0) {
1797
- exList = [];
1798
- partExamplesMap.set(part.reading, exList);
1799
- }
1800
- exList.push(ex);
1793
+ if (exList === void 0) partExamplesMap.set(part.reading, [ex]);
1794
+ else exList.push(ex);
1801
1795
  }
1802
1796
  if (part.inflectedForm !== void 0 && entryParts.has(part.inflectedForm)) {
1803
- let exList = partExamplesMap.get(
1797
+ const exList = partExamplesMap.get(
1804
1798
  part.inflectedForm
1805
1799
  );
1806
- if (exList === void 0) {
1807
- exList = [];
1808
- partExamplesMap.set(part.inflectedForm, exList);
1809
- }
1810
- exList.push(ex);
1800
+ if (exList === void 0)
1801
+ partExamplesMap.set(part.inflectedForm, [ex]);
1802
+ else exList.push(ex);
1811
1803
  }
1812
1804
  if (part.referenceID !== void 0 && entryParts.has(part.referenceID)) {
1813
- let exList = partExamplesMap.get(
1805
+ const exList = partExamplesMap.get(
1814
1806
  part.referenceID
1815
1807
  );
1816
- if (exList === void 0) {
1817
- exList = [];
1818
- partExamplesMap.set(part.referenceID, exList);
1819
- }
1820
- exList.push(ex);
1808
+ if (exList === void 0)
1809
+ partExamplesMap.set(part.referenceID, [ex]);
1810
+ else exList.push(ex);
1821
1811
  }
1822
1812
  }
1823
1813
  for (const word of jmDict) {
@@ -2611,8 +2601,8 @@ function getWord(searchedWord, dict, kanjiDic, examples, definitions, noteTypeNa
2611
2601
  const readingAsReadingMatch = part.reading !== void 0 && readings.has(part.reading);
2612
2602
  const readingAsInflectedFormMatch = part.inflectedForm !== void 0 && readings.has(part.inflectedForm);
2613
2603
  const referenceIDMatch = part.referenceID === dictWord.id;
2614
- if (kanjiForms !== void 0 && kanjiForms.has(part.baseForm) || referenceIDMatch) {
2615
- if (readingAsReadingMatch || readingAsInflectedFormMatch) {
2604
+ if (kanjiForms !== void 0 && kanjiForms.has(part.baseForm)) {
2605
+ if (readingAsReadingMatch || readingAsInflectedFormMatch || referenceIDMatch) {
2616
2606
  readingMatchingKanjiFormExamples.push({
2617
2607
  ex: example,
2618
2608
  partIndex: i
@@ -2628,7 +2618,7 @@ function getWord(searchedWord, dict, kanjiDic, examples, definitions, noteTypeNa
2628
2618
  break;
2629
2619
  }
2630
2620
  const readingAsBaseFormMatch = readings.has(part.baseForm);
2631
- if (readingAsBaseFormMatch && kanjiForms === void 0) {
2621
+ if ((readingAsBaseFormMatch || referenceIDMatch) && kanjiForms === void 0) {
2632
2622
  readingExamples.push({ ex: example, partIndex: i });
2633
2623
  seenPhrases.add(example.phrase);
2634
2624
  break;