@gracefullight/saju 0.6.0 → 1.0.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/README.en.md +54 -43
- package/README.md +54 -43
- package/dist/__tests__/four-pillars.test.js +55 -37
- package/dist/__tests__/saju.test.js +19 -9
- package/dist/__tests__/sinsals.test.js +367 -0
- package/dist/__tests__/solar-terms.test.js +12 -12
- package/dist/core/four-pillars.d.ts +12 -5
- package/dist/core/four-pillars.d.ts.map +1 -1
- package/dist/core/four-pillars.js +14 -11
- package/dist/core/luck.d.ts +2 -1
- package/dist/core/luck.d.ts.map +1 -1
- package/dist/core/luck.js +2 -2
- package/dist/core/sinsals.d.ts +1 -1
- package/dist/core/sinsals.d.ts.map +1 -1
- package/dist/core/sinsals.js +510 -7
- package/dist/core/solar-terms.d.ts +7 -2
- package/dist/core/solar-terms.d.ts.map +1 -1
- package/dist/core/solar-terms.js +2 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -4
- package/package.json +1 -1
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"];
|
|
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"];
|
|
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,mlBAwCV,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+dD,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,CA+Sd;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,CA6NF,CAAC;AAEF,wBAAgB,cAAc,CAAC,GAAG,EAAE,SAAS,GAAG,WAAW,CAS1D"}
|
package/dist/core/sinsals.js
CHANGED
|
@@ -15,6 +15,29 @@ export const SINSALS = [
|
|
|
15
15
|
"sixHarms",
|
|
16
16
|
"whiteCloth",
|
|
17
17
|
"heavenlyDoctor",
|
|
18
|
+
"suspendedNeedle",
|
|
19
|
+
"kuiGang",
|
|
20
|
+
"sheepBlade",
|
|
21
|
+
"redFlame",
|
|
22
|
+
"taijiNoble",
|
|
23
|
+
"goldenCarriage",
|
|
24
|
+
"officialStar",
|
|
25
|
+
"hiddenWealth",
|
|
26
|
+
"officialAcademicHall",
|
|
27
|
+
"whiteTiger",
|
|
28
|
+
"heavenlyGate",
|
|
29
|
+
"heavenlyKitchen",
|
|
30
|
+
"literaryCurve",
|
|
31
|
+
"imperialPardon",
|
|
32
|
+
"lostSpirit",
|
|
33
|
+
"robbery",
|
|
34
|
+
"disaster",
|
|
35
|
+
"generalStar",
|
|
36
|
+
"saddleMount",
|
|
37
|
+
"redPhoenix",
|
|
38
|
+
"heavenlyJoy",
|
|
39
|
+
"gongmang",
|
|
40
|
+
"wonjin",
|
|
18
41
|
];
|
|
19
42
|
const PEACH_BLOSSOM_MAP = {
|
|
20
43
|
寅: "卯",
|
|
@@ -72,6 +95,20 @@ const GHOST_GATE_MAP = {
|
|
|
72
95
|
戌: "巳",
|
|
73
96
|
亥: "辰",
|
|
74
97
|
};
|
|
98
|
+
const WONJIN_MAP = {
|
|
99
|
+
子: "未",
|
|
100
|
+
丑: "午",
|
|
101
|
+
寅: "酉",
|
|
102
|
+
卯: "申",
|
|
103
|
+
辰: "亥",
|
|
104
|
+
巳: "戌",
|
|
105
|
+
午: "丑",
|
|
106
|
+
未: "子",
|
|
107
|
+
申: "卯",
|
|
108
|
+
酉: "寅",
|
|
109
|
+
戌: "巳",
|
|
110
|
+
亥: "辰",
|
|
111
|
+
};
|
|
75
112
|
const SOLITARY_STAR_MAP = {
|
|
76
113
|
子: "寅",
|
|
77
114
|
丑: "寅",
|
|
@@ -154,15 +191,15 @@ const LITERARY_NOBLE_MAP = {
|
|
|
154
191
|
};
|
|
155
192
|
const ACADEMIC_HALL_MAP = {
|
|
156
193
|
甲: "亥",
|
|
157
|
-
乙: "
|
|
194
|
+
乙: "午",
|
|
158
195
|
丙: "寅",
|
|
159
|
-
丁: "
|
|
196
|
+
丁: "酉",
|
|
160
197
|
戊: "寅",
|
|
161
|
-
己: "
|
|
198
|
+
己: "酉",
|
|
162
199
|
庚: "巳",
|
|
163
|
-
辛: "
|
|
200
|
+
辛: "子",
|
|
164
201
|
壬: "申",
|
|
165
|
-
癸: "
|
|
202
|
+
癸: "卯",
|
|
166
203
|
};
|
|
167
204
|
const BLOOD_KNIFE_MAP = {
|
|
168
205
|
子: "酉",
|
|
@@ -192,6 +229,257 @@ const HEAVENLY_DOCTOR_MAP = {
|
|
|
192
229
|
戌: "酉",
|
|
193
230
|
亥: "戌",
|
|
194
231
|
};
|
|
232
|
+
const SUSPENDED_NEEDLE_STEMS = new Set(["甲", "申", "戊", "辛", "壬"]);
|
|
233
|
+
const KUI_GANG_PILLARS = new Set(["戊戌", "庚辰", "庚戌", "壬辰"]);
|
|
234
|
+
const SHEEP_BLADE_MAP = {
|
|
235
|
+
甲: "卯",
|
|
236
|
+
乙: "辰",
|
|
237
|
+
丙: "午",
|
|
238
|
+
丁: "未",
|
|
239
|
+
戊: "午",
|
|
240
|
+
己: "未",
|
|
241
|
+
庚: "酉",
|
|
242
|
+
辛: "戌",
|
|
243
|
+
壬: "子",
|
|
244
|
+
癸: "丑",
|
|
245
|
+
};
|
|
246
|
+
const RED_FLAME_MAP = {
|
|
247
|
+
甲: "午",
|
|
248
|
+
乙: "午",
|
|
249
|
+
丙: "寅",
|
|
250
|
+
丁: "未",
|
|
251
|
+
戊: "辰",
|
|
252
|
+
己: "辰",
|
|
253
|
+
庚: "戌",
|
|
254
|
+
辛: "酉",
|
|
255
|
+
壬: "子",
|
|
256
|
+
癸: "申",
|
|
257
|
+
};
|
|
258
|
+
const TAIJI_NOBLE_MAP = {
|
|
259
|
+
甲: ["子", "午"],
|
|
260
|
+
乙: ["子", "午"],
|
|
261
|
+
丙: ["卯", "酉"],
|
|
262
|
+
丁: ["卯", "酉"],
|
|
263
|
+
戊: ["辰", "戌", "丑", "未"],
|
|
264
|
+
己: ["辰", "戌", "丑", "未"],
|
|
265
|
+
庚: ["寅", "亥"],
|
|
266
|
+
辛: ["寅", "亥"],
|
|
267
|
+
壬: ["巳", "申"],
|
|
268
|
+
癸: ["巳", "申"],
|
|
269
|
+
};
|
|
270
|
+
const GOLDEN_CARRIAGE_MAP = {
|
|
271
|
+
甲: "辰",
|
|
272
|
+
乙: "巳",
|
|
273
|
+
丙: "未",
|
|
274
|
+
丁: "申",
|
|
275
|
+
戊: "未",
|
|
276
|
+
己: "申",
|
|
277
|
+
庚: "戌",
|
|
278
|
+
辛: "亥",
|
|
279
|
+
壬: "丑",
|
|
280
|
+
癸: "寅",
|
|
281
|
+
};
|
|
282
|
+
const OFFICIAL_STAR_MAP = {
|
|
283
|
+
甲: "寅",
|
|
284
|
+
乙: "卯",
|
|
285
|
+
丙: "巳",
|
|
286
|
+
丁: "午",
|
|
287
|
+
戊: "巳",
|
|
288
|
+
己: "午",
|
|
289
|
+
庚: "申",
|
|
290
|
+
辛: "酉",
|
|
291
|
+
壬: "亥",
|
|
292
|
+
癸: "子",
|
|
293
|
+
};
|
|
294
|
+
// 암록 (일간 기준 → 지지에서 체크)
|
|
295
|
+
const HIDDEN_WEALTH_MAP = {
|
|
296
|
+
甲: "亥",
|
|
297
|
+
乙: "戌",
|
|
298
|
+
丙: "申",
|
|
299
|
+
丁: "未",
|
|
300
|
+
戊: "巳",
|
|
301
|
+
己: "辰",
|
|
302
|
+
庚: "卯",
|
|
303
|
+
辛: "寅",
|
|
304
|
+
壬: "丑",
|
|
305
|
+
癸: "子",
|
|
306
|
+
};
|
|
307
|
+
// 관귀학관 (일간 기준 → 지지에서 체크)
|
|
308
|
+
const OFFICIAL_ACADEMIC_HALL_MAP = {
|
|
309
|
+
甲: "巳",
|
|
310
|
+
乙: "巳",
|
|
311
|
+
丙: "申",
|
|
312
|
+
丁: "申",
|
|
313
|
+
戊: "亥",
|
|
314
|
+
己: "亥",
|
|
315
|
+
庚: "寅",
|
|
316
|
+
辛: "寅",
|
|
317
|
+
壬: "寅",
|
|
318
|
+
癸: "寅",
|
|
319
|
+
};
|
|
320
|
+
// 백호대살 (특정 주가 있으면 성립)
|
|
321
|
+
const WHITE_TIGER_PILLARS = new Set(["甲辰", "乙未", "丙戌", "丁丑", "戊辰", "壬戌", "癸丑"]);
|
|
322
|
+
// 현침살 지지 (천간은 기존 SUSPENDED_NEEDLE_STEMS 사용)
|
|
323
|
+
const SUSPENDED_NEEDLE_BRANCHES = new Set(["申", "卯", "午"]);
|
|
324
|
+
// 천문성 (월지 기준 → 천간/지지에서 체크)
|
|
325
|
+
const HEAVENLY_GATE_MAP = {
|
|
326
|
+
寅: "戌",
|
|
327
|
+
卯: "亥",
|
|
328
|
+
辰: "子",
|
|
329
|
+
巳: "丑",
|
|
330
|
+
午: "寅",
|
|
331
|
+
未: "卯",
|
|
332
|
+
申: "辰",
|
|
333
|
+
酉: "巳",
|
|
334
|
+
戌: "午",
|
|
335
|
+
亥: "未",
|
|
336
|
+
子: "申",
|
|
337
|
+
丑: "酉",
|
|
338
|
+
};
|
|
339
|
+
// 천주귀인 (일간 기준 → 지지에서 체크, 甲乙은 해당 없음)
|
|
340
|
+
const HEAVENLY_KITCHEN_MAP = {
|
|
341
|
+
丙: "巳",
|
|
342
|
+
丁: "午",
|
|
343
|
+
戊: "申",
|
|
344
|
+
己: "酉",
|
|
345
|
+
庚: "亥",
|
|
346
|
+
辛: "子",
|
|
347
|
+
壬: "寅",
|
|
348
|
+
癸: "卯",
|
|
349
|
+
};
|
|
350
|
+
// 문곡귀인 (일간 기준 → 지지에서 체크)
|
|
351
|
+
const LITERARY_CURVE_MAP = {
|
|
352
|
+
甲: "亥",
|
|
353
|
+
乙: "子",
|
|
354
|
+
丙: "寅",
|
|
355
|
+
丁: "卯",
|
|
356
|
+
戊: "寅",
|
|
357
|
+
己: "卯",
|
|
358
|
+
庚: "巳",
|
|
359
|
+
辛: "午",
|
|
360
|
+
壬: "申",
|
|
361
|
+
癸: "酉",
|
|
362
|
+
};
|
|
363
|
+
// 황은대사 (월지 기준 → 일지/시지에서 체크)
|
|
364
|
+
const IMPERIAL_PARDON_MAP = {
|
|
365
|
+
子: "申",
|
|
366
|
+
丑: "未",
|
|
367
|
+
寅: "戌",
|
|
368
|
+
卯: "丑",
|
|
369
|
+
辰: "寅",
|
|
370
|
+
巳: "巳",
|
|
371
|
+
午: "酉",
|
|
372
|
+
未: "卯",
|
|
373
|
+
申: "子",
|
|
374
|
+
酉: "午",
|
|
375
|
+
戌: "亥",
|
|
376
|
+
亥: "辰",
|
|
377
|
+
};
|
|
378
|
+
// 망신살 (년지/일지 기준 삼합 → 지지에서 체크)
|
|
379
|
+
const LOST_SPIRIT_MAP = {
|
|
380
|
+
寅: "巳",
|
|
381
|
+
午: "巳",
|
|
382
|
+
戌: "巳",
|
|
383
|
+
巳: "申",
|
|
384
|
+
酉: "申",
|
|
385
|
+
丑: "申",
|
|
386
|
+
申: "亥",
|
|
387
|
+
子: "亥",
|
|
388
|
+
辰: "亥",
|
|
389
|
+
亥: "寅",
|
|
390
|
+
卯: "寅",
|
|
391
|
+
未: "寅",
|
|
392
|
+
};
|
|
393
|
+
// 겁살 (년지/일지 기준 삼합 → 지지에서 체크)
|
|
394
|
+
const ROBBERY_MAP = {
|
|
395
|
+
寅: "亥",
|
|
396
|
+
午: "亥",
|
|
397
|
+
戌: "亥",
|
|
398
|
+
巳: "寅",
|
|
399
|
+
酉: "寅",
|
|
400
|
+
丑: "寅",
|
|
401
|
+
申: "巳",
|
|
402
|
+
子: "巳",
|
|
403
|
+
辰: "巳",
|
|
404
|
+
亥: "申",
|
|
405
|
+
卯: "申",
|
|
406
|
+
未: "申",
|
|
407
|
+
};
|
|
408
|
+
// 재살 (년지/일지 기준 삼합 → 지지에서 체크)
|
|
409
|
+
const DISASTER_MAP = {
|
|
410
|
+
寅: "子",
|
|
411
|
+
午: "子",
|
|
412
|
+
戌: "子",
|
|
413
|
+
巳: "卯",
|
|
414
|
+
酉: "卯",
|
|
415
|
+
丑: "卯",
|
|
416
|
+
申: "午",
|
|
417
|
+
子: "午",
|
|
418
|
+
辰: "午",
|
|
419
|
+
亥: "酉",
|
|
420
|
+
卯: "酉",
|
|
421
|
+
未: "酉",
|
|
422
|
+
};
|
|
423
|
+
// 장성 (년지/일지 기준 삼합의 왕지)
|
|
424
|
+
const GENERAL_STAR_MAP = {
|
|
425
|
+
寅: "午",
|
|
426
|
+
午: "午",
|
|
427
|
+
戌: "午",
|
|
428
|
+
巳: "酉",
|
|
429
|
+
酉: "酉",
|
|
430
|
+
丑: "酉",
|
|
431
|
+
申: "子",
|
|
432
|
+
子: "子",
|
|
433
|
+
辰: "子",
|
|
434
|
+
亥: "卯",
|
|
435
|
+
卯: "卯",
|
|
436
|
+
未: "卯",
|
|
437
|
+
};
|
|
438
|
+
// 반안살 (년지/일지 기준 삼합 → 왕지 다음 지지)
|
|
439
|
+
const SADDLE_MOUNT_MAP = {
|
|
440
|
+
寅: "未",
|
|
441
|
+
午: "未",
|
|
442
|
+
戌: "未",
|
|
443
|
+
巳: "戌",
|
|
444
|
+
酉: "戌",
|
|
445
|
+
丑: "戌",
|
|
446
|
+
申: "丑",
|
|
447
|
+
子: "丑",
|
|
448
|
+
辰: "丑",
|
|
449
|
+
亥: "辰",
|
|
450
|
+
卯: "辰",
|
|
451
|
+
未: "辰",
|
|
452
|
+
};
|
|
453
|
+
// 홍란살 (년지 기준 → 다른 지지에서 체크)
|
|
454
|
+
const RED_PHOENIX_MAP = {
|
|
455
|
+
子: "卯",
|
|
456
|
+
丑: "寅",
|
|
457
|
+
寅: "丑",
|
|
458
|
+
卯: "子",
|
|
459
|
+
辰: "亥",
|
|
460
|
+
巳: "戌",
|
|
461
|
+
午: "酉",
|
|
462
|
+
未: "申",
|
|
463
|
+
申: "未",
|
|
464
|
+
酉: "午",
|
|
465
|
+
戌: "巳",
|
|
466
|
+
亥: "辰",
|
|
467
|
+
};
|
|
468
|
+
// 천희살 (년지/일지 기준 → 다른 지지에서 체크)
|
|
469
|
+
const HEAVENLY_JOY_MAP = {
|
|
470
|
+
子: "酉",
|
|
471
|
+
丑: "申",
|
|
472
|
+
寅: "未",
|
|
473
|
+
卯: "午",
|
|
474
|
+
辰: "巳",
|
|
475
|
+
巳: "辰",
|
|
476
|
+
午: "卯",
|
|
477
|
+
未: "寅",
|
|
478
|
+
申: "丑",
|
|
479
|
+
酉: "子",
|
|
480
|
+
戌: "亥",
|
|
481
|
+
亥: "戌",
|
|
482
|
+
};
|
|
195
483
|
function checkBranchBasedSinsal(baseBranch, targetBranches, positions, map, sinsalKey) {
|
|
196
484
|
const matches = [];
|
|
197
485
|
const targetSinsal = map[baseBranch];
|
|
@@ -236,14 +524,91 @@ export function analyzeSinsals(yearPillar, monthPillar, dayPillar, hourPillar) {
|
|
|
236
524
|
matches.push(...checkBranchBasedSinsal(dayBranch, allBranches, positions, GHOST_GATE_MAP, "ghostGate"));
|
|
237
525
|
matches.push(...checkBranchBasedSinsal(yearBranch, allBranches, positions, SOLITARY_STAR_MAP, "solitaryStar"));
|
|
238
526
|
matches.push(...checkBranchBasedSinsal(yearBranch, allBranches, positions, WIDOW_STAR_MAP, "widowStar"));
|
|
239
|
-
|
|
240
|
-
|
|
527
|
+
// 천덕귀인 - 천간과 지지 모두에서 체크 (일부 값이 천간, 일부 값이 지지이므로)
|
|
528
|
+
const allStemsArr = [yearPillar[0], monthPillar[0], dayPillar[0], hourPillar[0]];
|
|
529
|
+
const allStemsAndBranches = [...allStemsArr, ...allBranches];
|
|
530
|
+
matches.push(...checkBranchBasedSinsal(monthBranch, allStemsAndBranches, [...positions, ...positions], HEAVENLY_VIRTUE_MAP, "heavenlyVirtue"));
|
|
531
|
+
// 월덕귀인 - 천간에서 체크
|
|
532
|
+
matches.push(...checkBranchBasedSinsal(monthBranch, allStemsArr, positions, MONTHLY_VIRTUE_MAP, "monthlyVirtue"));
|
|
241
533
|
matches.push(...checkStemBasedSinsal(dayStem, allBranches, positions, SKY_NOBLE_MAP, "skyNoble"));
|
|
242
534
|
matches.push(...checkStemBasedSinsal(yearStem, allBranches, positions, SKY_NOBLE_MAP, "moonNoble"));
|
|
243
535
|
matches.push(...checkStemBasedSinsal(dayStem, allBranches, positions, LITERARY_NOBLE_MAP, "literaryNoble"));
|
|
244
536
|
matches.push(...checkStemBasedSinsal(dayStem, allBranches, positions, ACADEMIC_HALL_MAP, "academicHall"));
|
|
245
537
|
matches.push(...checkBranchBasedSinsal(dayBranch, allBranches, positions, BLOOD_KNIFE_MAP, "bloodKnife"));
|
|
246
538
|
matches.push(...checkBranchBasedSinsal(monthBranch, allBranches, positions, HEAVENLY_DOCTOR_MAP, "heavenlyDoctor"));
|
|
539
|
+
const allStems = [yearPillar[0], monthPillar[0], dayPillar[0], hourPillar[0]];
|
|
540
|
+
allStems.forEach((stem, idx) => {
|
|
541
|
+
if (SUSPENDED_NEEDLE_STEMS.has(stem)) {
|
|
542
|
+
matches.push({ sinsal: getSinsalLabel("suspendedNeedle"), position: positions[idx] });
|
|
543
|
+
}
|
|
544
|
+
});
|
|
545
|
+
allBranches.forEach((branch, idx) => {
|
|
546
|
+
if (SUSPENDED_NEEDLE_BRANCHES.has(branch)) {
|
|
547
|
+
matches.push({ sinsal: getSinsalLabel("suspendedNeedle"), position: positions[idx] });
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
const allPillarsForKuiGang = [yearPillar, monthPillar, dayPillar, hourPillar];
|
|
551
|
+
allPillarsForKuiGang.forEach((pillar, idx) => {
|
|
552
|
+
if (KUI_GANG_PILLARS.has(pillar)) {
|
|
553
|
+
matches.push({ sinsal: getSinsalLabel("kuiGang"), position: positions[idx] });
|
|
554
|
+
}
|
|
555
|
+
});
|
|
556
|
+
matches.push(...checkStemBasedSinsal(dayStem, allBranches, positions, SHEEP_BLADE_MAP, "sheepBlade"));
|
|
557
|
+
matches.push(...checkStemBasedSinsal(dayStem, allBranches, positions, RED_FLAME_MAP, "redFlame"));
|
|
558
|
+
matches.push(...checkStemBasedSinsal(dayStem, allBranches, positions, TAIJI_NOBLE_MAP, "taijiNoble"));
|
|
559
|
+
matches.push(...checkStemBasedSinsal(dayStem, allBranches, positions, GOLDEN_CARRIAGE_MAP, "goldenCarriage"));
|
|
560
|
+
matches.push(...checkStemBasedSinsal(dayStem, allBranches, positions, OFFICIAL_STAR_MAP, "officialStar"));
|
|
561
|
+
matches.push(...checkStemBasedSinsal(dayStem, allBranches, positions, HIDDEN_WEALTH_MAP, "hiddenWealth"));
|
|
562
|
+
matches.push(...checkStemBasedSinsal(dayStem, allBranches, positions, OFFICIAL_ACADEMIC_HALL_MAP, "officialAcademicHall"));
|
|
563
|
+
const allPillars = [yearPillar, monthPillar, dayPillar, hourPillar];
|
|
564
|
+
allPillars.forEach((pillar, idx) => {
|
|
565
|
+
if (WHITE_TIGER_PILLARS.has(pillar)) {
|
|
566
|
+
matches.push({ sinsal: getSinsalLabel("whiteTiger"), position: positions[idx] });
|
|
567
|
+
}
|
|
568
|
+
});
|
|
569
|
+
matches.push(...checkBranchBasedSinsal(monthBranch, allBranches, positions, HEAVENLY_GATE_MAP, "heavenlyGate"));
|
|
570
|
+
matches.push(...checkStemBasedSinsal(dayStem, allBranches, positions, HEAVENLY_KITCHEN_MAP, "heavenlyKitchen"));
|
|
571
|
+
matches.push(...checkStemBasedSinsal(dayStem, allBranches, positions, LITERARY_CURVE_MAP, "literaryCurve"));
|
|
572
|
+
// 황은대사 (월지 기준 → 일지/시지에서만 체크)
|
|
573
|
+
const dayHourBranches = [dayBranch, hourBranch];
|
|
574
|
+
const dayHourPositions = ["day", "hour"];
|
|
575
|
+
matches.push(...checkBranchBasedSinsal(monthBranch, dayHourBranches, dayHourPositions, IMPERIAL_PARDON_MAP, "imperialPardon"));
|
|
576
|
+
// 망신살 (년지/일지 기준)
|
|
577
|
+
matches.push(...checkBranchBasedSinsal(yearBranch, allBranches, positions, LOST_SPIRIT_MAP, "lostSpirit"));
|
|
578
|
+
matches.push(...checkBranchBasedSinsal(dayBranch, allBranches, positions, LOST_SPIRIT_MAP, "lostSpirit"));
|
|
579
|
+
// 겁살 (년지/일지 기준)
|
|
580
|
+
matches.push(...checkBranchBasedSinsal(yearBranch, allBranches, positions, ROBBERY_MAP, "robbery"));
|
|
581
|
+
matches.push(...checkBranchBasedSinsal(dayBranch, allBranches, positions, ROBBERY_MAP, "robbery"));
|
|
582
|
+
// 재살 (년지/일지 기준)
|
|
583
|
+
matches.push(...checkBranchBasedSinsal(yearBranch, allBranches, positions, DISASTER_MAP, "disaster"));
|
|
584
|
+
matches.push(...checkBranchBasedSinsal(dayBranch, allBranches, positions, DISASTER_MAP, "disaster"));
|
|
585
|
+
// 장성살 (년지/일지 기준)
|
|
586
|
+
matches.push(...checkBranchBasedSinsal(yearBranch, allBranches, positions, GENERAL_STAR_MAP, "generalStar"));
|
|
587
|
+
matches.push(...checkBranchBasedSinsal(dayBranch, allBranches, positions, GENERAL_STAR_MAP, "generalStar"));
|
|
588
|
+
// 반안살 (년지/일지 기준)
|
|
589
|
+
matches.push(...checkBranchBasedSinsal(yearBranch, allBranches, positions, SADDLE_MOUNT_MAP, "saddleMount"));
|
|
590
|
+
matches.push(...checkBranchBasedSinsal(dayBranch, allBranches, positions, SADDLE_MOUNT_MAP, "saddleMount"));
|
|
591
|
+
// 홍란살 (년지 기준)
|
|
592
|
+
matches.push(...checkBranchBasedSinsal(yearBranch, allBranches, positions, RED_PHOENIX_MAP, "redPhoenix"));
|
|
593
|
+
// 천희살 (년지 기준)
|
|
594
|
+
matches.push(...checkBranchBasedSinsal(yearBranch, allBranches, positions, HEAVENLY_JOY_MAP, "heavenlyJoy"));
|
|
595
|
+
// 원진살 (일지 기준)
|
|
596
|
+
matches.push(...checkBranchBasedSinsal(dayBranch, allBranches, positions, WONJIN_MAP, "wonjin"));
|
|
597
|
+
// 공망 (일주 기준)
|
|
598
|
+
const stems = ["甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"];
|
|
599
|
+
const branches = ["子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"];
|
|
600
|
+
const sIdx = stems.indexOf(dayStem);
|
|
601
|
+
const bIdx = branches.indexOf(dayBranch);
|
|
602
|
+
if (sIdx !== -1 && bIdx !== -1) {
|
|
603
|
+
const diff = (bIdx - sIdx + 12) % 12;
|
|
604
|
+
const empty1 = branches[(diff + 10) % 12];
|
|
605
|
+
const empty2 = branches[(diff + 11) % 12];
|
|
606
|
+
allBranches.forEach((branch, idx) => {
|
|
607
|
+
if (branch === empty1 || branch === empty2) {
|
|
608
|
+
matches.push({ sinsal: getSinsalLabel("gongmang"), position: positions[idx] });
|
|
609
|
+
}
|
|
610
|
+
});
|
|
611
|
+
}
|
|
247
612
|
const uniqueMatches = matches.filter((match, index, self) => index ===
|
|
248
613
|
self.findIndex((m) => m.sinsal.key === match.sinsal.key && m.position === match.position));
|
|
249
614
|
const summary = {};
|
|
@@ -337,6 +702,144 @@ export const SINSAL_INFO = {
|
|
|
337
702
|
meaning: "치료, 의료, 건강 회복",
|
|
338
703
|
type: "auspicious",
|
|
339
704
|
},
|
|
705
|
+
suspendedNeedle: {
|
|
706
|
+
korean: "현침살",
|
|
707
|
+
hanja: "懸針殺",
|
|
708
|
+
meaning: "날카로운 기질, 성급함, 예리함",
|
|
709
|
+
type: "inauspicious",
|
|
710
|
+
},
|
|
711
|
+
kuiGang: {
|
|
712
|
+
korean: "괴강살",
|
|
713
|
+
hanja: "魁罡殺",
|
|
714
|
+
meaning: "강한 개성, 리더십, 독선",
|
|
715
|
+
type: "neutral",
|
|
716
|
+
},
|
|
717
|
+
sheepBlade: {
|
|
718
|
+
korean: "양인살",
|
|
719
|
+
hanja: "羊刃殺",
|
|
720
|
+
meaning: "극단적 성향, 승부욕, 위험",
|
|
721
|
+
type: "inauspicious",
|
|
722
|
+
},
|
|
723
|
+
redFlame: {
|
|
724
|
+
korean: "홍염살",
|
|
725
|
+
hanja: "紅艶殺",
|
|
726
|
+
meaning: "이성 문제, 색정, 매력",
|
|
727
|
+
type: "inauspicious",
|
|
728
|
+
},
|
|
729
|
+
taijiNoble: {
|
|
730
|
+
korean: "태극귀인",
|
|
731
|
+
hanja: "太極貴人",
|
|
732
|
+
meaning: "지혜, 학문, 귀인의 도움",
|
|
733
|
+
type: "auspicious",
|
|
734
|
+
},
|
|
735
|
+
goldenCarriage: {
|
|
736
|
+
korean: "금여성",
|
|
737
|
+
hanja: "金輿星",
|
|
738
|
+
meaning: "배우자운, 부귀, 명예",
|
|
739
|
+
type: "auspicious",
|
|
740
|
+
},
|
|
741
|
+
officialStar: {
|
|
742
|
+
korean: "건록",
|
|
743
|
+
hanja: "建祿",
|
|
744
|
+
meaning: "관직, 안정, 자립",
|
|
745
|
+
type: "auspicious",
|
|
746
|
+
},
|
|
747
|
+
hiddenWealth: {
|
|
748
|
+
korean: "암록",
|
|
749
|
+
hanja: "暗祿",
|
|
750
|
+
meaning: "숨겨진 재물, 은밀한 도움",
|
|
751
|
+
type: "auspicious",
|
|
752
|
+
},
|
|
753
|
+
officialAcademicHall: {
|
|
754
|
+
korean: "관귀학관",
|
|
755
|
+
hanja: "官貴學館",
|
|
756
|
+
meaning: "공직, 학문, 승진",
|
|
757
|
+
type: "auspicious",
|
|
758
|
+
},
|
|
759
|
+
whiteTiger: {
|
|
760
|
+
korean: "백호대살",
|
|
761
|
+
hanja: "白虎大殺",
|
|
762
|
+
meaning: "사고, 수술, 혈광",
|
|
763
|
+
type: "inauspicious",
|
|
764
|
+
},
|
|
765
|
+
heavenlyGate: {
|
|
766
|
+
korean: "천문성",
|
|
767
|
+
hanja: "天門星",
|
|
768
|
+
meaning: "영적 감각, 종교, 신비",
|
|
769
|
+
type: "neutral",
|
|
770
|
+
},
|
|
771
|
+
heavenlyKitchen: {
|
|
772
|
+
korean: "천주귀인",
|
|
773
|
+
hanja: "天廚貴人",
|
|
774
|
+
meaning: "의식주 풍족, 재물운, 복록",
|
|
775
|
+
type: "auspicious",
|
|
776
|
+
},
|
|
777
|
+
literaryCurve: {
|
|
778
|
+
korean: "문곡귀인",
|
|
779
|
+
hanja: "文曲貴人",
|
|
780
|
+
meaning: "예술, 문학, 감성적 학문",
|
|
781
|
+
type: "auspicious",
|
|
782
|
+
},
|
|
783
|
+
imperialPardon: {
|
|
784
|
+
korean: "황은대사",
|
|
785
|
+
hanja: "皇恩大赦",
|
|
786
|
+
meaning: "용서, 구원, 위기 극복, 귀인의 도움",
|
|
787
|
+
type: "auspicious",
|
|
788
|
+
},
|
|
789
|
+
lostSpirit: {
|
|
790
|
+
korean: "망신살",
|
|
791
|
+
hanja: "亡身煞",
|
|
792
|
+
meaning: "망신, 실수, 구설수",
|
|
793
|
+
type: "inauspicious",
|
|
794
|
+
},
|
|
795
|
+
robbery: {
|
|
796
|
+
korean: "겁살",
|
|
797
|
+
hanja: "劫煞",
|
|
798
|
+
meaning: "강탈, 재물 손실, 압류",
|
|
799
|
+
type: "inauspicious",
|
|
800
|
+
},
|
|
801
|
+
disaster: {
|
|
802
|
+
korean: "재살",
|
|
803
|
+
hanja: "災煞",
|
|
804
|
+
meaning: "재난, 감금, 소송",
|
|
805
|
+
type: "inauspicious",
|
|
806
|
+
},
|
|
807
|
+
generalStar: {
|
|
808
|
+
korean: "장성살",
|
|
809
|
+
hanja: "將星煞",
|
|
810
|
+
meaning: "권위, 리더십, 승진",
|
|
811
|
+
type: "auspicious",
|
|
812
|
+
},
|
|
813
|
+
saddleMount: {
|
|
814
|
+
korean: "반안살",
|
|
815
|
+
hanja: "攀鞍煞",
|
|
816
|
+
meaning: "안정, 출세, 승진",
|
|
817
|
+
type: "auspicious",
|
|
818
|
+
},
|
|
819
|
+
redPhoenix: {
|
|
820
|
+
korean: "홍란살",
|
|
821
|
+
hanja: "紅鸞煞",
|
|
822
|
+
meaning: "혼인, 경사, 매력",
|
|
823
|
+
type: "auspicious",
|
|
824
|
+
},
|
|
825
|
+
heavenlyJoy: {
|
|
826
|
+
korean: "천희살",
|
|
827
|
+
hanja: "天喜煞",
|
|
828
|
+
meaning: "기쁨, 출산, 경사",
|
|
829
|
+
type: "auspicious",
|
|
830
|
+
},
|
|
831
|
+
wonjin: {
|
|
832
|
+
korean: "원진살",
|
|
833
|
+
hanja: "元嗔煞",
|
|
834
|
+
meaning: "애증, 불화, 원망",
|
|
835
|
+
type: "inauspicious",
|
|
836
|
+
},
|
|
837
|
+
gongmang: {
|
|
838
|
+
korean: "공망",
|
|
839
|
+
hanja: "空亡",
|
|
840
|
+
meaning: "허무, 비움, 무력화",
|
|
841
|
+
type: "inauspicious",
|
|
842
|
+
},
|
|
340
843
|
};
|
|
341
844
|
export function getSinsalLabel(key) {
|
|
342
845
|
const info = SINSAL_INFO[key];
|
|
@@ -57,11 +57,16 @@ export interface SolarTermInfo {
|
|
|
57
57
|
/** Milliseconds timestamp of next Jie */
|
|
58
58
|
nextJieMillis: number;
|
|
59
59
|
}
|
|
60
|
-
export declare function analyzeSolarTerms<T>(
|
|
60
|
+
export declare function analyzeSolarTerms<T>(dtLocal: T, { adapter }: {
|
|
61
|
+
adapter: DateAdapter<T>;
|
|
62
|
+
}): SolarTermInfo;
|
|
61
63
|
/**
|
|
62
64
|
* Get all solar term dates for a given year
|
|
63
65
|
*/
|
|
64
|
-
export declare function getSolarTermsForYear<T>(
|
|
66
|
+
export declare function getSolarTermsForYear<T>(year: number, { adapter, timezone }: {
|
|
67
|
+
adapter: DateAdapter<T>;
|
|
68
|
+
timezone: string;
|
|
69
|
+
}): Array<{
|
|
65
70
|
term: SolarTerm;
|
|
66
71
|
date: SolarTermDateInfo;
|
|
67
72
|
}>;
|
|
@@ -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,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,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AAE,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;AAuMD,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
|
@@ -208,7 +208,7 @@ function toDateInfo(adapter, dt) {
|
|
|
208
208
|
minute: adapter.getMinute(dt),
|
|
209
209
|
};
|
|
210
210
|
}
|
|
211
|
-
export function analyzeSolarTerms(
|
|
211
|
+
export function analyzeSolarTerms(dtLocal, { adapter }) {
|
|
212
212
|
const dtUtc = adapter.toUTC(dtLocal);
|
|
213
213
|
const currentLongitude = sunApparentLongitude(adapter, dtUtc);
|
|
214
214
|
const currentIndex = getSolarTermIndexFromLongitude(currentLongitude);
|
|
@@ -275,7 +275,7 @@ export function analyzeSolarTerms(adapter, dtLocal) {
|
|
|
275
275
|
/**
|
|
276
276
|
* Get all solar term dates for a given year
|
|
277
277
|
*/
|
|
278
|
-
export function getSolarTermsForYear(
|
|
278
|
+
export function getSolarTermsForYear(year, { adapter, timezone }) {
|
|
279
279
|
const result = [];
|
|
280
280
|
for (let i = 0; i < SOLAR_TERMS.length; i++) {
|
|
281
281
|
const term = SOLAR_TERMS[i];
|
package/dist/index.d.ts
CHANGED
|
@@ -49,7 +49,8 @@ export interface SajuResult {
|
|
|
49
49
|
adjustedDtForHour: string;
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
export interface GetSajuOptions {
|
|
52
|
+
export interface GetSajuOptions<T> {
|
|
53
|
+
adapter: DateAdapter<T>;
|
|
53
54
|
longitudeDeg?: number;
|
|
54
55
|
gender: Gender;
|
|
55
56
|
tzOffsetHours?: number;
|
|
@@ -60,5 +61,5 @@ export interface GetSajuOptions {
|
|
|
60
61
|
to: number;
|
|
61
62
|
};
|
|
62
63
|
}
|
|
63
|
-
export declare function getSaju<T>(
|
|
64
|
+
export declare function getSaju<T>(dtLocal: T, options: GetSajuOptions<T>): SajuResult;
|
|
64
65
|
//# sourceMappingURL=index.d.ts.map
|
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,eAAe,EACpB,KAAK,iBAAiB,EACt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