kaabalah 1.0.4 → 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.
- package/dist/gematria/index.d.mts +11 -10
- package/dist/gematria/index.d.ts +11 -10
- package/dist/gematria/index.js +80 -72
- package/dist/gematria/index.js.map +1 -1
- package/dist/gematria/index.mjs +80 -72
- package/dist/gematria/index.mjs.map +1 -1
- package/dist/index.js +80 -72
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +80 -72
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { x as TreeOfLife
|
|
1
|
+
import { x as TreeOfLife } from '../registry-CRL4UJrw.mjs';
|
|
2
2
|
|
|
3
3
|
declare const calculateGematria: (word: string, options?: {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
calculateMissingGematriaValues?: boolean;
|
|
5
|
+
calculateLetterPercentages?: boolean;
|
|
6
6
|
}, tree?: TreeOfLife) => {
|
|
7
7
|
vowels: {
|
|
8
8
|
originalSum: number;
|
|
@@ -19,15 +19,16 @@ declare const calculateGematria: (word: string, options?: {
|
|
|
19
19
|
reductionSteps: number[];
|
|
20
20
|
finalValue: number;
|
|
21
21
|
};
|
|
22
|
-
includedLetters:
|
|
23
|
-
|
|
22
|
+
includedLetters: {
|
|
23
|
+
latinLetterId: string;
|
|
24
24
|
value: number;
|
|
25
|
-
|
|
25
|
+
hebrewLetterId: string;
|
|
26
26
|
isVowel: boolean;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
}[];
|
|
28
|
+
missingGematriaValues: {
|
|
29
|
+
value: number;
|
|
30
|
+
hebrewLetter: string;
|
|
31
|
+
whenEnding: boolean;
|
|
31
32
|
}[] | undefined;
|
|
32
33
|
letterPercentages: {
|
|
33
34
|
percentageOfVowels: number;
|
package/dist/gematria/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { x as TreeOfLife
|
|
1
|
+
import { x as TreeOfLife } from '../registry-CRL4UJrw.js';
|
|
2
2
|
|
|
3
3
|
declare const calculateGematria: (word: string, options?: {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
calculateMissingGematriaValues?: boolean;
|
|
5
|
+
calculateLetterPercentages?: boolean;
|
|
6
6
|
}, tree?: TreeOfLife) => {
|
|
7
7
|
vowels: {
|
|
8
8
|
originalSum: number;
|
|
@@ -19,15 +19,16 @@ declare const calculateGematria: (word: string, options?: {
|
|
|
19
19
|
reductionSteps: number[];
|
|
20
20
|
finalValue: number;
|
|
21
21
|
};
|
|
22
|
-
includedLetters:
|
|
23
|
-
|
|
22
|
+
includedLetters: {
|
|
23
|
+
latinLetterId: string;
|
|
24
24
|
value: number;
|
|
25
|
-
|
|
25
|
+
hebrewLetterId: string;
|
|
26
26
|
isVowel: boolean;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
}[];
|
|
28
|
+
missingGematriaValues: {
|
|
29
|
+
value: number;
|
|
30
|
+
hebrewLetter: string;
|
|
31
|
+
whenEnding: boolean;
|
|
31
32
|
}[] | undefined;
|
|
32
33
|
letterPercentages: {
|
|
33
34
|
percentageOfVowels: number;
|
package/dist/gematria/index.js
CHANGED
|
@@ -2377,99 +2377,107 @@ var calculateGematria = (word, options = {}, tree) => {
|
|
|
2377
2377
|
if (!tree) {
|
|
2378
2378
|
tree = createTree({ system: SYSTEM2, parts: [] });
|
|
2379
2379
|
}
|
|
2380
|
-
const includedLetters =
|
|
2381
|
-
const
|
|
2380
|
+
const includedLetters = [];
|
|
2381
|
+
const words = word.toUpperCase().trim().split(" ");
|
|
2382
2382
|
let vowelsSum = 0;
|
|
2383
2383
|
let consonantsSum = 0;
|
|
2384
|
-
const
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2384
|
+
const includedGematriaValues = /* @__PURE__ */ new Set();
|
|
2385
|
+
const letterPercentages = {
|
|
2386
|
+
percentageOfVowels: 0,
|
|
2387
|
+
percentageOfConsonants: 0,
|
|
2388
|
+
letters: {}
|
|
2389
|
+
};
|
|
2390
|
+
for (const word2 of words) {
|
|
2391
|
+
const letters = word2.split("");
|
|
2392
|
+
for (let i = 0; i < letters.length; i++) {
|
|
2393
|
+
const letter = letters[i].toLocaleUpperCase();
|
|
2394
|
+
const nextLetter = letters[i + 1]?.toLocaleLowerCase() || "";
|
|
2395
|
+
if (["P", "T", "K", "S", "C"].includes(letter) && nextLetter) {
|
|
2396
|
+
const combinedLetter = letter + nextLetter;
|
|
2397
|
+
const isEnding2 = i > 0 && i === letters.length - 2;
|
|
2398
|
+
const latinLetterId2 = `letter:${combinedLetter}`;
|
|
2399
|
+
const [mapping2] = tree.walk(latinLetterId2, 2, "hebrewLetter");
|
|
2400
|
+
if (mapping2?.data) {
|
|
2401
|
+
let value = mapping2.data.gematriaValue;
|
|
2402
|
+
if (isEnding2 && mapping2.data.gematriaValueWhenEnding !== void 0) {
|
|
2403
|
+
value = mapping2.data.gematriaValueWhenEnding;
|
|
2404
|
+
}
|
|
2405
|
+
includedGematriaValues.add(value);
|
|
2406
|
+
includedLetters.push({ latinLetterId: latinLetterId2, value, hebrewLetterId: mapping2.id, isVowel: isVowel(letter) });
|
|
2407
|
+
consonantsSum += value;
|
|
2408
|
+
i++;
|
|
2409
|
+
continue;
|
|
2396
2410
|
}
|
|
2397
|
-
presentGematriaNumbers.add(value);
|
|
2398
|
-
includedLetters.set(mapping2.id, { letter: combinedLetter, value, hebrewLetter: mapping2.data, isVowel: isVowel(letter) });
|
|
2399
|
-
consonantsSum += value;
|
|
2400
|
-
i++;
|
|
2401
|
-
continue;
|
|
2402
|
-
}
|
|
2403
|
-
}
|
|
2404
|
-
let mapping;
|
|
2405
|
-
const isStarting = i === 0;
|
|
2406
|
-
if (isStarting && letter === "O") {
|
|
2407
|
-
mapping = tree.getNode(`letter:${HEBREW_LETTERS.AIN}`);
|
|
2408
|
-
} else {
|
|
2409
|
-
mapping = tree.walk(`letter:${letter}`, 2, "hebrewLetter").at(0);
|
|
2410
|
-
}
|
|
2411
|
-
const isEnding = i > 0 && i === letters.length - 1;
|
|
2412
|
-
if (mapping?.data) {
|
|
2413
|
-
let value = mapping.data.gematriaValue;
|
|
2414
|
-
if (isEnding && mapping.data.gematriaValueWhenEnding !== void 0) {
|
|
2415
|
-
value = mapping.data.gematriaValueWhenEnding;
|
|
2416
2411
|
}
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2412
|
+
let mapping;
|
|
2413
|
+
let latinLetterId = `letter:${letter}`;
|
|
2414
|
+
const isStarting = i === 0;
|
|
2415
|
+
if (isStarting && letter === "O") {
|
|
2416
|
+
latinLetterId = `letter:${HEBREW_LETTERS.AIN}`;
|
|
2417
|
+
mapping = tree.getNode(latinLetterId);
|
|
2421
2418
|
} else {
|
|
2422
|
-
|
|
2419
|
+
mapping = tree.walk(latinLetterId, 2, "hebrewLetter").at(0);
|
|
2420
|
+
}
|
|
2421
|
+
const isEnding = i > 0 && i === letters.length - 1;
|
|
2422
|
+
if (mapping?.data) {
|
|
2423
|
+
let value = mapping.data.gematriaValue;
|
|
2424
|
+
if (isEnding && mapping.data.gematriaValueWhenEnding !== void 0) {
|
|
2425
|
+
value = mapping.data.gematriaValueWhenEnding;
|
|
2426
|
+
}
|
|
2427
|
+
includedGematriaValues.add(value);
|
|
2428
|
+
includedLetters.push({ latinLetterId, value, hebrewLetterId: mapping.id, isVowel: isVowel(letter) });
|
|
2429
|
+
if (isVowel(letter)) {
|
|
2430
|
+
vowelsSum += value;
|
|
2431
|
+
} else {
|
|
2432
|
+
consonantsSum += value;
|
|
2433
|
+
}
|
|
2423
2434
|
}
|
|
2424
2435
|
}
|
|
2436
|
+
if (options?.calculateLetterPercentages) {
|
|
2437
|
+
const letterCount = letters.length;
|
|
2438
|
+
let vowelsCount = 0;
|
|
2439
|
+
let consonantsCount = 0;
|
|
2440
|
+
for (const letter of new Set(letters)) {
|
|
2441
|
+
const occurrences = letters.filter((l) => l === letter).length;
|
|
2442
|
+
letterPercentages.letters[letter] = occurrences / letterCount * 100;
|
|
2443
|
+
if (isVowel(letter)) {
|
|
2444
|
+
vowelsCount += occurrences;
|
|
2445
|
+
} else {
|
|
2446
|
+
consonantsCount += occurrences;
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
letterPercentages.percentageOfVowels = vowelsCount / letterCount * 100;
|
|
2450
|
+
letterPercentages.percentageOfConsonants = consonantsCount / letterCount * 100;
|
|
2451
|
+
}
|
|
2425
2452
|
}
|
|
2426
2453
|
const vowelsReduction = reduceToSingleDigitWithSteps(vowelsSum);
|
|
2427
2454
|
const consonantsReduction = reduceToSingleDigitWithSteps(consonantsSum);
|
|
2428
2455
|
const synthesisReduction = reduceToSingleDigitWithSteps(
|
|
2429
2456
|
vowelsSum + consonantsSum
|
|
2430
2457
|
);
|
|
2431
|
-
const
|
|
2432
|
-
if (options?.
|
|
2458
|
+
const missingGematriaValues = [];
|
|
2459
|
+
if (options?.calculateMissingGematriaValues) {
|
|
2433
2460
|
for (const hebrewLetter of Object.values(HEBREW_LETTERS)) {
|
|
2434
2461
|
const hebrewLetterNode = tree.getNode(`letter:${hebrewLetter}`);
|
|
2435
2462
|
if (!hebrewLetterNode?.data) {
|
|
2436
2463
|
continue;
|
|
2437
2464
|
}
|
|
2438
|
-
if (!
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2465
|
+
if (!includedGematriaValues.has(hebrewLetterNode.data.gematriaValue)) {
|
|
2466
|
+
missingGematriaValues.push({
|
|
2467
|
+
value: hebrewLetterNode.data.gematriaValue,
|
|
2468
|
+
hebrewLetter,
|
|
2469
|
+
whenEnding: false
|
|
2442
2470
|
});
|
|
2443
2471
|
}
|
|
2444
|
-
if (hebrewLetterNode.data.gematriaValueWhenEnding && !
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2472
|
+
if (hebrewLetterNode.data.gematriaValueWhenEnding && !includedGematriaValues.has(hebrewLetterNode.data.gematriaValueWhenEnding)) {
|
|
2473
|
+
missingGematriaValues.push({
|
|
2474
|
+
value: hebrewLetterNode.data.gematriaValueWhenEnding,
|
|
2475
|
+
hebrewLetter,
|
|
2476
|
+
whenEnding: true
|
|
2448
2477
|
});
|
|
2449
2478
|
}
|
|
2450
2479
|
}
|
|
2451
|
-
|
|
2452
|
-
}
|
|
2453
|
-
const letterPercentages = {
|
|
2454
|
-
percentageOfVowels: 0,
|
|
2455
|
-
percentageOfConsonants: 0,
|
|
2456
|
-
letters: {}
|
|
2457
|
-
};
|
|
2458
|
-
if (options?.calculateLetterPercentage) {
|
|
2459
|
-
const letterCount = letters.length;
|
|
2460
|
-
let vowelsCount = 0;
|
|
2461
|
-
let consonantsCount = 0;
|
|
2462
|
-
for (const [_, letter] of includedLetters) {
|
|
2463
|
-
const occurrences = letters.filter((l) => l === letter.letter).length;
|
|
2464
|
-
letterPercentages.letters[letter.letter] = occurrences / letterCount * 100;
|
|
2465
|
-
if (letter.isVowel) {
|
|
2466
|
-
vowelsCount += occurrences;
|
|
2467
|
-
} else {
|
|
2468
|
-
consonantsCount += occurrences;
|
|
2469
|
-
}
|
|
2470
|
-
}
|
|
2471
|
-
letterPercentages.percentageOfVowels = vowelsCount / letterCount * 100;
|
|
2472
|
-
letterPercentages.percentageOfConsonants = consonantsCount / letterCount * 100;
|
|
2480
|
+
missingGematriaValues.sort((a, b) => a.value - b.value);
|
|
2473
2481
|
}
|
|
2474
2482
|
return {
|
|
2475
2483
|
vowels: {
|
|
@@ -2488,8 +2496,8 @@ var calculateGematria = (word, options = {}, tree) => {
|
|
|
2488
2496
|
finalValue: synthesisReduction.finalValue
|
|
2489
2497
|
},
|
|
2490
2498
|
includedLetters,
|
|
2491
|
-
|
|
2492
|
-
letterPercentages: options?.
|
|
2499
|
+
missingGematriaValues: options?.calculateMissingGematriaValues ? missingGematriaValues : void 0,
|
|
2500
|
+
letterPercentages: options?.calculateLetterPercentages ? letterPercentages : void 0
|
|
2493
2501
|
};
|
|
2494
2502
|
};
|
|
2495
2503
|
// Annotate the CommonJS export names for ESM import in node:
|