henkan 1.1.1 → 1.1.2
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 +11 -10
- package/dist/index.cjs.js.map +3 -3
- package/dist/index.mjs +5 -4
- package/dist/index.mjs.map +2 -2
- package/dist/types/utils.d.ts +2 -2
- package/dist/types/utils.d.ts.map +1 -1
- package/docs/api/functions/generateAnkiNote.md +1 -1
- package/docs/api/functions/generateAnkiNotesFile.md +1 -1
- package/docs/api/functions/getKanji.md +1 -1
- package/docs/api/functions/getKanjiExtended.md +1 -1
- package/docs/api/functions/getWord.md +2 -2
- package/docs/api/functions/synthesizeSpeech.md +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2123,6 +2123,7 @@ var wordAddNoteArray = (arr, cb) => {
|
|
|
2123
2123
|
for (const v of arr) cb(v);
|
|
2124
2124
|
};
|
|
2125
2125
|
function getWord(dict, id, kanjiDic, examples, definitions, dictWord, noteTypeName, deckPath) {
|
|
2126
|
+
var _a;
|
|
2126
2127
|
try {
|
|
2127
2128
|
if (!dictWord && id && dict)
|
|
2128
2129
|
dictWord = dict.find((entry) => entry.id === id);
|
|
@@ -2378,10 +2379,10 @@ function getWord(dict, id, kanjiDic, examples, definitions, dictWord, noteTypeNa
|
|
|
2378
2379
|
}
|
|
2379
2380
|
}
|
|
2380
2381
|
if (definitions) {
|
|
2381
|
-
const
|
|
2382
|
+
const defs = Array.isArray(definitions) ? (_a = definitions.find(
|
|
2382
2383
|
(wdp) => wdp.wordID === word.id
|
|
2383
|
-
);
|
|
2384
|
-
if (
|
|
2384
|
+
)) == null ? void 0 : _a.definitions : definitions.get(word.id);
|
|
2385
|
+
if (defs) word.definitions = defs;
|
|
2385
2386
|
}
|
|
2386
2387
|
return word;
|
|
2387
2388
|
} else throw new Error(`Word${id ? ` ${id}` : ""} not found`);
|
|
@@ -2698,7 +2699,7 @@ function generateAnkiNote(entry) {
|
|
|
2698
2699
|
).join("") : '<span class="word word-phrase">(no phrases) (Search on dictionaries!)</span>',
|
|
2699
2700
|
entry.definitions ? entry.definitions.map(
|
|
2700
2701
|
(definitionEntry) => createEntry(
|
|
2701
|
-
`<span class="word word-definition${definitionEntry.mayNotBeAccurate === true ? " mnba" : ""}
|
|
2702
|
+
`<span class="word word-definition${definitionEntry.mayNotBeAccurate === true ? " mnba" : ""}"><span class="word word-definition-original">${definitionEntry.definition}</span><span class="word word-definition-furigana">${definitionEntry.furigana ?? definitionEntry.definition}</span></span>`
|
|
2702
2703
|
)
|
|
2703
2704
|
).join("") : '<span class="word word-definition">(no definitions)</span>',
|
|
2704
2705
|
entry.kanji ? entry.kanji.map(
|