henkan 2.2.3 → 2.2.4
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 +6 -4
- package/dist/index.cjs.js.map +2 -2
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +2 -2
- package/dist/types/utils.d.ts.map +1 -1
- package/docs/api/functions/convertJMdict.md +1 -1
- package/docs/api/functions/convertJawiktionaryAsync.md +1 -1
- package/docs/api/functions/convertJawiktionarySync.md +1 -1
- package/docs/api/functions/convertKanjiDic.md +1 -1
- package/docs/api/functions/convertKradFile.md +1 -1
- package/docs/api/functions/convertRadkFile.md +1 -1
- package/docs/api/functions/convertTanakaCorpus.md +1 -1
- package/docs/api/functions/convertTanakaCorpusWithFurigana.md +1 -1
- package/docs/api/functions/createEntryMaps.md +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 +1 -1
- package/docs/api/functions/getWordDefinitions.md +1 -1
- package/docs/api/functions/getWordDefinitionsWithFurigana.md +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1273,7 +1273,8 @@ function shuffleArray(arr) {
|
|
|
1273
1273
|
function getValidForms(readings, kanjiForms, wordIsCommon) {
|
|
1274
1274
|
const kanjiFormRestrictions = /* @__PURE__ */ new Set();
|
|
1275
1275
|
const validReadings = readings.filter(
|
|
1276
|
-
(reading) => {
|
|
1276
|
+
(reading, index) => {
|
|
1277
|
+
if (index === 0) return true;
|
|
1277
1278
|
if (reading.notes === void 0 || !reading.notes.some((note) => notSearchedForms.has(note))) {
|
|
1278
1279
|
if (reading.kanjiFormRestrictions) {
|
|
1279
1280
|
for (const kfr of reading.kanjiFormRestrictions)
|
|
@@ -1286,10 +1287,11 @@ function getValidForms(readings, kanjiForms, wordIsCommon) {
|
|
|
1286
1287
|
return false;
|
|
1287
1288
|
}
|
|
1288
1289
|
);
|
|
1289
|
-
const existValidKf = kanjiForms ? kanjiForms.some(
|
|
1290
|
-
(kf) => (kf.notes === void 0 || !kf.notes.some((note) => notSearchedForms.has(note))) && (wordIsCommon === void 0 || kf.commonness !== void 0) || kanjiFormRestrictions.has(kf.form)
|
|
1290
|
+
const existValidKf = kanjiForms !== void 0 ? kanjiForms.some(
|
|
1291
|
+
(kf, index) => index !== 0 && ((kf.notes === void 0 || !kf.notes.some((note) => notSearchedForms.has(note))) && (wordIsCommon === void 0 || kf.commonness !== void 0) || kanjiFormRestrictions.has(kf.form))
|
|
1291
1292
|
) : void 0;
|
|
1292
|
-
const validKanjiForms = kanjiForms ? kanjiForms.filter((kanjiForm) => {
|
|
1293
|
+
const validKanjiForms = kanjiForms !== void 0 ? kanjiForms.filter((kanjiForm, index) => {
|
|
1294
|
+
if (index === 0) return true;
|
|
1293
1295
|
if (existValidKf === true)
|
|
1294
1296
|
return (kanjiForm.notes === void 0 || !kanjiForm.notes.some(
|
|
1295
1297
|
(note) => notSearchedForms.has(note)
|