Skip to content

Commit

Permalink
style: 調整格式
Browse files Browse the repository at this point in the history
  • Loading branch information
waterbeside committed Jan 14, 2023
1 parent 59c1e88 commit 5ec4592
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/plugins/theGods/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export const GOD_LEVEL_DICT: {
export const YMDH_SINGLE_LOWER = ['y', 'm', 'd', 'h']
export const YMDH_SINGLE_LOWER_SET = new Set(YMDH_SINGLE_LOWER)

export type LevelGodKey = typeof LEVEL_GOD_KEYS[number]
export type LevelGodKey = (typeof LEVEL_GOD_KEYS)[number]

export type ProcessData = {
gods: Set<string>
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/theGods/gods/by12Gods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ export const by12GodNames = [
'寶光'
] as const

type By12Gods = { [key in typeof by12GodNames[number]]: GodDictItem }
type By12Gods = { [key in (typeof by12GodNames)[number]]: GodDictItem }

/**
```
青龍 明堂 金匱 寶光 玉堂 司命 與吉神并則從所宜,與凶神并, 則從所忌
```
*/
const by12GodData: {
[key in typeof by12GodNames[number]]: [string[] | null, string[] | null, number]
[key in (typeof by12GodNames)[number]]: [string[] | null, string[] | null, number]
} = {
青龍: [null, null, 1],
明堂: [null, null, 1],
Expand Down Expand Up @@ -105,7 +105,7 @@ export const getBy12GodIdx = (
}

export const getBy12GodDataByKey = (key: string) => {
return by12GodData.hasOwnProperty(key) ? by12GodData[key as typeof by12GodNames[number]] : null
return by12GodData.hasOwnProperty(key) ? by12GodData[key as (typeof by12GodNames)[number]] : null
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/theGods/gods/dayGods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const dayGodNames = [
'氣往亡'
] as const

export type DayGods = { [key in typeof dayGodNames[number]]: GodDictItem }
export type DayGods = { [key in (typeof dayGodNames)[number]]: GodDictItem }

export const dayGods: DayGods = {
天恩: [
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/theGods/gods/duty12Gods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const duty12GodNames = [
] as const

const duty12GodData: {
[key in typeof duty12GodNames[number]]: [
[key in (typeof duty12GodNames)[number]]: [
string[] | null,
string[] | null,
GodDictItemExtra | null,
Expand Down Expand Up @@ -149,13 +149,13 @@ const duty12GodData: {

export const getDuty12GodDataBykey = (key: string) => {
return duty12GodData.hasOwnProperty(key)
? duty12GodData[key as typeof duty12GodNames[number]]
? duty12GodData[key as (typeof duty12GodNames)[number]]
: null
}

export const getDuty12GodIndexAndKey = function (
lsr: lunisolar.Lunisolar
): [number, typeof duty12GodNames[number]] {
): [number, (typeof duty12GodNames)[number]] {
const godIdx = (getBranchValue(lsr, 'day') + 12 - getBranchValue(lsr, 'month')) % 12
const key = duty12GodNames[godIdx]
return [godIdx, key]
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/theGods/gods/hourGods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const hourGodNames = [
'旬空'
] as const

export type HourGods = Record<typeof hourGodNames[number], GodDictItem>
export type HourGods = Record<(typeof hourGodNames)[number], GodDictItem>

export const hourGods: HourGods = {
// 時神從日干起者
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/theGods/gods/monthGods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const monthGodNames = [
'地火'
] as const

export type MonthGods = Record<typeof monthGodNames[number], GodDictItem>
export type MonthGods = Record<(typeof monthGodNames)[number], GodDictItem>

const monthGodsA: { [key: string]: GodDictItem } = {
// key : [取得方法, 属于年月日时用四位二进程表示]
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/theGods/gods/yearGods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const yearGodNames = [
'小耗'
] as const

export type YearGods = Record<typeof yearGodNames[number], GodDictItem>
export type YearGods = Record<(typeof yearGodNames)[number], GodDictItem>

const yearGodsA: { [key: string]: GodDictItem } = {
// key : [取得方法, 属于年月日时用四位二进程表示]
Expand Down

0 comments on commit 5ec4592

Please sign in to comment.