kaabalah 6.4.3 → 6.4.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/chunk-2WCC2KCJ.js +76 -0
- package/dist/chunk-2WCC2KCJ.js.map +1 -0
- package/dist/chunk-URDMOQRN.mjs +74 -0
- package/dist/chunk-URDMOQRN.mjs.map +1 -0
- package/dist/cli.js +40 -16
- package/dist/cli.js.map +1 -1
- package/dist/ifa/index.js +2 -2
- package/dist/ifa/index.mjs +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-3WVZRLPG.js +0 -52
- package/dist/chunk-3WVZRLPG.js.map +0 -1
- package/dist/chunk-YTZCZRJG.mjs +0 -50
- package/dist/chunk-YTZCZRJG.mjs.map +0 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/ifa/index.ts
|
|
4
|
+
function isMidnight(date, mode) {
|
|
5
|
+
if (mode === "utc") {
|
|
6
|
+
return date.getUTCHours() === 0 && date.getUTCMinutes() === 0 && date.getUTCSeconds() === 0 && date.getUTCMilliseconds() === 0;
|
|
7
|
+
}
|
|
8
|
+
return date.getHours() === 0 && date.getMinutes() === 0 && date.getSeconds() === 0 && date.getMilliseconds() === 0;
|
|
9
|
+
}
|
|
10
|
+
function extractDateParts(date) {
|
|
11
|
+
if (!(date instanceof Date) || Number.isNaN(date.getTime())) {
|
|
12
|
+
throw new Error("Date must be a valid Date object");
|
|
13
|
+
}
|
|
14
|
+
const useLocalDate = isMidnight(date, "local") && !isMidnight(date, "utc");
|
|
15
|
+
if (useLocalDate) {
|
|
16
|
+
return {
|
|
17
|
+
day: date.getDate().toString().padStart(2, "0"),
|
|
18
|
+
month: (date.getMonth() + 1).toString().padStart(2, "0"),
|
|
19
|
+
year: date.getFullYear().toString().padStart(4, "0")
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const formattedDate = date.toISOString().split("T")[0];
|
|
23
|
+
const [year, month, day] = formattedDate.split("-");
|
|
24
|
+
return { day, month, year };
|
|
25
|
+
}
|
|
26
|
+
function reduceNumber(num) {
|
|
27
|
+
if (num <= 16) {
|
|
28
|
+
return num;
|
|
29
|
+
}
|
|
30
|
+
return reduceNumber(
|
|
31
|
+
num.toString().split("").reduce((sum, digit) => sum + Number.parseInt(digit, 10), 0)
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
function calculateOdu(date) {
|
|
35
|
+
const { day, month, year } = extractDateParts(date);
|
|
36
|
+
const leftNumbers = [
|
|
37
|
+
Number.parseInt(day[0], 10),
|
|
38
|
+
// First digit of day
|
|
39
|
+
Number.parseInt(month[0], 10),
|
|
40
|
+
// First digit of month
|
|
41
|
+
Number.parseInt(year[0], 10),
|
|
42
|
+
// First digit of year
|
|
43
|
+
Number.parseInt(year[2], 10)
|
|
44
|
+
// Third digit of year
|
|
45
|
+
];
|
|
46
|
+
const rightNumbers = [
|
|
47
|
+
Number.parseInt(day[1], 10),
|
|
48
|
+
// Second digit of day
|
|
49
|
+
Number.parseInt(month[1], 10),
|
|
50
|
+
// Second digit of month
|
|
51
|
+
Number.parseInt(year[1], 10),
|
|
52
|
+
// Second digit of year
|
|
53
|
+
Number.parseInt(year[3], 10)
|
|
54
|
+
// Fourth digit of year
|
|
55
|
+
];
|
|
56
|
+
const rawLeftSum = leftNumbers.reduce((a, b) => a + b, 0);
|
|
57
|
+
const rawRightSum = rightNumbers.reduce((a, b) => a + b, 0);
|
|
58
|
+
const north = reduceNumber(rawLeftSum);
|
|
59
|
+
const south = reduceNumber(rawRightSum);
|
|
60
|
+
const east = reduceNumber(north + south);
|
|
61
|
+
const west = reduceNumber(north + south + east);
|
|
62
|
+
const center = reduceNumber(north + south + east + west);
|
|
63
|
+
return {
|
|
64
|
+
leftNumbers,
|
|
65
|
+
rightNumbers,
|
|
66
|
+
north,
|
|
67
|
+
south,
|
|
68
|
+
east,
|
|
69
|
+
west,
|
|
70
|
+
center
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
exports.calculateOdu = calculateOdu;
|
|
75
|
+
//# sourceMappingURL=chunk-2WCC2KCJ.js.map
|
|
76
|
+
//# sourceMappingURL=chunk-2WCC2KCJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ifa/index.ts"],"names":[],"mappings":";;;AAWA,SAAS,UAAA,CAAW,MAAY,IAAgC,EAAA;AAC9D,EAAA,IAAI,SAAS,KAAO,EAAA;AAClB,IAAA,OACE,IAAK,CAAA,WAAA,EAAkB,KAAA,CAAA,IACvB,KAAK,aAAc,EAAA,KAAM,CACzB,IAAA,IAAA,CAAK,aAAc,EAAA,KAAM,CACzB,IAAA,IAAA,CAAK,oBAAyB,KAAA,CAAA;AAAA;AAIlC,EAAA,OACE,IAAK,CAAA,QAAA,EAAe,KAAA,CAAA,IACpB,KAAK,UAAW,EAAA,KAAM,CACtB,IAAA,IAAA,CAAK,UAAW,EAAA,KAAM,CACtB,IAAA,IAAA,CAAK,iBAAsB,KAAA,CAAA;AAE/B;AAEA,SAAS,iBAAiB,IAA0D,EAAA;AAClF,EAAI,IAAA,EAAE,gBAAgB,IAAS,CAAA,IAAA,MAAA,CAAO,MAAM,IAAK,CAAA,OAAA,EAAS,CAAG,EAAA;AAC3D,IAAM,MAAA,IAAI,MAAM,kCAAkC,CAAA;AAAA;AAGpD,EAAM,MAAA,YAAA,GAAe,WAAW,IAAM,EAAA,OAAO,KAAK,CAAC,UAAA,CAAW,MAAM,KAAK,CAAA;AAEzE,EAAA,IAAI,YAAc,EAAA;AAChB,IAAO,OAAA;AAAA,MACL,GAAA,EAAK,KAAK,OAAQ,EAAA,CAAE,UAAW,CAAA,QAAA,CAAS,GAAG,GAAG,CAAA;AAAA,MAC9C,KAAA,EAAA,CAAQ,KAAK,QAAS,EAAA,GAAI,GAAG,QAAS,EAAA,CAAE,QAAS,CAAA,CA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,EAAE,CAAA;AAAA;AAAA,IAC1B,MAAO,CAAA,QAAA,CAAS,KAAM,CAAA,CAAC,GAAG,EAAE,CAAA;AAAA;AAAA,IAC5B,MAAO,CAAA,QAAA,CAAS,IAAK,CAAA,CAAC,GAAG,EAAE,CAAA;AAAA;AAAA,IAC3B,MAAO,CAAA,QAAA,CAAS,IAAK,CAAA,CAAC,GAAG,EAAE;AAAA;AAAA,GAC7B;AAGA,EAAM,MAAA,UAAA,GAAa,YAAY,MAAO,CAAA,CAAC,GAAG,CAAM,KAAA,CAAA,GAAI,GAAG,CAAC,CAAA;AACxD,EAAM,MAAA,WAAA,GAAc,aAAa,MAAO,CAAA,CAAC,GAAG,CAAM,KAAA,CAAA,GAAI,GAAG,CAAC,CAAA;AAG1D,EAAM,MAAA,KAAA,GAAQ,aAAa,UAAU,CAAA;AACrC,EAAM,MAAA,KAAA,GAAQ,aAAa,WAAW,CAAA;AACtC,EAAM,MAAA,IAAA,GAAO,YAAa,CAAA,KAAA,GAAQ,KAAK,CAAA;AACvC,EAAA,MAAM,IAAO,GAAA,YAAA,CAAa,KAAQ,GAAA,KAAA,GAAQ,IAAI,CAAA;AAC9C,EAAA,MAAM,MAAS,GAAA,YAAA,CAAa,KAAQ,GAAA,KAAA,GAAQ,OAAO,IAAI,CAAA;AAEvD,EAAO,OAAA;AAAA,IACL,WAAA;AAAA,IACA,YAAA;AAAA,IACA,KAAA;AAAA,IACA,KAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA;AAAA,GACF;AACF","file":"chunk-2WCC2KCJ.js","sourcesContent":["\nexport type OduNumbers = {\n leftNumbers: number[],\n rightNumbers: number[],\n north: number,\n south: number,\n east: number,\n west: number,\n center: number\n}\n\nfunction isMidnight(date: Date, mode: \"local\" | \"utc\"): boolean {\n if (mode === \"utc\") {\n return (\n date.getUTCHours() === 0 &&\n date.getUTCMinutes() === 0 &&\n date.getUTCSeconds() === 0 &&\n date.getUTCMilliseconds() === 0\n );\n }\n\n return (\n date.getHours() === 0 &&\n date.getMinutes() === 0 &&\n date.getSeconds() === 0 &&\n date.getMilliseconds() === 0\n );\n}\n\nfunction extractDateParts(date: Date): { day: string; month: string; year: string } {\n if (!(date instanceof Date) || Number.isNaN(date.getTime())) {\n throw new Error(\"Date must be a valid Date object\");\n }\n\n const useLocalDate = isMidnight(date, \"local\") && !isMidnight(date, \"utc\");\n\n if (useLocalDate) {\n return {\n day: date.getDate().toString().padStart(2, \"0\"),\n month: (date.getMonth() + 1).toString().padStart(2, \"0\"),\n year: date.getFullYear().toString().padStart(4, \"0\"),\n };\n }\n\n const formattedDate = date.toISOString().split(\"T\")[0];\n const [year, month, day] = formattedDate.split(\"-\");\n\n return { day, month, year };\n}\n\nfunction reduceNumber(num: number): number {\n if (num <= 16) {\n return num;\n }\n\n return reduceNumber(\n num\n .toString()\n .split(\"\")\n .reduce((sum, digit) => sum + Number.parseInt(digit, 10), 0)\n );\n}\n\n/**\n * Calculate the Odu numbers based on a date\n * @param date - Date object\n * @returns Odu numbers\n */\nexport function calculateOdu(date: Date): OduNumbers {\n const { day, month, year } = extractDateParts(date);\n\n // Split into left and right columns\n const leftNumbers = [\n Number.parseInt(day[0], 10), // First digit of day\n Number.parseInt(month[0], 10), // First digit of month\n Number.parseInt(year[0], 10), // First digit of year\n Number.parseInt(year[2], 10) // Third digit of year\n ];\n\n const rightNumbers = [\n Number.parseInt(day[1], 10), // Second digit of day\n Number.parseInt(month[1], 10), // Second digit of month\n Number.parseInt(year[1], 10), // Second digit of year\n Number.parseInt(year[3], 10) // Fourth digit of year\n ];\n\n // Calculate initial sums\n const rawLeftSum = leftNumbers.reduce((a, b) => a + b, 0);\n const rawRightSum = rightNumbers.reduce((a, b) => a + b, 0);\n\n // Calculate and reduce each direction\n const north = reduceNumber(rawLeftSum);\n const south = reduceNumber(rawRightSum);\n const east = reduceNumber(north + south);\n const west = reduceNumber(north + south + east);\n const center = reduceNumber(north + south + east + west);\n\n return {\n leftNumbers,\n rightNumbers,\n north,\n south,\n east,\n west,\n center\n };\n}\n"]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// src/ifa/index.ts
|
|
2
|
+
function isMidnight(date, mode) {
|
|
3
|
+
if (mode === "utc") {
|
|
4
|
+
return date.getUTCHours() === 0 && date.getUTCMinutes() === 0 && date.getUTCSeconds() === 0 && date.getUTCMilliseconds() === 0;
|
|
5
|
+
}
|
|
6
|
+
return date.getHours() === 0 && date.getMinutes() === 0 && date.getSeconds() === 0 && date.getMilliseconds() === 0;
|
|
7
|
+
}
|
|
8
|
+
function extractDateParts(date) {
|
|
9
|
+
if (!(date instanceof Date) || Number.isNaN(date.getTime())) {
|
|
10
|
+
throw new Error("Date must be a valid Date object");
|
|
11
|
+
}
|
|
12
|
+
const useLocalDate = isMidnight(date, "local") && !isMidnight(date, "utc");
|
|
13
|
+
if (useLocalDate) {
|
|
14
|
+
return {
|
|
15
|
+
day: date.getDate().toString().padStart(2, "0"),
|
|
16
|
+
month: (date.getMonth() + 1).toString().padStart(2, "0"),
|
|
17
|
+
year: date.getFullYear().toString().padStart(4, "0")
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const formattedDate = date.toISOString().split("T")[0];
|
|
21
|
+
const [year, month, day] = formattedDate.split("-");
|
|
22
|
+
return { day, month, year };
|
|
23
|
+
}
|
|
24
|
+
function reduceNumber(num) {
|
|
25
|
+
if (num <= 16) {
|
|
26
|
+
return num;
|
|
27
|
+
}
|
|
28
|
+
return reduceNumber(
|
|
29
|
+
num.toString().split("").reduce((sum, digit) => sum + Number.parseInt(digit, 10), 0)
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
function calculateOdu(date) {
|
|
33
|
+
const { day, month, year } = extractDateParts(date);
|
|
34
|
+
const leftNumbers = [
|
|
35
|
+
Number.parseInt(day[0], 10),
|
|
36
|
+
// First digit of day
|
|
37
|
+
Number.parseInt(month[0], 10),
|
|
38
|
+
// First digit of month
|
|
39
|
+
Number.parseInt(year[0], 10),
|
|
40
|
+
// First digit of year
|
|
41
|
+
Number.parseInt(year[2], 10)
|
|
42
|
+
// Third digit of year
|
|
43
|
+
];
|
|
44
|
+
const rightNumbers = [
|
|
45
|
+
Number.parseInt(day[1], 10),
|
|
46
|
+
// Second digit of day
|
|
47
|
+
Number.parseInt(month[1], 10),
|
|
48
|
+
// Second digit of month
|
|
49
|
+
Number.parseInt(year[1], 10),
|
|
50
|
+
// Second digit of year
|
|
51
|
+
Number.parseInt(year[3], 10)
|
|
52
|
+
// Fourth digit of year
|
|
53
|
+
];
|
|
54
|
+
const rawLeftSum = leftNumbers.reduce((a, b) => a + b, 0);
|
|
55
|
+
const rawRightSum = rightNumbers.reduce((a, b) => a + b, 0);
|
|
56
|
+
const north = reduceNumber(rawLeftSum);
|
|
57
|
+
const south = reduceNumber(rawRightSum);
|
|
58
|
+
const east = reduceNumber(north + south);
|
|
59
|
+
const west = reduceNumber(north + south + east);
|
|
60
|
+
const center = reduceNumber(north + south + east + west);
|
|
61
|
+
return {
|
|
62
|
+
leftNumbers,
|
|
63
|
+
rightNumbers,
|
|
64
|
+
north,
|
|
65
|
+
south,
|
|
66
|
+
east,
|
|
67
|
+
west,
|
|
68
|
+
center
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { calculateOdu };
|
|
73
|
+
//# sourceMappingURL=chunk-URDMOQRN.mjs.map
|
|
74
|
+
//# sourceMappingURL=chunk-URDMOQRN.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ifa/index.ts"],"names":[],"mappings":";AAWA,SAAS,UAAA,CAAW,MAAY,IAAgC,EAAA;AAC9D,EAAA,IAAI,SAAS,KAAO,EAAA;AAClB,IAAA,OACE,IAAK,CAAA,WAAA,EAAkB,KAAA,CAAA,IACvB,KAAK,aAAc,EAAA,KAAM,CACzB,IAAA,IAAA,CAAK,aAAc,EAAA,KAAM,CACzB,IAAA,IAAA,CAAK,oBAAyB,KAAA,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AACrC,EAAM,MAAA,KAAA,GAAQ,aAAa,WAAW,CAAA;AACtC,EAAM,MAAA,IAAA,GAAO,YAAa,CAAA,KAAA,GAAQ,KAAK,CAAA;AACvC,EAAA,MAAM,IAAO,GAAA,YAAA,CAAa,KAAQ,GAAA,KAAA,GAAQ,IAAI,CAAA;AAC9C,EAAA,MAAM,MAAS,GAAA,YAAA,CAAa,KAAQ,GAAA,KAAA,GAAQ,OAAO,IAAI,CAAA;AAEvD,EAAO,OAAA;AAAA,IACL,WAAA;AAAA,IACA,YAAA;AAAA,IACA,KAAA;AAAA,IACA,KAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA;AAAA,GACF;AACF","file":"chunk-URDMOQRN.mjs","sourcesContent":["\nexport type OduNumbers = {\n leftNumbers: number[],\n rightNumbers: number[],\n north: number,\n south: number,\n east: number,\n west: number,\n center: number\n}\n\nfunction isMidnight(date: Date, mode: \"local\" | \"utc\"): boolean {\n if (mode === \"utc\") {\n return (\n date.getUTCHours() === 0 &&\n date.getUTCMinutes() === 0 &&\n date.getUTCSeconds() === 0 &&\n date.getUTCMilliseconds() === 0\n );\n }\n\n return (\n date.getHours() === 0 &&\n date.getMinutes() === 0 &&\n date.getSeconds() === 0 &&\n date.getMilliseconds() === 0\n );\n}\n\nfunction extractDateParts(date: Date): { day: string; month: string; year: string } {\n if (!(date instanceof Date) || Number.isNaN(date.getTime())) {\n throw new Error(\"Date must be a valid Date object\");\n }\n\n const useLocalDate = isMidnight(date, \"local\") && !isMidnight(date, \"utc\");\n\n if (useLocalDate) {\n return {\n day: date.getDate().toString().padStart(2, \"0\"),\n month: (date.getMonth() + 1).toString().padStart(2, \"0\"),\n year: date.getFullYear().toString().padStart(4, \"0\"),\n };\n }\n\n const formattedDate = date.toISOString().split(\"T\")[0];\n const [year, month, day] = formattedDate.split(\"-\");\n\n return { day, month, year };\n}\n\nfunction reduceNumber(num: number): number {\n if (num <= 16) {\n return num;\n }\n\n return reduceNumber(\n num\n .toString()\n .split(\"\")\n .reduce((sum, digit) => sum + Number.parseInt(digit, 10), 0)\n );\n}\n\n/**\n * Calculate the Odu numbers based on a date\n * @param date - Date object\n * @returns Odu numbers\n */\nexport function calculateOdu(date: Date): OduNumbers {\n const { day, month, year } = extractDateParts(date);\n\n // Split into left and right columns\n const leftNumbers = [\n Number.parseInt(day[0], 10), // First digit of day\n Number.parseInt(month[0], 10), // First digit of month\n Number.parseInt(year[0], 10), // First digit of year\n Number.parseInt(year[2], 10) // Third digit of year\n ];\n\n const rightNumbers = [\n Number.parseInt(day[1], 10), // Second digit of day\n Number.parseInt(month[1], 10), // Second digit of month\n Number.parseInt(year[1], 10), // Second digit of year\n Number.parseInt(year[3], 10) // Fourth digit of year\n ];\n\n // Calculate initial sums\n const rawLeftSum = leftNumbers.reduce((a, b) => a + b, 0);\n const rawRightSum = rightNumbers.reduce((a, b) => a + b, 0);\n\n // Calculate and reduce each direction\n const north = reduceNumber(rawLeftSum);\n const south = reduceNumber(rawRightSum);\n const east = reduceNumber(north + south);\n const west = reduceNumber(north + south + east);\n const center = reduceNumber(north + south + east + west);\n\n return {\n leftNumbers,\n rightNumbers,\n north,\n south,\n east,\n west,\n center\n };\n}\n"]}
|
package/dist/cli.js
CHANGED
|
@@ -8932,7 +8932,7 @@ var import_config3 = require("dotenv/config");
|
|
|
8932
8932
|
// package.json
|
|
8933
8933
|
var package_default = {
|
|
8934
8934
|
name: "kaabalah",
|
|
8935
|
-
version: "6.4.
|
|
8935
|
+
version: "6.4.4",
|
|
8936
8936
|
description: "The de-facto library for any esoteric calculations and tooling",
|
|
8937
8937
|
engines: {
|
|
8938
8938
|
node: ">=18.18.0"
|
|
@@ -19931,34 +19931,58 @@ kaabalah v${VERSION}
|
|
|
19931
19931
|
}
|
|
19932
19932
|
|
|
19933
19933
|
// src/ifa/index.ts
|
|
19934
|
+
function isMidnight(date, mode) {
|
|
19935
|
+
if (mode === "utc") {
|
|
19936
|
+
return date.getUTCHours() === 0 && date.getUTCMinutes() === 0 && date.getUTCSeconds() === 0 && date.getUTCMilliseconds() === 0;
|
|
19937
|
+
}
|
|
19938
|
+
return date.getHours() === 0 && date.getMinutes() === 0 && date.getSeconds() === 0 && date.getMilliseconds() === 0;
|
|
19939
|
+
}
|
|
19940
|
+
function extractDateParts(date) {
|
|
19941
|
+
if (!(date instanceof Date) || Number.isNaN(date.getTime())) {
|
|
19942
|
+
throw new Error("Date must be a valid Date object");
|
|
19943
|
+
}
|
|
19944
|
+
const useLocalDate = isMidnight(date, "local") && !isMidnight(date, "utc");
|
|
19945
|
+
if (useLocalDate) {
|
|
19946
|
+
return {
|
|
19947
|
+
day: date.getDate().toString().padStart(2, "0"),
|
|
19948
|
+
month: (date.getMonth() + 1).toString().padStart(2, "0"),
|
|
19949
|
+
year: date.getFullYear().toString().padStart(4, "0")
|
|
19950
|
+
};
|
|
19951
|
+
}
|
|
19952
|
+
const formattedDate = date.toISOString().split("T")[0];
|
|
19953
|
+
const [year, month, day] = formattedDate.split("-");
|
|
19954
|
+
return { day, month, year };
|
|
19955
|
+
}
|
|
19956
|
+
function reduceNumber(num) {
|
|
19957
|
+
if (num <= 16) {
|
|
19958
|
+
return num;
|
|
19959
|
+
}
|
|
19960
|
+
return reduceNumber(
|
|
19961
|
+
num.toString().split("").reduce((sum, digit) => sum + Number.parseInt(digit, 10), 0)
|
|
19962
|
+
);
|
|
19963
|
+
}
|
|
19934
19964
|
function calculateOdu(date) {
|
|
19935
|
-
const day = date
|
|
19936
|
-
const month = (date.getMonth() + 1).toString().padStart(2, "0");
|
|
19937
|
-
const year = date.getFullYear().toString();
|
|
19965
|
+
const { day, month, year } = extractDateParts(date);
|
|
19938
19966
|
const leftNumbers = [
|
|
19939
|
-
parseInt(day[0]),
|
|
19967
|
+
Number.parseInt(day[0], 10),
|
|
19940
19968
|
// First digit of day
|
|
19941
|
-
parseInt(month[0]),
|
|
19969
|
+
Number.parseInt(month[0], 10),
|
|
19942
19970
|
// First digit of month
|
|
19943
|
-
parseInt(year[0]),
|
|
19971
|
+
Number.parseInt(year[0], 10),
|
|
19944
19972
|
// First digit of year
|
|
19945
|
-
parseInt(year[2])
|
|
19973
|
+
Number.parseInt(year[2], 10)
|
|
19946
19974
|
// Third digit of year
|
|
19947
19975
|
];
|
|
19948
19976
|
const rightNumbers = [
|
|
19949
|
-
parseInt(day[1]),
|
|
19977
|
+
Number.parseInt(day[1], 10),
|
|
19950
19978
|
// Second digit of day
|
|
19951
|
-
parseInt(month[1]),
|
|
19979
|
+
Number.parseInt(month[1], 10),
|
|
19952
19980
|
// Second digit of month
|
|
19953
|
-
parseInt(year[1]),
|
|
19981
|
+
Number.parseInt(year[1], 10),
|
|
19954
19982
|
// Second digit of year
|
|
19955
|
-
parseInt(year[3])
|
|
19983
|
+
Number.parseInt(year[3], 10)
|
|
19956
19984
|
// Fourth digit of year
|
|
19957
19985
|
];
|
|
19958
|
-
function reduceNumber(num) {
|
|
19959
|
-
if (num <= 16) return num;
|
|
19960
|
-
return reduceNumber(num.toString().split("").reduce((a, b) => a + parseInt(b), 0));
|
|
19961
|
-
}
|
|
19962
19986
|
const rawLeftSum = leftNumbers.reduce((a, b) => a + b, 0);
|
|
19963
19987
|
const rawRightSum = rightNumbers.reduce((a, b) => a + b, 0);
|
|
19964
19988
|
const north = reduceNumber(rawLeftSum);
|