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.mjs CHANGED
@@ -1214,7 +1214,8 @@ function shuffleArray(arr) {
1214
1214
  function getValidForms(readings, kanjiForms, wordIsCommon) {
1215
1215
  const kanjiFormRestrictions = /* @__PURE__ */ new Set();
1216
1216
  const validReadings = readings.filter(
1217
- (reading) => {
1217
+ (reading, index) => {
1218
+ if (index === 0) return true;
1218
1219
  if (reading.notes === void 0 || !reading.notes.some((note) => notSearchedForms.has(note))) {
1219
1220
  if (reading.kanjiFormRestrictions) {
1220
1221
  for (const kfr of reading.kanjiFormRestrictions)
@@ -1227,10 +1228,11 @@ function getValidForms(readings, kanjiForms, wordIsCommon) {
1227
1228
  return false;
1228
1229
  }
1229
1230
  );
1230
- const existValidKf = kanjiForms ? kanjiForms.some(
1231
- (kf) => (kf.notes === void 0 || !kf.notes.some((note) => notSearchedForms.has(note))) && (wordIsCommon === void 0 || kf.commonness !== void 0) || kanjiFormRestrictions.has(kf.form)
1231
+ const existValidKf = kanjiForms !== void 0 ? kanjiForms.some(
1232
+ (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))
1232
1233
  ) : void 0;
1233
- const validKanjiForms = kanjiForms ? kanjiForms.filter((kanjiForm) => {
1234
+ const validKanjiForms = kanjiForms !== void 0 ? kanjiForms.filter((kanjiForm, index) => {
1235
+ if (index === 0) return true;
1234
1236
  if (existValidKf === true)
1235
1237
  return (kanjiForm.notes === void 0 || !kanjiForm.notes.some(
1236
1238
  (note) => notSearchedForms.has(note)