kaabalah 1.0.5 → 1.1.0

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.
@@ -2357,11 +2357,11 @@ var calculateGematria = (word, options = {}, tree) => {
2357
2357
  if (!tree) {
2358
2358
  tree = createTree({ system: SYSTEM2, parts: [] });
2359
2359
  }
2360
- const includedLetters = /* @__PURE__ */ new Map();
2360
+ const includedLetters = [];
2361
2361
  const words = word.toUpperCase().trim().split(" ");
2362
2362
  let vowelsSum = 0;
2363
2363
  let consonantsSum = 0;
2364
- const presentGematriaNumbers = /* @__PURE__ */ new Set();
2364
+ const includedGematriaValues = /* @__PURE__ */ new Set();
2365
2365
  const letterPercentages = {
2366
2366
  percentageOfVowels: 0,
2367
2367
  percentageOfConsonants: 0,
@@ -2382,8 +2382,8 @@ var calculateGematria = (word, options = {}, tree) => {
2382
2382
  if (isEnding2 && mapping2.data.gematriaValueWhenEnding !== void 0) {
2383
2383
  value = mapping2.data.gematriaValueWhenEnding;
2384
2384
  }
2385
- presentGematriaNumbers.add(value);
2386
- includedLetters.set(latinLetterId2, { letter: combinedLetter, value, hebrewLetter: { id: mapping2.id, data: mapping2.data }, isVowel: isVowel(letter) });
2385
+ includedGematriaValues.add(value);
2386
+ includedLetters.push({ latinLetterId: latinLetterId2, value, hebrewLetterId: mapping2.id, isVowel: isVowel(letter) });
2387
2387
  consonantsSum += value;
2388
2388
  i++;
2389
2389
  continue;
@@ -2404,8 +2404,8 @@ var calculateGematria = (word, options = {}, tree) => {
2404
2404
  if (isEnding && mapping.data.gematriaValueWhenEnding !== void 0) {
2405
2405
  value = mapping.data.gematriaValueWhenEnding;
2406
2406
  }
2407
- presentGematriaNumbers.add(value);
2408
- includedLetters.set(latinLetterId, { letter, value, hebrewLetter: { id: mapping.id, data: mapping.data }, isVowel: isVowel(letter) });
2407
+ includedGematriaValues.add(value);
2408
+ includedLetters.push({ latinLetterId, value, hebrewLetterId: mapping.id, isVowel: isVowel(letter) });
2409
2409
  if (isVowel(letter)) {
2410
2410
  vowelsSum += value;
2411
2411
  } else {
@@ -2413,7 +2413,7 @@ var calculateGematria = (word, options = {}, tree) => {
2413
2413
  }
2414
2414
  }
2415
2415
  }
2416
- if (options?.calculateLetterPercentage) {
2416
+ if (options?.calculateLetterPercentages) {
2417
2417
  const letterCount = letters.length;
2418
2418
  let vowelsCount = 0;
2419
2419
  let consonantsCount = 0;
@@ -2435,27 +2435,29 @@ var calculateGematria = (word, options = {}, tree) => {
2435
2435
  const synthesisReduction = reduceToSingleDigitWithSteps(
2436
2436
  vowelsSum + consonantsSum
2437
2437
  );
2438
- const missingGematriaNumbers = [];
2439
- if (options?.calculateMissingGematriaNumbers) {
2438
+ const missingGematriaValues = [];
2439
+ if (options?.calculateMissingGematriaValues) {
2440
2440
  for (const hebrewLetter of Object.values(HEBREW_LETTERS)) {
2441
2441
  const hebrewLetterNode = tree.getNode(`letter:${hebrewLetter}`);
2442
2442
  if (!hebrewLetterNode?.data) {
2443
2443
  continue;
2444
2444
  }
2445
- if (!presentGematriaNumbers.has(hebrewLetterNode.data.gematriaValue)) {
2446
- missingGematriaNumbers.push({
2447
- number: hebrewLetterNode.data.gematriaValue,
2448
- letter: hebrewLetter
2445
+ if (!includedGematriaValues.has(hebrewLetterNode.data.gematriaValue)) {
2446
+ missingGematriaValues.push({
2447
+ value: hebrewLetterNode.data.gematriaValue,
2448
+ hebrewLetter,
2449
+ whenEnding: false
2449
2450
  });
2450
2451
  }
2451
- if (hebrewLetterNode.data.gematriaValueWhenEnding && !presentGematriaNumbers.has(hebrewLetterNode.data.gematriaValueWhenEnding)) {
2452
- missingGematriaNumbers.push({
2453
- number: hebrewLetterNode.data.gematriaValueWhenEnding,
2454
- letter: `${hebrewLetter} (on ending)`
2452
+ if (hebrewLetterNode.data.gematriaValueWhenEnding && !includedGematriaValues.has(hebrewLetterNode.data.gematriaValueWhenEnding)) {
2453
+ missingGematriaValues.push({
2454
+ value: hebrewLetterNode.data.gematriaValueWhenEnding,
2455
+ hebrewLetter,
2456
+ whenEnding: true
2455
2457
  });
2456
2458
  }
2457
2459
  }
2458
- missingGematriaNumbers.sort((a, b) => a.number - b.number);
2460
+ missingGematriaValues.sort((a, b) => a.value - b.value);
2459
2461
  }
2460
2462
  return {
2461
2463
  vowels: {
@@ -2474,8 +2476,8 @@ var calculateGematria = (word, options = {}, tree) => {
2474
2476
  finalValue: synthesisReduction.finalValue
2475
2477
  },
2476
2478
  includedLetters,
2477
- missingGematriaNumbers: options?.calculateMissingGematriaNumbers ? missingGematriaNumbers : void 0,
2478
- letterPercentages: options?.calculateLetterPercentage ? letterPercentages : void 0
2479
+ missingGematriaValues: options?.calculateMissingGematriaValues ? missingGematriaValues : void 0,
2480
+ letterPercentages: options?.calculateLetterPercentages ? letterPercentages : void 0
2479
2481
  };
2480
2482
  };
2481
2483
  export {