Skip to content

Commit

Permalink
Merge pull request #168 from SylarLong/fix-166
Browse files Browse the repository at this point in the history
fix: fix incorrect brightness #166
  • Loading branch information
SylarLong authored Jan 20, 2024
2 parents 75cf1dc + 762755f commit d76bb67
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 30 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@
- 🛠️ 修复(fix)
- 🧹 琐事(Chore)

## v2.2.3

- 🛠️ 修复(fix)

🇨🇳

- 修复星耀亮度错误 #166

🇺🇸

- fix incorrect brightness #166

## v2.2.2

- 🛠️ 修复(fix)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iztro",
"version": "2.2.2",
"version": "2.2.3",
"description": "轻量级紫微斗数星盘生成库。可以通过出生年月日获取到紫微斗数星盘信息、生肖、星座等信息。A lightweight kit to astrolabe generator of The Purple Star Astrology (Zi Wei Dou Shu). The Purple Star Astrology(Zi Wei Dou Shu) is a Chinese ancient astrology. You're able to get your horoscope and personality from the astrolabe",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/astro/analyzer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ describe('astro/analyzer', () => {
'咸池',
'天伤',
'天德',
'截路',
'截空',
]),
).toBe(false);
});
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/star/star.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ describe('star/index', () => {
{ name: '紫微', type: 'major', brightness: '旺', scope: 'origin', mutagen: '' },
{ name: '天府', type: 'major', brightness: '得', scope: 'origin', mutagen: '' },
],
[{ name: '太阴', type: 'major', brightness: '', scope: 'origin', mutagen: '科' }],
[{ name: '太阴', type: 'major', brightness: '', scope: 'origin', mutagen: '科' }],
[{ name: '贪狼', type: 'major', brightness: '庙', scope: 'origin', mutagen: '忌' }],
[{ name: '巨门', type: 'major', brightness: '旺', scope: 'origin', mutagen: '权' }],
[
Expand Down Expand Up @@ -194,7 +194,7 @@ describe('star/index', () => {
{ name: 'Tử Vi', type: 'major', brightness: 'Vượng', scope: 'origin', mutagen: '' },
{ name: 'Thiên Phủ', type: 'major', brightness: 'Đắc', scope: 'origin', mutagen: '' },
],
[{ name: 'Thái Âm', type: 'major', brightness: 'Vượng', scope: 'origin', mutagen: 'Khoa' }],
[{ name: 'Thái Âm', type: 'major', brightness: 'Bất', scope: 'origin', mutagen: 'Khoa' }],
[{ name: 'Tham Lang', type: 'major', brightness: 'Miếu', scope: 'origin', mutagen: 'Kỵ' }],
[{ name: 'Cự Môn', type: 'major', brightness: 'Vượng', scope: 'origin', mutagen: 'Quyền' }],
[
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/utils/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('Utils', () => {

test('getBrightness() should return correct value', () => {
expect(getBrightness('破军', fixEarthlyBranchIndex('午'))).toBe('庙');
expect(getBrightness('太阴', fixEarthlyBranchIndex('酉'))).toBe('');
expect(getBrightness('太阴', fixEarthlyBranchIndex('酉'))).toBe('');
expect(getBrightness('天机', fixEarthlyBranchIndex('未'))).toBe('陷');
expect(getBrightness('天府', fixEarthlyBranchIndex('申'))).toBe('得');
expect(getBrightness('廉贞', fixEarthlyBranchIndex('子'))).toBe('平');
Expand Down
27 changes: 6 additions & 21 deletions src/data/stars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,92 +7,77 @@ export const MUTAGEN = ['sihuaLu', 'sihuaQuan', 'sihuaKe', 'sihuaJi'] as const;
* 1. 亮度(bright), 按照宫位地支排序(从寅开始)
* 2. 五行(fiveElements)
* 3. 阴阳(yinYang)
* 4. 健康提示(healthTip)
*/
export const STARS_INFO = {
ziweiMaj: {
brightness: ['wang', 'wang', 'de', 'wang', 'miao', 'miao', 'wang', 'wang', 'de', 'wang', 'ping', 'miao'],
fiveElements: '土',
yinYang: '阴',
healthTip: '胰脏、脾脏、大脑中枢',
},
tianjiMaj: {
brightness: ['de', 'wang', 'li', 'ping', 'miao', 'xian', 'de', 'wang', 'li', 'ping', 'miao', 'xian'],
fiveElements: '木',
yinYang: '阴',
healthTip: '肝 胆、神经系统、手指尖神经末梢',
},
taiyangMaj: {
brightness: ['miao', 'miao', 'wang', 'wang', 'miao', 'de', 'de', 'ping', 'xian', 'xian', 'xian', 'bu'],
brightness: ['wang', 'miao', 'wang', 'wang', 'wang', 'de', 'de', 'xian', 'bu', 'xian', 'xian', 'bu'],
fiveElements: '',
yinYang: '',
healthTip: '心、脑、眼睛、心血管系统',
},
wuquMaj: {
brightness: ['de', 'li', 'miao', 'ping', 'wang', 'miao', 'de', 'li', 'miao', 'ping', 'wang', 'miao'],
fiveElements: '金',
yinYang: '阴',
healthTip: '呼吸系统、鼻、气管、支气管及肺部',
},
tiantongMaj: {
brightness: ['li', 'ping', 'ping', 'miao', 'xian', 'bu', 'wang', 'ping', 'ping', 'miao', 'wang', 'bu'],
fiveElements: '水',
yinYang: '阳',
healthTip: '膀胱、肾水系统、耳朵听力',
},
lianzhenMaj: {
brightness: ['miao', 'ping', 'li', 'xian', 'ping', 'li', 'miao', 'ping', 'li', 'xian', 'ping', 'li'],
fiveElements: '火',
yinYang: '阴',
healthTip: '血液血管,免疫力、生殖系统(子宫、卵巢、输卵管、输精管)、青春痘',
},
tianfuMaj: {
brightness: ['miao', 'de', 'miao', 'de', 'wang', 'miao', 'de', 'wang', 'miao', 'de', 'miao', 'miao'],
fiveElements: '土',
yinYang: '阳',
healthTip: '胃脏、十二指肠、小肠',
},
taiyinMaj: {
brightness: ['wang', 'xian', 'xian', 'xian', 'xian', 'bu', 'li', 'wang', 'wang', 'miao', 'miao', 'miao'],
brightness: ['wang', 'xian', 'xian', 'xian', 'bu', 'bu', 'li', 'bu', 'wang', 'miao', 'miao', 'miao'],
fiveElements: '水',
yinYang: '阴',
healthTip: '肾脏、肾水系统、眼睛视力',
},
tanlangMaj: {
brightness: ['ping', 'li', 'miao', 'xian', 'wang', 'miao', 'ping', 'li', 'miao', 'xian', 'wang', 'miao'],
fiveElements: '水',
yinYang: '',
healthTip: '生殖器官',
},
jumenMaj: {
brightness: ['miao', 'miao', 'ping', 'wang', 'wang', 'bu', 'miao', 'miao', 'ping', 'wang', 'wang', 'bu'],
brightness: ['miao', 'miao', 'xian', 'wang', 'wang', 'bu', 'miao', 'miao', 'xian', 'wang', 'wang', 'bu'],
fiveElements: '土',
yinYang: '阴',
healthTip: '食道、喉管、口、通道管状部位',
},
tianxiangMaj: {
brightness: ['miao', 'xian', 'de', 'de', 'wang', 'de', 'miao', 'xian', 'de', 'de', 'miao', 'miao'],
brightness: ['miao', 'xian', 'de', 'de', 'miao', 'de', 'miao', 'xian', 'de', 'de', 'miao', 'miao'],
fiveElements: '水',
yinYang: '',
healthTip: '面部、脸',
},
tianliangMaj: {
brightness: ['miao', 'miao', 'wang', 'xian', 'miao', 'miao', 'miao', 'de', 'miao', 'xian', 'miao', 'wang'],
brightness: ['miao', 'miao', 'miao', 'xian', 'miao', 'wang', 'xian', 'de', 'miao', 'xian', 'miao', 'wang'],
fiveElements: '土',
yinYang: '',
healthTip: '肌肉、肋骨',
},
qishaMaj: {
brightness: ['miao', 'wang', 'miao', 'ping', 'wang', 'miao', 'miao', 'wang', 'miao', 'ping', 'wang', 'miao'],
brightness: ['miao', 'wang', 'miao', 'ping', 'wang', 'miao', 'miao', 'miao', 'miao', 'ping', 'wang', 'miao'],
fiveElements: '',
yinYang: '',
healthTip: '骨头、脊椎骨、直肠大肠',
},
pojunMaj: {
brightness: ['de', 'xian', 'wang', 'ping', 'miao', 'wang', 'de', 'xian', 'wang', 'ping', 'miao', 'wang'],
fiveElements: '水',
yinYang: '',
healthTip: '生殖器官、肾脏、脑神经、皮肤',
},
wenchangMin: {
brightness: ['xian', 'li', 'de', 'miao', 'xian', 'li', 'de', 'miao', 'xian', 'li', 'de', 'miao'],
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/ja-JP/star.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default {
xunzhong: '旬中',
xunkong: '旬空',
kongwang: '空亡',
jielu: '截路',
jielu: '截空',
yuede: '月德',
tianshang: '天傷',
tianshi: '天使',
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/zh-CN/star.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default {
xunzhong: '旬中',
xunkong: '旬空',
kongwang: '空亡',
jielu: '截路',
jielu: '截空',
yuede: '月德',
tianshang: '天伤',
tianshi: '天使',
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/zh-TW/star.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default {
xunzhong: '旬中',
xunkong: '旬空',
kongwang: '空亡',
jielu: '截路',
jielu: '截空',
yuede: '月德',
tianshang: '天傷',
tianshi: '天使',
Expand Down
2 changes: 1 addition & 1 deletion src/star/location.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ export const getGuGuaIndex = (earthlyBranchName: EarthlyBranchName) => {
* - 甲喜羊鸡乙龙猴,丙年蛇鼠一窝谋。丁虎擒猪戊玉兔,
* - 己鸡居然与虎俦。庚猪马辛鸡蛇走,壬犬马癸马蛇游。
*
* - 安截路空亡
* - 安截路空亡(截空)
* - 甲己之年申酉,乙庚之年午未,
* - 丙辛之年辰巳,丁壬之年寅卯,
* - 戊癸之年子丑。
Expand Down

0 comments on commit d76bb67

Please sign in to comment.