kaabalah 1.0.5 → 1.1.1

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.
@@ -1,8 +1,8 @@
1
- import { x as TreeOfLife, N as NodeId, b as NodeData } from '../registry-CRL4UJrw.mjs';
1
+ import { x as TreeOfLife } from '../registry-CRL4UJrw.mjs';
2
2
 
3
3
  declare const calculateGematria: (word: string, options?: {
4
- calculateMissingGematriaNumbers?: boolean;
5
- calculateLetterPercentage?: boolean;
4
+ calculateMissingGematriaValues?: boolean;
5
+ calculateLetterPercentages?: boolean;
6
6
  }, tree?: TreeOfLife) => {
7
7
  vowels: {
8
8
  originalSum: number;
@@ -19,18 +19,16 @@ declare const calculateGematria: (word: string, options?: {
19
19
  reductionSteps: number[];
20
20
  finalValue: number;
21
21
  };
22
- includedLetters: Map<string, {
23
- letter: string;
22
+ includedLetters: {
23
+ latinLetterId: string;
24
24
  value: number;
25
- hebrewLetter: {
26
- id: NodeId;
27
- data: NodeData<"hebrewLetter">;
28
- };
25
+ hebrewLetterId: string;
29
26
  isVowel: boolean;
30
- }>;
31
- missingGematriaNumbers: {
32
- number: number;
33
- letter: string;
27
+ }[];
28
+ missingGematriaValues: {
29
+ value: number;
30
+ hebrewLetterId: string;
31
+ whenEnding: boolean;
34
32
  }[] | undefined;
35
33
  letterPercentages: {
36
34
  percentageOfVowels: number;
@@ -1,8 +1,8 @@
1
- import { x as TreeOfLife, N as NodeId, b as NodeData } from '../registry-CRL4UJrw.js';
1
+ import { x as TreeOfLife } from '../registry-CRL4UJrw.js';
2
2
 
3
3
  declare const calculateGematria: (word: string, options?: {
4
- calculateMissingGematriaNumbers?: boolean;
5
- calculateLetterPercentage?: boolean;
4
+ calculateMissingGematriaValues?: boolean;
5
+ calculateLetterPercentages?: boolean;
6
6
  }, tree?: TreeOfLife) => {
7
7
  vowels: {
8
8
  originalSum: number;
@@ -19,18 +19,16 @@ declare const calculateGematria: (word: string, options?: {
19
19
  reductionSteps: number[];
20
20
  finalValue: number;
21
21
  };
22
- includedLetters: Map<string, {
23
- letter: string;
22
+ includedLetters: {
23
+ latinLetterId: string;
24
24
  value: number;
25
- hebrewLetter: {
26
- id: NodeId;
27
- data: NodeData<"hebrewLetter">;
28
- };
25
+ hebrewLetterId: string;
29
26
  isVowel: boolean;
30
- }>;
31
- missingGematriaNumbers: {
32
- number: number;
33
- letter: string;
27
+ }[];
28
+ missingGematriaValues: {
29
+ value: number;
30
+ hebrewLetterId: string;
31
+ whenEnding: boolean;
34
32
  }[] | undefined;
35
33
  letterPercentages: {
36
34
  percentageOfVowels: number;
@@ -2377,11 +2377,11 @@ var calculateGematria = (word, options = {}, tree) => {
2377
2377
  if (!tree) {
2378
2378
  tree = createTree({ system: SYSTEM2, parts: [] });
2379
2379
  }
2380
- const includedLetters = /* @__PURE__ */ new Map();
2380
+ const includedLetters = [];
2381
2381
  const words = word.toUpperCase().trim().split(" ");
2382
2382
  let vowelsSum = 0;
2383
2383
  let consonantsSum = 0;
2384
- const presentGematriaNumbers = /* @__PURE__ */ new Set();
2384
+ const includedGematriaValues = /* @__PURE__ */ new Set();
2385
2385
  const letterPercentages = {
2386
2386
  percentageOfVowels: 0,
2387
2387
  percentageOfConsonants: 0,
@@ -2402,8 +2402,8 @@ var calculateGematria = (word, options = {}, tree) => {
2402
2402
  if (isEnding2 && mapping2.data.gematriaValueWhenEnding !== void 0) {
2403
2403
  value = mapping2.data.gematriaValueWhenEnding;
2404
2404
  }
2405
- presentGematriaNumbers.add(value);
2406
- includedLetters.set(latinLetterId2, { letter: combinedLetter, value, hebrewLetter: { id: mapping2.id, data: mapping2.data }, isVowel: isVowel(letter) });
2405
+ includedGematriaValues.add(value);
2406
+ includedLetters.push({ latinLetterId: latinLetterId2, value, hebrewLetterId: mapping2.id, isVowel: isVowel(letter) });
2407
2407
  consonantsSum += value;
2408
2408
  i++;
2409
2409
  continue;
@@ -2424,8 +2424,8 @@ var calculateGematria = (word, options = {}, tree) => {
2424
2424
  if (isEnding && mapping.data.gematriaValueWhenEnding !== void 0) {
2425
2425
  value = mapping.data.gematriaValueWhenEnding;
2426
2426
  }
2427
- presentGematriaNumbers.add(value);
2428
- includedLetters.set(latinLetterId, { letter, value, hebrewLetter: { id: mapping.id, data: mapping.data }, isVowel: isVowel(letter) });
2427
+ includedGematriaValues.add(value);
2428
+ includedLetters.push({ latinLetterId, value, hebrewLetterId: mapping.id, isVowel: isVowel(letter) });
2429
2429
  if (isVowel(letter)) {
2430
2430
  vowelsSum += value;
2431
2431
  } else {
@@ -2433,7 +2433,7 @@ var calculateGematria = (word, options = {}, tree) => {
2433
2433
  }
2434
2434
  }
2435
2435
  }
2436
- if (options?.calculateLetterPercentage) {
2436
+ if (options?.calculateLetterPercentages) {
2437
2437
  const letterCount = letters.length;
2438
2438
  let vowelsCount = 0;
2439
2439
  let consonantsCount = 0;
@@ -2455,27 +2455,30 @@ var calculateGematria = (word, options = {}, tree) => {
2455
2455
  const synthesisReduction = reduceToSingleDigitWithSteps(
2456
2456
  vowelsSum + consonantsSum
2457
2457
  );
2458
- const missingGematriaNumbers = [];
2459
- if (options?.calculateMissingGematriaNumbers) {
2458
+ const missingGematriaValues = [];
2459
+ if (options?.calculateMissingGematriaValues) {
2460
2460
  for (const hebrewLetter of Object.values(HEBREW_LETTERS)) {
2461
- const hebrewLetterNode = tree.getNode(`letter:${hebrewLetter}`);
2461
+ const hebrewLetterId = `letter:${hebrewLetter}`;
2462
+ const hebrewLetterNode = tree.getNode(hebrewLetterId);
2462
2463
  if (!hebrewLetterNode?.data) {
2463
2464
  continue;
2464
2465
  }
2465
- if (!presentGematriaNumbers.has(hebrewLetterNode.data.gematriaValue)) {
2466
- missingGematriaNumbers.push({
2467
- number: hebrewLetterNode.data.gematriaValue,
2468
- letter: hebrewLetter
2466
+ if (!includedGematriaValues.has(hebrewLetterNode.data.gematriaValue)) {
2467
+ missingGematriaValues.push({
2468
+ value: hebrewLetterNode.data.gematriaValue,
2469
+ hebrewLetterId,
2470
+ whenEnding: false
2469
2471
  });
2470
2472
  }
2471
- if (hebrewLetterNode.data.gematriaValueWhenEnding && !presentGematriaNumbers.has(hebrewLetterNode.data.gematriaValueWhenEnding)) {
2472
- missingGematriaNumbers.push({
2473
- number: hebrewLetterNode.data.gematriaValueWhenEnding,
2474
- letter: `${hebrewLetter} (on ending)`
2473
+ if (hebrewLetterNode.data.gematriaValueWhenEnding && !includedGematriaValues.has(hebrewLetterNode.data.gematriaValueWhenEnding)) {
2474
+ missingGematriaValues.push({
2475
+ value: hebrewLetterNode.data.gematriaValueWhenEnding,
2476
+ hebrewLetterId,
2477
+ whenEnding: true
2475
2478
  });
2476
2479
  }
2477
2480
  }
2478
- missingGematriaNumbers.sort((a, b) => a.number - b.number);
2481
+ missingGematriaValues.sort((a, b) => a.value - b.value);
2479
2482
  }
2480
2483
  return {
2481
2484
  vowels: {
@@ -2494,8 +2497,8 @@ var calculateGematria = (word, options = {}, tree) => {
2494
2497
  finalValue: synthesisReduction.finalValue
2495
2498
  },
2496
2499
  includedLetters,
2497
- missingGematriaNumbers: options?.calculateMissingGematriaNumbers ? missingGematriaNumbers : void 0,
2498
- letterPercentages: options?.calculateLetterPercentage ? letterPercentages : void 0
2500
+ missingGematriaValues: options?.calculateMissingGematriaValues ? missingGematriaValues : void 0,
2501
+ letterPercentages: options?.calculateLetterPercentages ? letterPercentages : void 0
2499
2502
  };
2500
2503
  };
2501
2504
  // Annotate the CommonJS export names for ESM import in node: