lunisolar
Version:
专业农历库,支持公历阴历互转,支持各类黄历数据查询,如八字四柱、阴历、神煞宜忌、时辰吉凶、建除十二神、胎神占方、五行纳音等。支持自定义插件。
24 lines (19 loc) • 450 B
text/typescript
import { trans } from '../utils'
export class GodBase {
readonly key: string
readonly _config: Required<ClassCommonConfig> = {
lang: 'zh'
}
constructor(godKey: string, config?: ClassCommonConfig) {
this.key = godKey
if (config) {
this._config = Object.assign({}, this._config, config)
}
}
get name(): string {
return trans(`gods.${this.key}`, this._config.lang)
}
toString() {
return this.name
}
}