@gracefullight/saju 1.2.0 → 1.3.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.
- package/README.ko.md +8 -4
- package/README.md +8 -4
- package/dist/__tests__/date-fns-adapter.test.js +11 -0
- package/dist/__tests__/relations.test.js +1 -0
- package/dist/__tests__/saju.test.js +22 -0
- package/dist/__tests__/yongshen.test.js +9 -5
- package/dist/adapters/date-fns.d.ts +2 -2
- package/dist/adapters/date-fns.d.ts.map +1 -1
- package/dist/adapters/date-fns.js +39 -38
- package/dist/core/four-pillars.d.ts.map +1 -1
- package/dist/core/four-pillars.js +47 -4
- package/dist/core/luck.d.ts +6 -0
- package/dist/core/luck.d.ts.map +1 -1
- package/dist/core/luck.js +24 -2
- package/dist/core/nayin.d.ts +16 -0
- package/dist/core/nayin.d.ts.map +1 -0
- package/dist/core/nayin.js +83 -0
- package/dist/core/relations.d.ts +21 -3
- package/dist/core/relations.d.ts.map +1 -1
- package/dist/core/relations.js +74 -10
- package/dist/core/sinsals.d.ts +1 -1
- package/dist/core/sinsals.d.ts.map +1 -1
- package/dist/core/sinsals.js +100 -0
- package/dist/core/solar-terms.d.ts.map +1 -1
- package/dist/core/solar-terms.js +28 -1
- package/dist/core/strength.d.ts.map +1 -1
- package/dist/core/strength.js +24 -1
- package/dist/core/yongshen.d.ts.map +1 -1
- package/dist/core/yongshen.js +57 -22
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/utils/constants.js +1 -1
- package/package.json +1 -1
package/dist/core/relations.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { getBranchElement, getElementLabel, getStemElement } from "../core/ten-gods";
|
|
2
2
|
export const RELATION_TYPE_KEYS = [
|
|
3
3
|
"stemCombination",
|
|
4
|
+
"stemClash",
|
|
4
5
|
"sixCombination",
|
|
6
|
+
"halfCombination",
|
|
5
7
|
"tripleCombination",
|
|
6
8
|
"directionalCombination",
|
|
7
9
|
"clash",
|
|
@@ -11,7 +13,9 @@ export const RELATION_TYPE_KEYS = [
|
|
|
11
13
|
];
|
|
12
14
|
const RELATION_TYPE_DATA = {
|
|
13
15
|
stemCombination: { korean: "천간합", hanja: "天干合" },
|
|
16
|
+
stemClash: { korean: "천간충", hanja: "天干沖" },
|
|
14
17
|
sixCombination: { korean: "육합", hanja: "六合" },
|
|
18
|
+
halfCombination: { korean: "반합", hanja: "半合" },
|
|
15
19
|
tripleCombination: { korean: "삼합", hanja: "三合" },
|
|
16
20
|
directionalCombination: { korean: "방합", hanja: "方合" },
|
|
17
21
|
clash: { korean: "충", hanja: "沖" },
|
|
@@ -57,6 +61,12 @@ export const STEM_COMBINATIONS = [
|
|
|
57
61
|
{ stems: ["丁", "壬"], resultElement: "wood" },
|
|
58
62
|
{ stems: ["戊", "癸"], resultElement: "fire" },
|
|
59
63
|
];
|
|
64
|
+
export const STEM_CLASHES = [
|
|
65
|
+
["甲", "庚"],
|
|
66
|
+
["乙", "辛"],
|
|
67
|
+
["丙", "壬"],
|
|
68
|
+
["丁", "癸"],
|
|
69
|
+
];
|
|
60
70
|
export const BRANCH_SIX_COMBINATIONS = [
|
|
61
71
|
{ branches: ["子", "丑"], resultElement: "earth" },
|
|
62
72
|
{ branches: ["寅", "亥"], resultElement: "wood" },
|
|
@@ -65,6 +75,16 @@ export const BRANCH_SIX_COMBINATIONS = [
|
|
|
65
75
|
{ branches: ["巳", "申"], resultElement: "water" },
|
|
66
76
|
{ branches: ["午", "未"], resultElement: "earth" },
|
|
67
77
|
];
|
|
78
|
+
export const BRANCH_HALF_COMBINATIONS = [
|
|
79
|
+
{ branches: ["寅", "午"], resultElement: "fire" },
|
|
80
|
+
{ branches: ["午", "戌"], resultElement: "fire" },
|
|
81
|
+
{ branches: ["巳", "酉"], resultElement: "metal" },
|
|
82
|
+
{ branches: ["酉", "丑"], resultElement: "metal" },
|
|
83
|
+
{ branches: ["申", "子"], resultElement: "water" },
|
|
84
|
+
{ branches: ["子", "辰"], resultElement: "water" },
|
|
85
|
+
{ branches: ["亥", "卯"], resultElement: "wood" },
|
|
86
|
+
{ branches: ["卯", "未"], resultElement: "wood" },
|
|
87
|
+
];
|
|
68
88
|
export const BRANCH_TRIPLE_COMBINATIONS = [
|
|
69
89
|
{ branches: ["寅", "午", "戌"], resultElement: "fire" },
|
|
70
90
|
{ branches: ["申", "子", "辰"], resultElement: "water" },
|
|
@@ -194,6 +214,7 @@ export function analyzeRelations(yearPillar, monthPillar, dayPillar, hourPillar)
|
|
|
194
214
|
const allStemChars = stems.map((s) => s.char);
|
|
195
215
|
const allBranchChars = branches.map((b) => b.char);
|
|
196
216
|
const combinations = [];
|
|
217
|
+
const stemClashes = [];
|
|
197
218
|
const clashes = [];
|
|
198
219
|
const harms = [];
|
|
199
220
|
const punishments = [];
|
|
@@ -216,6 +237,16 @@ export function analyzeRelations(yearPillar, monthPillar, dayPillar, hourPillar)
|
|
|
216
237
|
});
|
|
217
238
|
}
|
|
218
239
|
}
|
|
240
|
+
for (const clash of STEM_CLASHES) {
|
|
241
|
+
if ((s1.char === clash[0] && s2.char === clash[1]) ||
|
|
242
|
+
(s1.char === clash[1] && s2.char === clash[0])) {
|
|
243
|
+
stemClashes.push({
|
|
244
|
+
type: getRelationTypeLabel("stemClash"),
|
|
245
|
+
pair: [s1.char, s2.char],
|
|
246
|
+
positions: [s1.position, s2.position],
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
}
|
|
219
250
|
}
|
|
220
251
|
}
|
|
221
252
|
for (let i = 0; i < branches.length; i++) {
|
|
@@ -236,6 +267,17 @@ export function analyzeRelations(yearPillar, monthPillar, dayPillar, hourPillar)
|
|
|
236
267
|
});
|
|
237
268
|
}
|
|
238
269
|
}
|
|
270
|
+
for (const halfCombo of BRANCH_HALF_COMBINATIONS) {
|
|
271
|
+
if ((b1.char === halfCombo.branches[0] && b2.char === halfCombo.branches[1]) ||
|
|
272
|
+
(b1.char === halfCombo.branches[1] && b2.char === halfCombo.branches[0])) {
|
|
273
|
+
combinations.push({
|
|
274
|
+
type: getRelationTypeLabel("halfCombination"),
|
|
275
|
+
pair: [b1.char, b2.char],
|
|
276
|
+
positions: [b1.position, b2.position],
|
|
277
|
+
resultElement: getElementLabel(halfCombo.resultElement),
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
}
|
|
239
281
|
for (const clash of BRANCH_CLASHES) {
|
|
240
282
|
if ((b1.char === clash[0] && b2.char === clash[1]) ||
|
|
241
283
|
(b1.char === clash[1] && b2.char === clash[0])) {
|
|
@@ -268,17 +310,23 @@ export function analyzeRelations(yearPillar, monthPillar, dayPillar, hourPillar)
|
|
|
268
310
|
}
|
|
269
311
|
}
|
|
270
312
|
}
|
|
271
|
-
const branchChars = branches.map((b) => b.char);
|
|
272
313
|
for (const combo of BRANCH_TRIPLE_COMBINATIONS) {
|
|
273
|
-
const matched =
|
|
314
|
+
const matched = [];
|
|
315
|
+
const usedIndices = new Set();
|
|
316
|
+
for (const target of combo.branches) {
|
|
317
|
+
const idx = branches.findIndex((b, i) => b.char === target && !usedIndices.has(i));
|
|
318
|
+
if (idx !== -1) {
|
|
319
|
+
usedIndices.add(idx);
|
|
320
|
+
matched.push({ char: target, position: branches[idx].position });
|
|
321
|
+
}
|
|
322
|
+
}
|
|
274
323
|
if (matched.length >= 2) {
|
|
275
|
-
|
|
276
|
-
const positions = matched.map((m) => branches.find((b) => b.char === m).position);
|
|
324
|
+
const positions = matched.map((m) => m.position);
|
|
277
325
|
const isComplete = matched.length === 3;
|
|
278
326
|
const transform = checkTransformationCondition(combo.resultElement, monthBranch, allBranchChars, isComplete);
|
|
279
327
|
combinations.push({
|
|
280
328
|
type: getRelationTypeLabel("tripleCombination"),
|
|
281
|
-
branches: matched,
|
|
329
|
+
branches: matched.map((m) => m.char),
|
|
282
330
|
positions,
|
|
283
331
|
resultElement: getElementLabel(combo.resultElement),
|
|
284
332
|
isComplete,
|
|
@@ -288,15 +336,22 @@ export function analyzeRelations(yearPillar, monthPillar, dayPillar, hourPillar)
|
|
|
288
336
|
}
|
|
289
337
|
}
|
|
290
338
|
for (const combo of BRANCH_DIRECTIONAL_COMBINATIONS) {
|
|
291
|
-
const matched =
|
|
339
|
+
const matched = [];
|
|
340
|
+
const usedIndices = new Set();
|
|
341
|
+
for (const target of combo.branches) {
|
|
342
|
+
const idx = branches.findIndex((b, i) => b.char === target && !usedIndices.has(i));
|
|
343
|
+
if (idx !== -1) {
|
|
344
|
+
usedIndices.add(idx);
|
|
345
|
+
matched.push({ char: target, position: branches[idx].position });
|
|
346
|
+
}
|
|
347
|
+
}
|
|
292
348
|
if (matched.length >= 2) {
|
|
293
|
-
|
|
294
|
-
const positions = matched.map((m) => branches.find((b) => b.char === m).position);
|
|
349
|
+
const positions = matched.map((m) => m.position);
|
|
295
350
|
const isComplete = matched.length === 3;
|
|
296
351
|
const transform = checkTransformationCondition(combo.resultElement, monthBranch, allBranchChars, isComplete);
|
|
297
352
|
combinations.push({
|
|
298
353
|
type: getRelationTypeLabel("directionalCombination"),
|
|
299
|
-
branches: matched,
|
|
354
|
+
branches: matched.map((m) => m.char),
|
|
300
355
|
positions,
|
|
301
356
|
resultElement: getElementLabel(combo.resultElement),
|
|
302
357
|
isComplete,
|
|
@@ -305,6 +360,7 @@ export function analyzeRelations(yearPillar, monthPillar, dayPillar, hourPillar)
|
|
|
305
360
|
});
|
|
306
361
|
}
|
|
307
362
|
}
|
|
363
|
+
const branchChars = branches.map((b) => b.char);
|
|
308
364
|
for (const punishment of BRANCH_PUNISHMENTS) {
|
|
309
365
|
const matched = punishment.branches.filter((b) => branchChars.includes(b));
|
|
310
366
|
const isTriple = punishment.branches.length === 3;
|
|
@@ -343,9 +399,17 @@ export function analyzeRelations(yearPillar, monthPillar, dayPillar, hourPillar)
|
|
|
343
399
|
});
|
|
344
400
|
}
|
|
345
401
|
}
|
|
346
|
-
const all = [
|
|
402
|
+
const all = [
|
|
403
|
+
...combinations,
|
|
404
|
+
...stemClashes,
|
|
405
|
+
...clashes,
|
|
406
|
+
...harms,
|
|
407
|
+
...punishments,
|
|
408
|
+
...destructions,
|
|
409
|
+
];
|
|
347
410
|
return {
|
|
348
411
|
combinations,
|
|
412
|
+
stemClashes,
|
|
349
413
|
clashes,
|
|
350
414
|
harms,
|
|
351
415
|
punishments,
|
package/dist/core/sinsals.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Label, PillarPosition } from "../types";
|
|
2
|
-
export declare const SINSALS: readonly ["peachBlossom", "skyHorse", "floweryCanopy", "ghostGate", "solitaryStar", "widowStar", "heavenlyVirtue", "monthlyVirtue", "skyNoble", "moonNoble", "literaryNoble", "academicHall", "bloodKnife", "sixHarms", "whiteCloth", "heavenlyDoctor", "suspendedNeedle", "kuiGang", "sheepBlade", "redFlame", "taijiNoble", "goldenCarriage", "officialStar", "hiddenWealth", "officialAcademicHall", "whiteTiger", "heavenlyGate", "heavenlyKitchen", "literaryCurve", "imperialPardon", "lostSpirit", "robbery", "disaster", "generalStar", "saddleMount", "redPhoenix", "heavenlyJoy", "gongmang", "wonjin"];
|
|
2
|
+
export declare const SINSALS: readonly ["peachBlossom", "skyHorse", "floweryCanopy", "ghostGate", "solitaryStar", "widowStar", "heavenlyVirtue", "monthlyVirtue", "skyNoble", "moonNoble", "literaryNoble", "academicHall", "bloodKnife", "sixHarms", "whiteCloth", "heavenlyDoctor", "suspendedNeedle", "kuiGang", "sheepBlade", "redFlame", "taijiNoble", "goldenCarriage", "officialStar", "hiddenWealth", "officialAcademicHall", "whiteTiger", "heavenlyGate", "heavenlyKitchen", "literaryCurve", "imperialPardon", "lostSpirit", "robbery", "disaster", "heavenlyKiller", "earthlyKiller", "yearKiller", "monthKiller", "generalStar", "saddleMount", "redPhoenix", "heavenlyJoy", "gongmang", "wonjin"];
|
|
3
3
|
export type SinsalKey = (typeof SINSALS)[number];
|
|
4
4
|
export type SinsalType = "auspicious" | "inauspicious" | "neutral";
|
|
5
5
|
export interface SinsalLabel extends Label<SinsalKey> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sinsals.d.ts","sourceRoot":"","sources":["../../src/core/sinsals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAErD,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"sinsals.d.ts","sourceRoot":"","sources":["../../src/core/sinsals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAErD,eAAO,MAAM,OAAO,mpBA4CV,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,cAAc,GAAG,SAAS,CAAC;AAEnE,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,SAAS,CAAC;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,CAAC;CAClB;AA+hBD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC;CACvD;AA6CD,wBAAgB,cAAc,CAC5B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,YAAY,CAuWd;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAC9B,SAAS,EACT;IACE,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,CAAC;CAClB,CAqPF,CAAC;AAEF,wBAAgB,cAAc,CAAC,GAAG,EAAE,SAAS,GAAG,WAAW,CAS1D"}
|
package/dist/core/sinsals.js
CHANGED
|
@@ -32,6 +32,10 @@ export const SINSALS = [
|
|
|
32
32
|
"lostSpirit",
|
|
33
33
|
"robbery",
|
|
34
34
|
"disaster",
|
|
35
|
+
"heavenlyKiller",
|
|
36
|
+
"earthlyKiller",
|
|
37
|
+
"yearKiller",
|
|
38
|
+
"monthKiller",
|
|
35
39
|
"generalStar",
|
|
36
40
|
"saddleMount",
|
|
37
41
|
"redPhoenix",
|
|
@@ -420,6 +424,66 @@ const DISASTER_MAP = {
|
|
|
420
424
|
卯: "酉",
|
|
421
425
|
未: "酉",
|
|
422
426
|
};
|
|
427
|
+
// 천살 (년지/일지 기준 삼합 → 지지에서 체크)
|
|
428
|
+
const HEAVENLY_KILLER_MAP = {
|
|
429
|
+
寅: "丑",
|
|
430
|
+
午: "丑",
|
|
431
|
+
戌: "丑",
|
|
432
|
+
巳: "辰",
|
|
433
|
+
酉: "辰",
|
|
434
|
+
丑: "辰",
|
|
435
|
+
申: "未",
|
|
436
|
+
子: "未",
|
|
437
|
+
辰: "未",
|
|
438
|
+
亥: "戌",
|
|
439
|
+
卯: "戌",
|
|
440
|
+
未: "戌",
|
|
441
|
+
};
|
|
442
|
+
// 지살 (년지/일지 기준 삼합 → 지지에서 체크)
|
|
443
|
+
const EARTHLY_KILLER_MAP = {
|
|
444
|
+
寅: "寅",
|
|
445
|
+
午: "寅",
|
|
446
|
+
戌: "寅",
|
|
447
|
+
巳: "巳",
|
|
448
|
+
酉: "巳",
|
|
449
|
+
丑: "巳",
|
|
450
|
+
申: "申",
|
|
451
|
+
子: "申",
|
|
452
|
+
辰: "申",
|
|
453
|
+
亥: "亥",
|
|
454
|
+
卯: "亥",
|
|
455
|
+
未: "亥",
|
|
456
|
+
};
|
|
457
|
+
// 연살 (년지/일지 기준 삼합 → 지지에서 체크)
|
|
458
|
+
const YEAR_KILLER_MAP = {
|
|
459
|
+
寅: "卯",
|
|
460
|
+
午: "卯",
|
|
461
|
+
戌: "卯",
|
|
462
|
+
巳: "午",
|
|
463
|
+
酉: "午",
|
|
464
|
+
丑: "午",
|
|
465
|
+
申: "酉",
|
|
466
|
+
子: "酉",
|
|
467
|
+
辰: "酉",
|
|
468
|
+
亥: "子",
|
|
469
|
+
卯: "子",
|
|
470
|
+
未: "子",
|
|
471
|
+
};
|
|
472
|
+
// 월살 (년지/일지 기준 삼합 → 지지에서 체크)
|
|
473
|
+
const MONTH_KILLER_MAP = {
|
|
474
|
+
寅: "辰",
|
|
475
|
+
午: "辰",
|
|
476
|
+
戌: "辰",
|
|
477
|
+
巳: "未",
|
|
478
|
+
酉: "未",
|
|
479
|
+
丑: "未",
|
|
480
|
+
申: "戌",
|
|
481
|
+
子: "戌",
|
|
482
|
+
辰: "戌",
|
|
483
|
+
亥: "丑",
|
|
484
|
+
卯: "丑",
|
|
485
|
+
未: "丑",
|
|
486
|
+
};
|
|
423
487
|
// 장성 (년지/일지 기준 삼합의 왕지)
|
|
424
488
|
const GENERAL_STAR_MAP = {
|
|
425
489
|
寅: "午",
|
|
@@ -582,6 +646,18 @@ export function analyzeSinsals(yearPillar, monthPillar, dayPillar, hourPillar) {
|
|
|
582
646
|
// 재살 (년지/일지 기준)
|
|
583
647
|
matches.push(...checkBranchBasedSinsal(yearBranch, allBranches, positions, DISASTER_MAP, "disaster"));
|
|
584
648
|
matches.push(...checkBranchBasedSinsal(dayBranch, allBranches, positions, DISASTER_MAP, "disaster"));
|
|
649
|
+
// 천살 (년지/일지 기준)
|
|
650
|
+
matches.push(...checkBranchBasedSinsal(yearBranch, allBranches, positions, HEAVENLY_KILLER_MAP, "heavenlyKiller"));
|
|
651
|
+
matches.push(...checkBranchBasedSinsal(dayBranch, allBranches, positions, HEAVENLY_KILLER_MAP, "heavenlyKiller"));
|
|
652
|
+
// 지살 (년지/일지 기준)
|
|
653
|
+
matches.push(...checkBranchBasedSinsal(yearBranch, allBranches, positions, EARTHLY_KILLER_MAP, "earthlyKiller"));
|
|
654
|
+
matches.push(...checkBranchBasedSinsal(dayBranch, allBranches, positions, EARTHLY_KILLER_MAP, "earthlyKiller"));
|
|
655
|
+
// 연살 (년지/일지 기준)
|
|
656
|
+
matches.push(...checkBranchBasedSinsal(yearBranch, allBranches, positions, YEAR_KILLER_MAP, "yearKiller"));
|
|
657
|
+
matches.push(...checkBranchBasedSinsal(dayBranch, allBranches, positions, YEAR_KILLER_MAP, "yearKiller"));
|
|
658
|
+
// 월살 (년지/일지 기준)
|
|
659
|
+
matches.push(...checkBranchBasedSinsal(yearBranch, allBranches, positions, MONTH_KILLER_MAP, "monthKiller"));
|
|
660
|
+
matches.push(...checkBranchBasedSinsal(dayBranch, allBranches, positions, MONTH_KILLER_MAP, "monthKiller"));
|
|
585
661
|
// 장성살 (년지/일지 기준)
|
|
586
662
|
matches.push(...checkBranchBasedSinsal(yearBranch, allBranches, positions, GENERAL_STAR_MAP, "generalStar"));
|
|
587
663
|
matches.push(...checkBranchBasedSinsal(dayBranch, allBranches, positions, GENERAL_STAR_MAP, "generalStar"));
|
|
@@ -804,6 +880,30 @@ export const SINSAL_INFO = {
|
|
|
804
880
|
meaning: "재난, 감금, 소송",
|
|
805
881
|
type: "inauspicious",
|
|
806
882
|
},
|
|
883
|
+
heavenlyKiller: {
|
|
884
|
+
korean: "천살",
|
|
885
|
+
hanja: "天煞",
|
|
886
|
+
meaning: "천재지변, 불의의 사고",
|
|
887
|
+
type: "inauspicious",
|
|
888
|
+
},
|
|
889
|
+
earthlyKiller: {
|
|
890
|
+
korean: "지살",
|
|
891
|
+
hanja: "地煞",
|
|
892
|
+
meaning: "이동 중 사고, 지진, 함몰",
|
|
893
|
+
type: "inauspicious",
|
|
894
|
+
},
|
|
895
|
+
yearKiller: {
|
|
896
|
+
korean: "연살",
|
|
897
|
+
hanja: "年煞",
|
|
898
|
+
meaning: "질병, 관재, 구설",
|
|
899
|
+
type: "inauspicious",
|
|
900
|
+
},
|
|
901
|
+
monthKiller: {
|
|
902
|
+
korean: "월살",
|
|
903
|
+
hanja: "月煞",
|
|
904
|
+
meaning: "가정불화, 부부갈등",
|
|
905
|
+
type: "inauspicious",
|
|
906
|
+
},
|
|
807
907
|
generalStar: {
|
|
808
908
|
korean: "장성살",
|
|
809
909
|
hanja: "將星煞",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solar-terms.d.ts","sourceRoot":"","sources":["../../src/core/solar-terms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,eAAO,MAAM,eAAe,iXAyBlB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,YAAY,CAAC;IACzD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,QAAA,MAAM,eAAe,EAAE,MAAM,CAAC,YAAY,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CA0B7F,CAAC;AAEJ,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,YAAY,GAAG,cAAc,CAGnE;AAED,eAAO,MAAM,WAAW,kBAAuD,CAAC;AAEhF,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC;AAC7E,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC;AAE7E,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,YAAY,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE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qC;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,iGAAiG;IACjG,OAAO,EAAE,SAAS,CAAC;IACnB,2BAA2B;IAC3B,WAAW,EAAE,iBAAiB,CAAC;IAC/B,6CAA6C;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB,6FAA6F;IAC7F,OAAO,EAAE,SAAS,CAAC;IACnB,uBAAuB;IACvB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,yCAAyC;IACzC,aAAa,EAAE,MAAM,CAAC;CACvB;AAqOD,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,OAAO,EAAE,CAAC,EACV,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;CAAE,GACvC,aAAa,CA0Ef;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,IAAI,EAAE,MAAM,EACZ,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE;IAAE,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACnE,KAAK,CAAC;IACP,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,iBAAiB,CAAC;CACzB,CAAC,CAuBD"}
|
package/dist/core/solar-terms.js
CHANGED
|
@@ -55,6 +55,30 @@ export function getSolarTermLabel(key) {
|
|
|
55
55
|
return { key, ...data };
|
|
56
56
|
}
|
|
57
57
|
export const SOLAR_TERMS = SOLAR_TERM_KEYS.map((key) => getSolarTermLabel(key));
|
|
58
|
+
/**
|
|
59
|
+
* Approximate ΔT (TT - UT) in seconds.
|
|
60
|
+
* Based on polynomial expressions from Meeus / USNO.
|
|
61
|
+
*/
|
|
62
|
+
function deltaT(year) {
|
|
63
|
+
if (year >= 2005 && year < 2050) {
|
|
64
|
+
const t = year - 2000;
|
|
65
|
+
return 62.92 + 0.32217 * t + 0.005589 * t * t;
|
|
66
|
+
}
|
|
67
|
+
if (year >= 1986 && year < 2005) {
|
|
68
|
+
const t = year - 2000;
|
|
69
|
+
return (63.86 +
|
|
70
|
+
0.3345 * t -
|
|
71
|
+
0.060374 * t * t +
|
|
72
|
+
0.0017275 * t * t * t +
|
|
73
|
+
0.000651814 * t * t * t * t +
|
|
74
|
+
0.00002373599 * t * t * t * t * t);
|
|
75
|
+
}
|
|
76
|
+
if (year >= 1900 && year < 1986) {
|
|
77
|
+
const t = year - 1900;
|
|
78
|
+
return -0.02 + 0.000297 * t * t;
|
|
79
|
+
}
|
|
80
|
+
return 0;
|
|
81
|
+
}
|
|
58
82
|
function normDeg(x) {
|
|
59
83
|
x %= 360;
|
|
60
84
|
return x < 0 ? x + 360 : x;
|
|
@@ -71,7 +95,10 @@ function sunApparentLongitude(adapter, dtUtc) {
|
|
|
71
95
|
const A = Math.floor(y / 100);
|
|
72
96
|
const B = 2 - A + Math.floor(A / 4);
|
|
73
97
|
const JD = Math.floor(365.25 * (y + 4716)) + Math.floor(30.6001 * (m + 1)) + d + B - 1524.5;
|
|
74
|
-
|
|
98
|
+
// Apply ΔT correction for TT
|
|
99
|
+
const dtSeconds = deltaT(y);
|
|
100
|
+
const JD_TT = JD + dtSeconds / 86400.0;
|
|
101
|
+
const T = (JD_TT - 2451545.0) / 36525.0;
|
|
75
102
|
const L0 = normDeg(280.46646 + 36000.76983 * T + 0.0003032 * T * T);
|
|
76
103
|
const M = normDeg(357.52911 + 35999.05029 * T - 0.0001537 * T * T);
|
|
77
104
|
const deg2rad = (deg) => (deg * Math.PI) / 180;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strength.d.ts","sourceRoot":"","sources":["../../src/core/strength.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"strength.d.ts","sourceRoot":"","sources":["../../src/core/strength.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,eAAO,MAAM,mBAAmB,sIAUtB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,MAAM,WAAW,kBAAmB,SAAQ,KAAK,CAAC,gBAAgB,CAAC;CAAG;AActE,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,gBAAgB,GAAG,kBAAkB,CAG/E;AAgLD,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,kBAAkB,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,eAAe,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAGD,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,cAAc,CA6HhB"}
|
package/dist/core/strength.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { findBranchClash, findStemCombination } from "../core/relations";
|
|
1
2
|
import { getStemElement, getStemPolarity, getTenGodKey, } from "../core/ten-gods";
|
|
2
3
|
export const STRENGTH_LEVEL_KEYS = [
|
|
3
4
|
"extremelyWeak",
|
|
@@ -188,7 +189,29 @@ export function analyzeStrength(yearPillar, monthPillar, dayPillar, hourPillar)
|
|
|
188
189
|
for (const branch of allBranches) {
|
|
189
190
|
tonggeun += calculateRootStrength(dayMaster, branch);
|
|
190
191
|
}
|
|
192
|
+
// Clash reduction: if day branch is clashed, reduce root strength
|
|
193
|
+
let clashReduction = 0;
|
|
194
|
+
for (const branch of allBranches) {
|
|
195
|
+
if (branch !== dayPillar[1] && findBranchClash(dayPillar[1], branch)) {
|
|
196
|
+
clashReduction += 0.3;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
tonggeun = Math.max(0, tonggeun - clashReduction);
|
|
191
200
|
const allStems = [yearPillar[0], monthPillar[0], dayPillar[0], hourPillar[0]];
|
|
201
|
+
// Stem combination: check if daymaster is in a stem combination
|
|
202
|
+
let stemComboBonus = 0;
|
|
203
|
+
const otherStems = [yearPillar[0], monthPillar[0], hourPillar[0]];
|
|
204
|
+
for (const stem of otherStems) {
|
|
205
|
+
const combo = findStemCombination(dayMaster, stem);
|
|
206
|
+
if (combo) {
|
|
207
|
+
if (combo.resultElement === dayMasterElement) {
|
|
208
|
+
stemComboBonus += 0.2; // Combination strengthens day master element
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
stemComboBonus -= 0.1; // Combination transforms away from day master
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
192
215
|
const monthHiddenStems = HIDDEN_STEM_WEIGHTS[monthBranch] || [];
|
|
193
216
|
let transparentBonus = 0;
|
|
194
217
|
for (const hs of monthHiddenStems) {
|
|
@@ -205,7 +228,6 @@ export function analyzeStrength(yearPillar, monthPillar, dayPillar, hourPillar)
|
|
|
205
228
|
deukji += calculateRootStrength(dayMaster, branch);
|
|
206
229
|
}
|
|
207
230
|
let deukse = 0;
|
|
208
|
-
const otherStems = [yearPillar[0], monthPillar[0], hourPillar[0]];
|
|
209
231
|
for (const stem of otherStems) {
|
|
210
232
|
const tenGod = getTenGodKey(dayMaster, stem);
|
|
211
233
|
if (isHelpfulTenGod(tenGod)) {
|
|
@@ -239,6 +261,7 @@ export function analyzeStrength(yearPillar, monthPillar, dayPillar, hourPillar)
|
|
|
239
261
|
score += deukse * 8;
|
|
240
262
|
score += helpCount * 5;
|
|
241
263
|
score -= weakenCount * 6;
|
|
264
|
+
score += stemComboBonus * 10;
|
|
242
265
|
score = Math.round(score * 10) / 10;
|
|
243
266
|
let levelKey;
|
|
244
267
|
if (score <= 10)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yongshen.d.ts","sourceRoot":"","sources":["../../src/core/yongshen.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,YAAY,EAIlB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE3F,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,iBAAiB,CAAC;CAAG;AAUxE,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,iBAAiB,GAAG,mBAAmB,CAGlF;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,YAAY,CAAC;IACtB,SAAS,EAAE,YAAY,GAAG,IAAI,CAAC;IAC/B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC,OAAO,EAAE;QAAE,UAAU,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACzE,cAAc,EAAE,YAAY,GAAG,IAAI,CAAC;IACpC,8BAA8B;IAC9B,kBAAkB,CAAC,EAAE;QACnB,OAAO,EAAE,YAAY,CAAC;QACtB,SAAS,EAAE,YAAY,GAAG,IAAI,CAAC;KAChC,CAAC;CACH;AAED,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"yongshen.d.ts","sourceRoot":"","sources":["../../src/core/yongshen.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,YAAY,EAIlB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE3F,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,iBAAiB,CAAC;CAAG;AAUxE,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,iBAAiB,GAAG,mBAAmB,CAGlF;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,YAAY,CAAC;IACtB,SAAS,EAAE,YAAY,GAAG,IAAI,CAAC;IAC/B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC,OAAO,EAAE;QAAE,UAAU,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACzE,cAAc,EAAE,YAAY,GAAG,IAAI,CAAC;IACpC,8BAA8B;IAC9B,kBAAkB,CAAC,EAAE;QACnB,OAAO,EAAE,YAAY,CAAC;QACtB,SAAS,EAAE,YAAY,GAAG,IAAI,CAAC;KAChC,CAAC;CACH;AAED,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAwNrC,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,cAAc,CA2FhB;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,cAAc,GAAG;IACnE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CA0BA"}
|
package/dist/core/yongshen.js
CHANGED
|
@@ -102,29 +102,64 @@ function getYokbuYongShen(dayMasterElement, level) {
|
|
|
102
102
|
const secondary = dayMasterElement;
|
|
103
103
|
return { primary, secondary };
|
|
104
104
|
}
|
|
105
|
+
function countElements(elements) {
|
|
106
|
+
const elementCounts = {
|
|
107
|
+
wood: 0,
|
|
108
|
+
fire: 0,
|
|
109
|
+
earth: 0,
|
|
110
|
+
metal: 0,
|
|
111
|
+
water: 0,
|
|
112
|
+
};
|
|
113
|
+
for (const elem of elements) {
|
|
114
|
+
elementCounts[elem]++;
|
|
115
|
+
}
|
|
116
|
+
return elementCounts;
|
|
117
|
+
}
|
|
118
|
+
function getDominantNonDayMasterElement(dayMasterElement, elementCounts) {
|
|
119
|
+
let dominantElement = null;
|
|
120
|
+
let maxCount = 0;
|
|
121
|
+
for (const [elem, count] of Object.entries(elementCounts)) {
|
|
122
|
+
if (count > maxCount && elem !== dayMasterElement) {
|
|
123
|
+
maxCount = count;
|
|
124
|
+
dominantElement = elem;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return { dominantElement, maxCount };
|
|
128
|
+
}
|
|
129
|
+
function getFollowFormationType(dayMasterElement, dominantElement) {
|
|
130
|
+
const followTypeByElement = {
|
|
131
|
+
[CONTROLS[dayMasterElement]]: "종재격",
|
|
132
|
+
[CONTROLLED_BY[dayMasterElement]]: "종살격",
|
|
133
|
+
[GENERATES[dayMasterElement]]: "종아격",
|
|
134
|
+
};
|
|
135
|
+
return followTypeByElement[dominantElement] ?? "종격";
|
|
136
|
+
}
|
|
137
|
+
function getExtremelyWeakSpecialFormation(dayMasterElement, elementCounts) {
|
|
138
|
+
const { dominantElement, maxCount } = getDominantNonDayMasterElement(dayMasterElement, elementCounts);
|
|
139
|
+
if (!dominantElement || maxCount < 3) {
|
|
140
|
+
return { isSpecial: false, type: null, followElement: null };
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
isSpecial: true,
|
|
144
|
+
type: getFollowFormationType(dayMasterElement, dominantElement),
|
|
145
|
+
followElement: dominantElement,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
function getExtremelyStrongSpecialFormation(dayMasterElement, elementCounts) {
|
|
149
|
+
const controllerElement = CONTROLLED_BY[dayMasterElement];
|
|
150
|
+
const hasController = elementCounts[controllerElement] > 0;
|
|
151
|
+
if (hasController) {
|
|
152
|
+
return { isSpecial: false, type: null, followElement: null };
|
|
153
|
+
}
|
|
154
|
+
return { isSpecial: true, type: "종강격", followElement: dayMasterElement };
|
|
155
|
+
}
|
|
105
156
|
function hasSpecialFormation(dayMasterElement, level, allElements) {
|
|
157
|
+
const elementCounts = countElements(allElements);
|
|
106
158
|
if (level.key === "extremelyWeak") {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
metal: 0,
|
|
112
|
-
water: 0,
|
|
113
|
-
};
|
|
114
|
-
for (const elem of allElements) {
|
|
115
|
-
elementCounts[elem]++;
|
|
116
|
-
}
|
|
117
|
-
let dominantElement = null;
|
|
118
|
-
let maxCount = 0;
|
|
119
|
-
for (const [elem, count] of Object.entries(elementCounts)) {
|
|
120
|
-
if (count > maxCount && elem !== dayMasterElement) {
|
|
121
|
-
maxCount = count;
|
|
122
|
-
dominantElement = elem;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
if (dominantElement && maxCount >= 3) {
|
|
126
|
-
return { isSpecial: true, type: "종격", followElement: dominantElement };
|
|
127
|
-
}
|
|
159
|
+
return getExtremelyWeakSpecialFormation(dayMasterElement, elementCounts);
|
|
160
|
+
}
|
|
161
|
+
if (level.key === "extremelyStrong") {
|
|
162
|
+
return getExtremelyStrongSpecialFormation(dayMasterElement, elementCounts);
|
|
128
163
|
}
|
|
129
164
|
return { isSpecial: false, type: null, followElement: null };
|
|
130
165
|
}
|
|
@@ -156,7 +191,7 @@ export function analyzeYongShen(yearPillar, monthPillar, dayPillar, hourPillar)
|
|
|
156
191
|
primaryKey = specialFormation.followElement;
|
|
157
192
|
secondaryKey = GENERATES[specialFormation.followElement];
|
|
158
193
|
methodKey = "formation";
|
|
159
|
-
reasoning =
|
|
194
|
+
reasoning = `${specialFormation.type} 성립. ${getElementLabel(specialFormation.followElement).korean} 세력을 따름`;
|
|
160
195
|
const yokbu = getYokbuYongShen(dayMasterElement, strength.level);
|
|
161
196
|
alternativeBalance = { primary: yokbu.primary, secondary: yokbu.secondary };
|
|
162
197
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ export type { DateAdapter } from "./adapters/date-adapter";
|
|
|
2
2
|
export { applyMeanSolarTime, BRANCHES, dayPillarFromDate, effectiveDayDate, getFourPillars, hourPillar, monthPillar, presetA, presetB, STANDARD_PRESET, STEMS, TRADITIONAL_PRESET, yearPillar, } from "./core/four-pillars";
|
|
3
3
|
export { calculateDailyLuck, calculateMajorLuck, calculateMonthlyLuck, calculateYearlyLuck, type DailyLuckResult, type Gender, getCurrentMajorLuck, getDayPillar, getMonthPillar, getYearPillar, type LuckPillar, type MajorLuckResult, type MonthlyLuckResult, type StartAgeDetail, type YearlyLuckResult, } from "./core/luck";
|
|
4
4
|
export { getLunarDate, getSolarDate, type LunarDate } from "./core/lunar";
|
|
5
|
-
export {
|
|
5
|
+
export { analyzeFourPillarsNayin, type FourPillarsNayin, getNayin, getNayinFromPillar, type NayinResult, } from "./core/nayin";
|
|
6
|
+
export { analyzeRelations, BRANCH_CLASHES, BRANCH_DESTRUCTIONS, BRANCH_DIRECTIONAL_COMBINATIONS, BRANCH_HALF_COMBINATIONS, BRANCH_HARMS, BRANCH_PUNISHMENTS, BRANCH_SIX_COMBINATIONS, BRANCH_TRIPLE_COMBINATIONS, type BranchClash, type BranchDestruction, type BranchDirectionalCombination, type BranchHalfCombination, type BranchHarm, type BranchPunishment, type BranchSixCombination, type BranchTripleCombination, findBranchClash, findBranchSixCombination, findStemCombination, type Relation, type RelationsResult, STEM_CLASHES, STEM_COMBINATIONS, type StemClash, type StemCombination, } from "./core/relations";
|
|
6
7
|
export { analyzeSinsals, getSinsalLabel, SINSAL_INFO, SINSALS, type SinsalKey, type SinsalLabel, type SinsalMatch, type SinsalResult, type SinsalType, } from "./core/sinsals";
|
|
7
8
|
export { analyzeSolarTerms, getSolarTermLabel, getSolarTermsForYear, SOLAR_TERM_KEYS, SOLAR_TERMS, type SolarTerm, type SolarTermDateInfo, type SolarTermHanja, type SolarTermInfo, type SolarTermKey, type SolarTermLabel, type SolarTermName, } from "./core/solar-terms";
|
|
8
9
|
export { analyzeStrength, getStrengthLevelLabel, STRENGTH_LEVEL_KEYS, type StrengthFactors, type StrengthLevelKey, type StrengthLevelLabel, type StrengthResult, } from "./core/strength";
|
|
@@ -14,6 +15,7 @@ import type { DateAdapter } from "./adapters/date-adapter";
|
|
|
14
15
|
import { type presetA } from "./core/four-pillars";
|
|
15
16
|
import { type Gender, type MajorLuckResult, type YearlyLuckResult } from "./core/luck";
|
|
16
17
|
import type { LunarDate } from "./core/lunar";
|
|
18
|
+
import { type FourPillarsNayin } from "./core/nayin";
|
|
17
19
|
import { type RelationsResult } from "./core/relations";
|
|
18
20
|
import { type SinsalResult } from "./core/sinsals";
|
|
19
21
|
import { type SolarTermInfo } from "./core/solar-terms";
|
|
@@ -33,6 +35,7 @@ export interface SajuResult {
|
|
|
33
35
|
strength: StrengthResult;
|
|
34
36
|
relations: RelationsResult;
|
|
35
37
|
yongShen: YongShenResult;
|
|
38
|
+
nayin: FourPillarsNayin;
|
|
36
39
|
solarTerms: SolarTermInfo;
|
|
37
40
|
majorLuck: MajorLuckResult;
|
|
38
41
|
yearlyLuck: YearlyLuckResult[];
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,kBAAkB,EAClB,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,WAAW,EACX,OAAO,EACP,OAAO,EACP,eAAe,EACf,KAAK,EACL,kBAAkB,EAClB,UAAU,GACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,KAAK,eAAe,EACpB,KAAK,MAAM,EACX,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,aAAa,EACb,KAAK,UAAU,EACf,KAAK,eAA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AAC,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,kBAAkB,EAClB,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,WAAW,EACX,OAAO,EACP,OAAO,EACP,eAAe,EACf,KAAK,EACL,kBAAkB,EAClB,UAAU,GACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,KAAK,eAAe,EACpB,KAAK,MAAM,EACX,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,aAAa,EACb,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EACL,uBAAuB,EACvB,KAAK,gBAAgB,EACrB,QAAQ,EACR,kBAAkB,EAClB,KAAK,WAAW,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,+BAA+B,EAC/B,wBAAwB,EACxB,YAAY,EACZ,kBAAkB,EAClB,uBAAuB,EACvB,0BAA0B,EAC1B,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,eAAe,EACf,wBAAwB,EACxB,mBAAmB,EACnB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,YAAY,EACZ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IACxB,UAAU,EAAE,aAAa,CAAC;IAC1B,SAAS,EAAE,eAAe,CAAC;IAC3B,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC/B,YAAY,EAAE,kBAAkB,CAAC;IACjC,OAAO,EAAE,YAAY,CAAC;IACtB,IAAI,EAAE;QACJ,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,gBAAgB,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC;QAC/D,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH;AAED,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CAChD;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,UAAU,CAkD7E"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { applyMeanSolarTime, BRANCHES, dayPillarFromDate, effectiveDayDate, getFourPillars, hourPillar, monthPillar, presetA, presetB, STANDARD_PRESET, STEMS, TRADITIONAL_PRESET, yearPillar, } from "./core/four-pillars";
|
|
2
2
|
export { calculateDailyLuck, calculateMajorLuck, calculateMonthlyLuck, calculateYearlyLuck, getCurrentMajorLuck, getDayPillar, getMonthPillar, getYearPillar, } from "./core/luck";
|
|
3
3
|
export { getLunarDate, getSolarDate } from "./core/lunar";
|
|
4
|
-
export {
|
|
4
|
+
export { analyzeFourPillarsNayin, getNayin, getNayinFromPillar, } from "./core/nayin";
|
|
5
|
+
export { analyzeRelations, BRANCH_CLASHES, BRANCH_DESTRUCTIONS, BRANCH_DIRECTIONAL_COMBINATIONS, BRANCH_HALF_COMBINATIONS, BRANCH_HARMS, BRANCH_PUNISHMENTS, BRANCH_SIX_COMBINATIONS, BRANCH_TRIPLE_COMBINATIONS, findBranchClash, findBranchSixCombination, findStemCombination, STEM_CLASHES, STEM_COMBINATIONS, } from "./core/relations";
|
|
5
6
|
export { analyzeSinsals, getSinsalLabel, SINSAL_INFO, SINSALS, } from "./core/sinsals";
|
|
6
7
|
export { analyzeSolarTerms, getSolarTermLabel, getSolarTermsForYear, SOLAR_TERM_KEYS, SOLAR_TERMS, } from "./core/solar-terms";
|
|
7
8
|
export { analyzeStrength, getStrengthLevelLabel, STRENGTH_LEVEL_KEYS, } from "./core/strength";
|
|
@@ -10,6 +11,7 @@ export { analyzeTwelveStages, getTwelveStageLabel, TWELVE_STAGES, } from "./core
|
|
|
10
11
|
export { analyzeYongShen, getElementRecommendations, getYongShenMethodLabel, } from "./core/yongshen";
|
|
11
12
|
import { getFourPillars } from "./core/four-pillars";
|
|
12
13
|
import { calculateMajorLuck, calculateYearlyLuck, } from "./core/luck";
|
|
14
|
+
import { analyzeFourPillarsNayin } from "./core/nayin";
|
|
13
15
|
import { analyzeRelations } from "./core/relations";
|
|
14
16
|
import { analyzeSinsals } from "./core/sinsals";
|
|
15
17
|
import { analyzeSolarTerms } from "./core/solar-terms";
|
|
@@ -30,6 +32,7 @@ export function getSaju(dtLocal, options) {
|
|
|
30
32
|
const strength = analyzeStrength(year, month, day, hour);
|
|
31
33
|
const relations = analyzeRelations(year, month, day, hour);
|
|
32
34
|
const yongShen = analyzeYongShen(year, month, day, hour);
|
|
35
|
+
const nayin = analyzeFourPillarsNayin(year, month, day, hour);
|
|
33
36
|
const solarTerms = analyzeSolarTerms(dtLocal, { adapter });
|
|
34
37
|
const twelveStages = analyzeTwelveStages(year, month, day, hour);
|
|
35
38
|
const sinsals = analyzeSinsals(year, month, day, hour);
|
|
@@ -40,6 +43,7 @@ export function getSaju(dtLocal, options) {
|
|
|
40
43
|
strength,
|
|
41
44
|
relations,
|
|
42
45
|
yongShen,
|
|
46
|
+
nayin,
|
|
43
47
|
solarTerms,
|
|
44
48
|
majorLuck: calculateMajorLuck(dtLocal, options.gender, year, month, {
|
|
45
49
|
adapter,
|
package/dist/utils/constants.js
CHANGED
|
@@ -49,7 +49,7 @@ export function jdnFromDate(year, month, day) {
|
|
|
49
49
|
32045);
|
|
50
50
|
}
|
|
51
51
|
export function dayPillarIndexFromJdn(jdn) {
|
|
52
|
-
return (((jdn
|
|
52
|
+
return (((jdn - 11) % 60) + 60) % 60;
|
|
53
53
|
}
|
|
54
54
|
export function isYangStem(stem) {
|
|
55
55
|
return ["甲", "丙", "戊", "庚", "壬"].includes(stem);
|