@gracefullight/saju 0.1.0 → 0.1.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.en.md +11 -11
- package/README.md +9 -9
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @gracefullight/saju
|
|
2
2
|
|
|
3
|
-
> TypeScript library for calculating Four Pillars of Destiny (
|
|
3
|
+
> TypeScript library for calculating Four Pillars of Destiny (Saju, 四柱命理) with flexible date adapter support.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@gracefullight/saju)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
|
|
20
20
|
## What is Saju (四柱)?
|
|
21
21
|
|
|
22
|
-
Saju
|
|
22
|
+
Saju (Four Pillars of Destiny, 四柱命理) is a traditional Korean and Chinese divination system based on one's birth year, month, day, and hour. Each pillar consists of:
|
|
23
23
|
- **Heavenly Stem (天干)**: 10 elements (甲乙丙丁戊己庚辛壬癸)
|
|
24
24
|
- **Earthly Branch (地支)**: 12 zodiac signs (子丑寅卯辰巳午未申酉戌亥)
|
|
25
25
|
|
|
26
26
|
This library calculates these pillars using:
|
|
27
|
-
- **Lichun (
|
|
27
|
+
- **Lichun (立春, Start of Spring)** for year pillar transitions
|
|
28
28
|
- **Solar longitude** for month pillar determination
|
|
29
29
|
- **Julian Day Number** for day pillar calculation
|
|
30
|
-
- **Traditional Chinese hour system (
|
|
30
|
+
- **Traditional Chinese double-hour system (時辰, shichen)** for hour pillar
|
|
31
31
|
|
|
32
32
|
## Installation
|
|
33
33
|
|
|
@@ -179,7 +179,7 @@ const myAdapter: DateAdapter<MyDateType> = {
|
|
|
179
179
|
### Configuration Presets
|
|
180
180
|
|
|
181
181
|
#### `STANDARD_PRESET`
|
|
182
|
-
|
|
182
|
+
Contemporary interpretation with midnight day boundary and no solar time correction.
|
|
183
183
|
|
|
184
184
|
```typescript
|
|
185
185
|
{
|
|
@@ -384,8 +384,8 @@ console.log(solarTime.hour); // ~11.47 (11:28)
|
|
|
384
384
|
|
|
385
385
|
**Midnight Mode** (`dayBoundary: "midnight"`):
|
|
386
386
|
- Day changes at 00:00 local time
|
|
387
|
-
- Simpler,
|
|
388
|
-
-
|
|
387
|
+
- Simpler, aligns with contemporary calendar systems
|
|
388
|
+
- Suitable for general use
|
|
389
389
|
|
|
390
390
|
**Zi Hour Mode** (`dayBoundary: "zi23"`):
|
|
391
391
|
- Day changes at 23:00 local time
|
|
@@ -410,7 +410,7 @@ Mix and match settings for specific needs:
|
|
|
410
410
|
|
|
411
411
|
```typescript
|
|
412
412
|
const customConfig = {
|
|
413
|
-
dayBoundary: "midnight" as const, //
|
|
413
|
+
dayBoundary: "midnight" as const, // Contemporary midnight boundary
|
|
414
414
|
useMeanSolarTimeForHour: true, // But use solar time for hour
|
|
415
415
|
useMeanSolarTimeForBoundary: false, // Local time for day boundary
|
|
416
416
|
};
|
|
@@ -583,12 +583,12 @@ Different projects use different date libraries. The adapter pattern allows you
|
|
|
583
583
|
|
|
584
584
|
### What's the difference between STANDARD_PRESET and TRADITIONAL_PRESET?
|
|
585
585
|
|
|
586
|
-
**STANDARD_PRESET** uses
|
|
586
|
+
**STANDARD_PRESET** uses contemporary conventions:
|
|
587
587
|
- Day starts at midnight (00:00)
|
|
588
588
|
- Uses local clock time
|
|
589
589
|
- Simpler for general use
|
|
590
590
|
|
|
591
|
-
**TRADITIONAL_PRESET** follows traditional Chinese astrology:
|
|
591
|
+
**TRADITIONAL_PRESET** follows traditional Chinese astrology practices:
|
|
592
592
|
- Day starts at Zi hour (23:00)
|
|
593
593
|
- Applies solar time correction based on longitude
|
|
594
594
|
- More historically accurate
|
|
@@ -622,7 +622,7 @@ For example, 23:30 could be:
|
|
|
622
622
|
- Same day's Zi hour (with midnight boundary)
|
|
623
623
|
- Next day's Zi hour (with Zi23 boundary)
|
|
624
624
|
|
|
625
|
-
This is intentional and reflects different
|
|
625
|
+
This is intentional and reflects different interpretative traditions in Saju analysis.
|
|
626
626
|
|
|
627
627
|
## Contributing
|
|
628
628
|
|
package/README.md
CHANGED
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
|
|
10
10
|
## 주요 기능
|
|
11
11
|
|
|
12
|
-
- **정확한 사주 계산** - 천문학적
|
|
12
|
+
- **정확한 사주 계산** - 천문학적 정확도로 전통 중국 역법 알고리즘 구현
|
|
13
13
|
- **유연한 날짜 어댑터 패턴** - Luxon, date-fns 또는 원하는 날짜 라이브러리 사용 가능
|
|
14
|
-
- **타임존 & 위치 지원** - 타임존 및 지리적
|
|
14
|
+
- **타임존 & 위치 지원** - 타임존 및 지리적 좌표를 올바르게 처리
|
|
15
15
|
- **태양시 보정** - 경도 기반 평균 태양시 조정 옵션
|
|
16
16
|
- **트리쉐이킹 지원** - 필요한 것만 import
|
|
17
17
|
- **완전한 타입 지원** - TypeScript 정의 완비
|
|
18
|
-
-
|
|
18
|
+
- **풍부한 테스트** - 85개 이상 테스트, 91% 이상 커버리지
|
|
19
19
|
|
|
20
20
|
## 사주(四柱)란?
|
|
21
21
|
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
- **지지(地支)**: 12지지 (子丑寅卯辰巳午未申酉戌亥)
|
|
25
25
|
|
|
26
26
|
이 라이브러리는 다음을 사용하여 기둥을 계산합니다:
|
|
27
|
-
- **입춘(立春)** 을
|
|
27
|
+
- **입춘(立春)** 을 기준으로 한 연주 전환
|
|
28
28
|
- **태양 황경** 을 이용한 월주 결정
|
|
29
29
|
- **율리우스 적일** 을 이용한 일주 계산
|
|
30
30
|
- **전통 중국 시진(時辰) 체계** 를 이용한 시주
|
|
@@ -179,7 +179,7 @@ const myAdapter: DateAdapter<MyDateType> = {
|
|
|
179
179
|
### 설정 프리셋
|
|
180
180
|
|
|
181
181
|
#### `STANDARD_PRESET`
|
|
182
|
-
자정 날짜 경계와 태양시 보정
|
|
182
|
+
현대적 해석: 자정 날짜 경계와 태양시 보정 없음
|
|
183
183
|
|
|
184
184
|
```typescript
|
|
185
185
|
{
|
|
@@ -190,7 +190,7 @@ const myAdapter: DateAdapter<MyDateType> = {
|
|
|
190
190
|
```
|
|
191
191
|
|
|
192
192
|
#### `TRADITIONAL_PRESET`
|
|
193
|
-
자시(23:00) 날짜 경계와 태양시
|
|
193
|
+
전통적 해석: 자시(23:00) 날짜 경계와 태양시 보정 사용
|
|
194
194
|
|
|
195
195
|
```typescript
|
|
196
196
|
{
|
|
@@ -519,7 +519,7 @@ pnpm install
|
|
|
519
519
|
# 테스트 실행
|
|
520
520
|
pnpm test
|
|
521
521
|
|
|
522
|
-
#
|
|
522
|
+
# 커버리지 확인
|
|
523
523
|
pnpm test:coverage
|
|
524
524
|
|
|
525
525
|
# 빌드
|
|
@@ -588,7 +588,7 @@ All files | 91.45 | 80.68 | 96.55 | 91.45
|
|
|
588
588
|
- 현지 시계 시간 사용
|
|
589
589
|
- 일반적인 사용에 더 간단
|
|
590
590
|
|
|
591
|
-
**TRADITIONAL_PRESET**은 전통 중국
|
|
591
|
+
**TRADITIONAL_PRESET**은 전통 중국 점성술을 따름:
|
|
592
592
|
- 날짜가 자시(23:00)에 시작
|
|
593
593
|
- 경도 기반 태양시 보정 적용
|
|
594
594
|
- 역사적으로 더 정확
|
|
@@ -622,7 +622,7 @@ All files | 91.45 | 80.68 | 96.55 | 91.45
|
|
|
622
622
|
- 같은 날의 자시 (자정 경계 사용 시)
|
|
623
623
|
- 다음 날의 자시 (자시23 경계 사용 시)
|
|
624
624
|
|
|
625
|
-
이는 의도적이며 사주 해석의 다양한
|
|
625
|
+
이는 의도적이며 사주 해석의 다양한 전통을 반영합니다.
|
|
626
626
|
|
|
627
627
|
## 기여하기
|
|
628
628
|
|