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.
- package/dist/gematria/index.d.mts +11 -13
- package/dist/gematria/index.d.ts +11 -13
- package/dist/gematria/index.js +22 -20
- package/dist/gematria/index.js.map +1 -1
- package/dist/gematria/index.mjs +22 -20
- package/dist/gematria/index.mjs.map +1 -1
- package/dist/index.js +22 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5842,11 +5842,11 @@ var calculateGematria = (word, options = {}, tree) => {
|
|
|
5842
5842
|
if (!tree) {
|
|
5843
5843
|
tree = createTree({ system: SYSTEM2, parts: [] });
|
|
5844
5844
|
}
|
|
5845
|
-
const includedLetters =
|
|
5845
|
+
const includedLetters = [];
|
|
5846
5846
|
const words = word.toUpperCase().trim().split(" ");
|
|
5847
5847
|
let vowelsSum = 0;
|
|
5848
5848
|
let consonantsSum = 0;
|
|
5849
|
-
const
|
|
5849
|
+
const includedGematriaValues = /* @__PURE__ */ new Set();
|
|
5850
5850
|
const letterPercentages = {
|
|
5851
5851
|
percentageOfVowels: 0,
|
|
5852
5852
|
percentageOfConsonants: 0,
|
|
@@ -5867,8 +5867,8 @@ var calculateGematria = (word, options = {}, tree) => {
|
|
|
5867
5867
|
if (isEnding2 && mapping2.data.gematriaValueWhenEnding !== void 0) {
|
|
5868
5868
|
value = mapping2.data.gematriaValueWhenEnding;
|
|
5869
5869
|
}
|
|
5870
|
-
|
|
5871
|
-
includedLetters.
|
|
5870
|
+
includedGematriaValues.add(value);
|
|
5871
|
+
includedLetters.push({ latinLetterId: latinLetterId2, value, hebrewLetterId: mapping2.id, isVowel: isVowel(letter) });
|
|
5872
5872
|
consonantsSum += value;
|
|
5873
5873
|
i++;
|
|
5874
5874
|
continue;
|
|
@@ -5889,8 +5889,8 @@ var calculateGematria = (word, options = {}, tree) => {
|
|
|
5889
5889
|
if (isEnding && mapping.data.gematriaValueWhenEnding !== void 0) {
|
|
5890
5890
|
value = mapping.data.gematriaValueWhenEnding;
|
|
5891
5891
|
}
|
|
5892
|
-
|
|
5893
|
-
includedLetters.
|
|
5892
|
+
includedGematriaValues.add(value);
|
|
5893
|
+
includedLetters.push({ latinLetterId, value, hebrewLetterId: mapping.id, isVowel: isVowel(letter) });
|
|
5894
5894
|
if (isVowel(letter)) {
|
|
5895
5895
|
vowelsSum += value;
|
|
5896
5896
|
} else {
|
|
@@ -5898,7 +5898,7 @@ var calculateGematria = (word, options = {}, tree) => {
|
|
|
5898
5898
|
}
|
|
5899
5899
|
}
|
|
5900
5900
|
}
|
|
5901
|
-
if (options?.
|
|
5901
|
+
if (options?.calculateLetterPercentages) {
|
|
5902
5902
|
const letterCount = letters.length;
|
|
5903
5903
|
let vowelsCount = 0;
|
|
5904
5904
|
let consonantsCount = 0;
|
|
@@ -5920,27 +5920,29 @@ var calculateGematria = (word, options = {}, tree) => {
|
|
|
5920
5920
|
const synthesisReduction = reduceToSingleDigitWithSteps(
|
|
5921
5921
|
vowelsSum + consonantsSum
|
|
5922
5922
|
);
|
|
5923
|
-
const
|
|
5924
|
-
if (options?.
|
|
5923
|
+
const missingGematriaValues = [];
|
|
5924
|
+
if (options?.calculateMissingGematriaValues) {
|
|
5925
5925
|
for (const hebrewLetter of Object.values(HEBREW_LETTERS)) {
|
|
5926
5926
|
const hebrewLetterNode = tree.getNode(`letter:${hebrewLetter}`);
|
|
5927
5927
|
if (!hebrewLetterNode?.data) {
|
|
5928
5928
|
continue;
|
|
5929
5929
|
}
|
|
5930
|
-
if (!
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5930
|
+
if (!includedGematriaValues.has(hebrewLetterNode.data.gematriaValue)) {
|
|
5931
|
+
missingGematriaValues.push({
|
|
5932
|
+
value: hebrewLetterNode.data.gematriaValue,
|
|
5933
|
+
hebrewLetter,
|
|
5934
|
+
whenEnding: false
|
|
5934
5935
|
});
|
|
5935
5936
|
}
|
|
5936
|
-
if (hebrewLetterNode.data.gematriaValueWhenEnding && !
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
5937
|
+
if (hebrewLetterNode.data.gematriaValueWhenEnding && !includedGematriaValues.has(hebrewLetterNode.data.gematriaValueWhenEnding)) {
|
|
5938
|
+
missingGematriaValues.push({
|
|
5939
|
+
value: hebrewLetterNode.data.gematriaValueWhenEnding,
|
|
5940
|
+
hebrewLetter,
|
|
5941
|
+
whenEnding: true
|
|
5940
5942
|
});
|
|
5941
5943
|
}
|
|
5942
5944
|
}
|
|
5943
|
-
|
|
5945
|
+
missingGematriaValues.sort((a, b) => a.value - b.value);
|
|
5944
5946
|
}
|
|
5945
5947
|
return {
|
|
5946
5948
|
vowels: {
|
|
@@ -5959,8 +5961,8 @@ var calculateGematria = (word, options = {}, tree) => {
|
|
|
5959
5961
|
finalValue: synthesisReduction.finalValue
|
|
5960
5962
|
},
|
|
5961
5963
|
includedLetters,
|
|
5962
|
-
|
|
5963
|
-
letterPercentages: options?.
|
|
5964
|
+
missingGematriaValues: options?.calculateMissingGematriaValues ? missingGematriaValues : void 0,
|
|
5965
|
+
letterPercentages: options?.calculateLetterPercentages ? letterPercentages : void 0
|
|
5964
5966
|
};
|
|
5965
5967
|
};
|
|
5966
5968
|
|