Comparing version 1.3.3 to 1.3.4
@@ -10,2 +10,34 @@ # 紫微斗数 @sylarlong/astro | ||
## v1.3.4 | ||
- 🪄 功能(feature) | ||
🇨🇳 | ||
- 判断运限四化 #74 | ||
🇺🇸 | ||
- check horoscope mutagen state #74 | ||
- ✨ 改进(enhancement) | ||
🇨🇳 | ||
- 重构代码 #72 | ||
🇺🇸 | ||
- refactor code #72 | ||
- 🛠️ 修复(fix) | ||
🇨🇳 | ||
- 文曲星亮度丢失 | ||
🇺🇸 | ||
- fix brightness missed issue | ||
## v1.3.3 | ||
@@ -12,0 +44,0 @@ |
@@ -12,3 +12,2 @@ "use strict"; | ||
var star_1 = require("../star"); | ||
var FunctionalStar_1 = __importDefault(require("../star/FunctionalStar")); | ||
var utils_1 = require("../utils"); | ||
@@ -18,5 +17,2 @@ var FunctionalAstrolabe_1 = __importDefault(require("./FunctionalAstrolabe")); | ||
var palace_1 = require("./palace"); | ||
var _toFunctionalStars = function (stars) { | ||
return stars.map(function (star) { return new FunctionalStar_1.default(star); }); | ||
}; | ||
/** | ||
@@ -57,5 +53,5 @@ * 通过阳历获取星盘信息 | ||
earthlyBranch: (0, i18n_1.t)(earthlyBranchOfPalace), | ||
majorStars: _toFunctionalStars(majorStars[i].concat(minorStars[i].filter(function (star) { return ['lucun', 'tianma'].includes(star.type); }))), | ||
minorStars: _toFunctionalStars(minorStars[i].filter(function (star) { return !['lucun', 'tianma'].includes(star.type); })), | ||
adjectiveStars: _toFunctionalStars(adjectiveStars[i]), | ||
majorStars: majorStars[i].concat(minorStars[i].filter(function (star) { return ['lucun', 'tianma'].includes(star.type); })), | ||
minorStars: minorStars[i].filter(function (star) { return !['lucun', 'tianma'].includes(star.type); }), | ||
adjectiveStars: adjectiveStars[i], | ||
changsheng12: changsheng12[i], | ||
@@ -62,0 +58,0 @@ boshi12: boshi12[i], |
import { Horoscope, Scope } from '../data/types'; | ||
import { PalaceName, StarName } from '../i18n'; | ||
import { Mutagen, PalaceName, StarName } from '../i18n'; | ||
import { IFunctionalAstrolabe } from './FunctionalAstrolabe'; | ||
@@ -68,2 +68,13 @@ import { FunctionalSurpalaces } from './FunctionalSurpalaces'; | ||
hasOneOfHoroscopeStars: (palaceName: PalaceName, scope: Scope, horoscopeStar: StarName[]) => boolean; | ||
/** | ||
* 判断指定运限宫位内是否存在运限四化 | ||
* | ||
* @version v1.3.4 | ||
* | ||
* @param palaceName 宫位名称 | ||
* @param scope 指定获取哪个运限的宫位 | ||
* @param horoscopeMutagen 运限四化 | ||
* @returns {boolean} 是否含有运限四化 | ||
*/ | ||
hasHoroscopeMutagen: (palaceName: PalaceName, scope: Scope, horoscopeMutagen: Mutagen) => boolean; | ||
} | ||
@@ -96,2 +107,3 @@ export default class FunctionalHoroscope implements IFunctionalHoroscope { | ||
hasOneOfHoroscopeStars: (palaceName: PalaceName, scope: Scope, horoscopeStar: StarName[]) => boolean; | ||
hasHoroscopeMutagen: (palaceName: PalaceName, scope: Scope, horoscopeMutagen: Mutagen) => boolean; | ||
} |
@@ -5,2 +5,3 @@ "use strict"; | ||
var utils_1 = require("../utils"); | ||
var data_1 = require("../data"); | ||
var _getHoroscopePalaceIndex = function ($, scope, palaceName) { | ||
@@ -72,2 +73,14 @@ var palaceIndex = -1; | ||
}; | ||
this.hasHoroscopeMutagen = function (palaceName, scope, horoscopeMutagen) { | ||
var _a, _b, _c, _d; | ||
if (scope === 'origin') { | ||
return false; | ||
} | ||
var palaceIndex = _getHoroscopePalaceIndex(_this, scope, palaceName); | ||
var majorStars = (_b = (_a = _this.astrolabe.palace(palaceIndex)) === null || _a === void 0 ? void 0 : _a.majorStars) !== null && _b !== void 0 ? _b : []; | ||
var minorStars = (_d = (_c = _this.astrolabe.palace(palaceIndex)) === null || _c === void 0 ? void 0 : _c.minorStars) !== null && _d !== void 0 ? _d : []; | ||
var stars = (0, utils_1.mergeStars)([majorStars], [minorStars])[0].map(function (star) { return (0, i18n_1.kot)(star.name); }); | ||
var mutagenIndex = data_1.MUTAGEN.indexOf((0, i18n_1.kot)(horoscopeMutagen)); | ||
return stars.includes((0, i18n_1.kot)(_this[scope].mutagen[mutagenIndex])); | ||
}; | ||
this.lunarDate = data.lunarDate; | ||
@@ -74,0 +87,0 @@ this.solarDate = data.solarDate; |
@@ -99,3 +99,3 @@ /** 紫微斗数四化 */ | ||
}; | ||
readonly wenjuMin: { | ||
readonly wenquMin: { | ||
readonly brightness: readonly ["ping", "wang", "de", "miao", "xian", "wang", "de", "miao", "xian", "wang", "de", "miao"]; | ||
@@ -102,0 +102,0 @@ }; |
@@ -102,3 +102,3 @@ "use strict"; | ||
}, | ||
wenjuMin: { | ||
wenquMin: { | ||
brightness: ['ping', 'wang', 'de', 'miao', 'xian', 'wang', 'de', 'miao', 'xian', 'wang', 'de', 'miao'], | ||
@@ -105,0 +105,0 @@ }, |
import { IFunctionalPalace } from '../../astro/FunctionalPalace'; | ||
import { EarthlyBranchName, FiveElementsClassName, HeavenlyStemName, PalaceName, StarName } from '../../i18n'; | ||
import FunctionalStar from '../../star/FunctionalStar'; | ||
import { HeavenlyStemAndEarthlyBranchDate, LunarDate } from './calendar'; | ||
import { Star } from './star'; | ||
/** | ||
@@ -29,3 +29,3 @@ * 运限对象 | ||
/** 流耀 */ | ||
stars?: Star[][]; | ||
stars?: FunctionalStar[][]; | ||
}; | ||
@@ -32,0 +32,0 @@ /** |
@@ -0,1 +1,2 @@ | ||
import FunctionalStar from './FunctionalStar'; | ||
/** | ||
@@ -9,2 +10,2 @@ * 安杂耀 | ||
*/ | ||
export declare const getAdjectiveStar: (solarDateStr: string, timeIndex: number, fixLeap?: boolean) => import("../data/types").Star[][]; | ||
export declare const getAdjectiveStar: (solarDateStr: string, timeIndex: number, fixLeap?: boolean) => FunctionalStar[][]; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -7,2 +10,3 @@ exports.getAdjectiveStar = void 0; | ||
var i18n_1 = require("../i18n"); | ||
var FunctionalStar_1 = __importDefault(require("./FunctionalStar")); | ||
var location_1 = require("./location"); | ||
@@ -25,41 +29,41 @@ /** | ||
var _a = (0, location_1.getLuanXiIndex)(yearly[1]), hongluanIndex = _a.hongluanIndex, tianxiIndex = _a.tianxiIndex; | ||
stars[hongluanIndex].push({ name: (0, i18n_1.t)('hongluan'), type: 'flower', scope: 'origin' }); | ||
stars[tianxiIndex].push({ name: (0, i18n_1.t)('tianxi'), type: 'flower', scope: 'origin' }); | ||
stars[monthlyIndex.tianyaoIndex].push({ name: (0, i18n_1.t)('tianyao'), type: 'flower', scope: 'origin' }); | ||
stars[yearlyIndex.xianchiIndex].push({ name: (0, i18n_1.t)('xianchi'), type: 'flower', scope: 'origin' }); | ||
stars[monthlyIndex.yuejieIndex].push({ name: (0, i18n_1.t)('jieshen'), type: 'helper', scope: 'origin' }); | ||
stars[dailyIndex.santaiIndex].push({ name: (0, i18n_1.t)('santai'), type: 'adjective', scope: 'origin' }); | ||
stars[dailyIndex.bazuoIndex].push({ name: (0, i18n_1.t)('bazuo'), type: 'adjective', scope: 'origin' }); | ||
stars[dailyIndex.enguangIndex].push({ name: (0, i18n_1.t)('engguang'), type: 'adjective', scope: 'origin' }); | ||
stars[dailyIndex.tianguiIndex].push({ name: (0, i18n_1.t)('tiangui'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.longchiIndex].push({ name: (0, i18n_1.t)('longchi'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.fenggeIndex].push({ name: (0, i18n_1.t)('fengge'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.tiancaiIndex].push({ name: (0, i18n_1.t)('tiancai'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.tianshouIndex].push({ name: (0, i18n_1.t)('tianshou'), type: 'adjective', scope: 'origin' }); | ||
stars[timelyIndex.taifuIndex].push({ name: (0, i18n_1.t)('taifu'), type: 'adjective', scope: 'origin' }); | ||
stars[timelyIndex.fenggaoIndex].push({ name: (0, i18n_1.t)('fenggao'), type: 'adjective', scope: 'origin' }); | ||
stars[monthlyIndex.tianwuIndex].push({ name: (0, i18n_1.t)('tianwu'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.huagaiIndex].push({ name: (0, i18n_1.t)('huagai'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.tianguanIndex].push({ name: (0, i18n_1.t)('tianguan'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.tianfuIndex].push({ name: (0, i18n_1.t)('tianfu'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.tianchuIndex].push({ name: (0, i18n_1.t)('tianchu'), type: 'adjective', scope: 'origin' }); | ||
stars[monthlyIndex.tianyueIndex].push({ name: (0, i18n_1.t)('tianyue'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.tiandeIndex].push({ name: (0, i18n_1.t)('tiande'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.yuedeIndex].push({ name: (0, i18n_1.t)('yuede'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.tiankongIndex].push({ name: (0, i18n_1.t)('tiankong'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.xunkongIndex].push({ name: (0, i18n_1.t)('xunkong'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.jieluIndex].push({ name: (0, i18n_1.t)('jielu'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.kongwangIndex].push({ name: (0, i18n_1.t)('kongwang'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.guchenIndex].push({ name: (0, i18n_1.t)('guchen'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.guasuIndex].push({ name: (0, i18n_1.t)('guasu'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.feilianIndex].push({ name: (0, i18n_1.t)('feilian'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.posuiIndex].push({ name: (0, i18n_1.t)('posui'), type: 'adjective', scope: 'origin' }); | ||
stars[monthlyIndex.tianxingIndex].push({ name: (0, i18n_1.t)('tianxing'), type: 'adjective', scope: 'origin' }); | ||
stars[monthlyIndex.yinshaIndex].push({ name: (0, i18n_1.t)('yinsha'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.tiankuIndex].push({ name: (0, i18n_1.t)('tianku'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.tianxuIndex].push({ name: (0, i18n_1.t)('tianxu'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.tianshiIndex].push({ name: (0, i18n_1.t)('tianshi'), type: 'adjective', scope: 'origin' }); | ||
stars[yearlyIndex.tianshangIndex].push({ name: (0, i18n_1.t)('tianshang'), type: 'adjective', scope: 'origin' }); | ||
stars[hongluanIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('hongluan'), type: 'flower', scope: 'origin' })); | ||
stars[tianxiIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('tianxi'), type: 'flower', scope: 'origin' })); | ||
stars[monthlyIndex.tianyaoIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('tianyao'), type: 'flower', scope: 'origin' })); | ||
stars[yearlyIndex.xianchiIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('xianchi'), type: 'flower', scope: 'origin' })); | ||
stars[monthlyIndex.yuejieIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('jieshen'), type: 'helper', scope: 'origin' })); | ||
stars[dailyIndex.santaiIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('santai'), type: 'adjective', scope: 'origin' })); | ||
stars[dailyIndex.bazuoIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('bazuo'), type: 'adjective', scope: 'origin' })); | ||
stars[dailyIndex.enguangIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('engguang'), type: 'adjective', scope: 'origin' })); | ||
stars[dailyIndex.tianguiIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('tiangui'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.longchiIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('longchi'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.fenggeIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('fengge'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.tiancaiIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('tiancai'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.tianshouIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('tianshou'), type: 'adjective', scope: 'origin' })); | ||
stars[timelyIndex.taifuIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('taifu'), type: 'adjective', scope: 'origin' })); | ||
stars[timelyIndex.fenggaoIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('fenggao'), type: 'adjective', scope: 'origin' })); | ||
stars[monthlyIndex.tianwuIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('tianwu'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.huagaiIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('huagai'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.tianguanIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('tianguan'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.tianfuIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('tianfu'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.tianchuIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('tianchu'), type: 'adjective', scope: 'origin' })); | ||
stars[monthlyIndex.tianyueIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('tianyue'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.tiandeIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('tiande'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.yuedeIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('yuede'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.tiankongIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('tiankong'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.xunkongIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('xunkong'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.jieluIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('jielu'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.kongwangIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('kongwang'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.guchenIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('guchen'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.guasuIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('guasu'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.feilianIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('feilian'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.posuiIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('posui'), type: 'adjective', scope: 'origin' })); | ||
stars[monthlyIndex.tianxingIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('tianxing'), type: 'adjective', scope: 'origin' })); | ||
stars[monthlyIndex.yinshaIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('yinsha'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.tiankuIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('tianku'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.tianxuIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('tianxu'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.tianshiIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('tianshi'), type: 'adjective', scope: 'origin' })); | ||
stars[yearlyIndex.tianshangIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('tianshang'), type: 'adjective', scope: 'origin' })); | ||
return stars; | ||
}; | ||
exports.getAdjectiveStar = getAdjectiveStar; |
@@ -1,3 +0,3 @@ | ||
import { Star } from '../data/types'; | ||
import { HeavenlyStemName, EarthlyBranchName } from '../i18n'; | ||
import FunctionalStar from './FunctionalStar'; | ||
/** | ||
@@ -11,2 +11,2 @@ * 获取流耀 | ||
*/ | ||
export declare const getHoroscopeStar: (heavenlyStem: HeavenlyStemName, earthlyBranch: EarthlyBranchName, scope: 'decadal' | 'yearly') => Star[][]; | ||
export declare const getHoroscopeStar: (heavenlyStem: HeavenlyStemName, earthlyBranch: EarthlyBranchName, scope: 'decadal' | 'yearly') => FunctionalStar[][]; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -6,2 +9,3 @@ exports.getHoroscopeStar = void 0; | ||
var i18n_1 = require("../i18n"); | ||
var FunctionalStar_1 = __importDefault(require("./FunctionalStar")); | ||
var location_1 = require("./location"); | ||
@@ -24,25 +28,25 @@ /** | ||
var nianjieIndex = (0, location_1.getNianjieIndex)(earthlyBranch); | ||
stars[nianjieIndex].push({ name: (0, i18n_1.t)('nianjie'), type: 'helper', scope: 'yearly' }); | ||
stars[kuiIndex].push({ name: (0, i18n_1.t)('liukui'), type: 'soft', scope: scope }); | ||
stars[yueIndex].push({ name: (0, i18n_1.t)('liuyue'), type: 'soft', scope: scope }); | ||
stars[changIndex].push({ name: (0, i18n_1.t)('liuchang'), type: 'soft', scope: scope }); | ||
stars[quIndex].push({ name: (0, i18n_1.t)('liuqu'), type: 'soft', scope: scope }); | ||
stars[luIndex].push({ name: (0, i18n_1.t)('liulu'), type: 'lucun', scope: scope }); | ||
stars[yangIndex].push({ name: (0, i18n_1.t)('liuyang'), type: 'tough', scope: scope }); | ||
stars[tuoIndex].push({ name: (0, i18n_1.t)('liutuo'), type: 'tough', scope: scope }); | ||
stars[maIndex].push({ name: (0, i18n_1.t)('liuma'), type: 'tianma', scope: scope }); | ||
stars[hongluanIndex].push({ name: (0, i18n_1.t)('liuluan'), type: 'flower', scope: scope }); | ||
stars[tianxiIndex].push({ name: (0, i18n_1.t)('liuxi'), type: 'flower', scope: scope }); | ||
stars[nianjieIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('nianjie'), type: 'helper', scope: 'yearly' })); | ||
stars[kuiIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('liukui'), type: 'soft', scope: scope })); | ||
stars[yueIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('liuyue'), type: 'soft', scope: scope })); | ||
stars[changIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('liuchang'), type: 'soft', scope: scope })); | ||
stars[quIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('liuqu'), type: 'soft', scope: scope })); | ||
stars[luIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('liulu'), type: 'lucun', scope: scope })); | ||
stars[yangIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('liuyang'), type: 'tough', scope: scope })); | ||
stars[tuoIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('liutuo'), type: 'tough', scope: scope })); | ||
stars[maIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('liuma'), type: 'tianma', scope: scope })); | ||
stars[hongluanIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('liuluan'), type: 'flower', scope: scope })); | ||
stars[tianxiIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('liuxi'), type: 'flower', scope: scope })); | ||
} | ||
else { | ||
stars[kuiIndex].push({ name: (0, i18n_1.t)('yunkui'), type: 'soft', scope: scope }); | ||
stars[yueIndex].push({ name: (0, i18n_1.t)('yunyue'), type: 'soft', scope: scope }); | ||
stars[changIndex].push({ name: (0, i18n_1.t)('yunchang'), type: 'soft', scope: scope }); | ||
stars[quIndex].push({ name: (0, i18n_1.t)('yunqu'), type: 'soft', scope: scope }); | ||
stars[luIndex].push({ name: (0, i18n_1.t)('yunlu'), type: 'lucun', scope: scope }); | ||
stars[yangIndex].push({ name: (0, i18n_1.t)('yunyang'), type: 'tough', scope: scope }); | ||
stars[tuoIndex].push({ name: (0, i18n_1.t)('yuntuo'), type: 'tough', scope: scope }); | ||
stars[maIndex].push({ name: (0, i18n_1.t)('yunma'), type: 'tianma', scope: scope }); | ||
stars[hongluanIndex].push({ name: (0, i18n_1.t)('yunluan'), type: 'flower', scope: scope }); | ||
stars[tianxiIndex].push({ name: (0, i18n_1.t)('yunxi'), type: 'flower', scope: scope }); | ||
stars[kuiIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('yunkui'), type: 'soft', scope: scope })); | ||
stars[yueIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('yunyue'), type: 'soft', scope: scope })); | ||
stars[changIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('yunchang'), type: 'soft', scope: scope })); | ||
stars[quIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('yunqu'), type: 'soft', scope: scope })); | ||
stars[luIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('yunlu'), type: 'lucun', scope: scope })); | ||
stars[yangIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('yunyang'), type: 'tough', scope: scope })); | ||
stars[tuoIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('yuntuo'), type: 'tough', scope: scope })); | ||
stars[maIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('yunma'), type: 'tianma', scope: scope })); | ||
stars[hongluanIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('yunluan'), type: 'flower', scope: scope })); | ||
stars[tianxiIndex].push(new FunctionalStar_1.default({ name: (0, i18n_1.t)('yunxi'), type: 'flower', scope: scope })); | ||
} | ||
@@ -49,0 +53,0 @@ return stars; |
@@ -1,3 +0,3 @@ | ||
import { Star } from '../data/types'; | ||
export declare const initStars: () => Star[][]; | ||
import FunctionalStar from './FunctionalStar'; | ||
export declare const initStars: () => FunctionalStar[][]; | ||
export * from './location'; | ||
@@ -4,0 +4,0 @@ export * from './majorStar'; |
@@ -0,1 +1,2 @@ | ||
import FunctionalStar from './FunctionalStar'; | ||
/** | ||
@@ -17,2 +18,2 @@ * 安主星,寅宫下标为0,若下标对应的数组为空数组则表示没有星耀 | ||
*/ | ||
export declare const getMajorStar: (solarDateStr: string, timeIndex: number, fixLeap?: boolean) => import("../data/types").Star[][]; | ||
export declare const getMajorStar: (solarDateStr: string, timeIndex: number, fixLeap?: boolean) => FunctionalStar[][]; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -8,2 +11,3 @@ exports.getMajorStar = void 0; | ||
var utils_1 = require("../utils"); | ||
var FunctionalStar_1 = __importDefault(require("./FunctionalStar")); | ||
var location_1 = require("./location"); | ||
@@ -57,3 +61,3 @@ /** | ||
if (s !== '') { | ||
stars[(0, utils_1.fixIndex)(ziweiIndex - i)].push({ | ||
stars[(0, utils_1.fixIndex)(ziweiIndex - i)].push(new FunctionalStar_1.default({ | ||
name: (0, i18n_1.t)(s), | ||
@@ -64,3 +68,3 @@ type: 'major', | ||
mutagen: (0, utils_1.getMutagen)((0, i18n_1.t)(s), yearly[0]), | ||
}); | ||
})); | ||
} | ||
@@ -70,3 +74,3 @@ }); | ||
if (s !== '') { | ||
stars[(0, utils_1.fixIndex)(tianfuIndex + i)].push({ | ||
stars[(0, utils_1.fixIndex)(tianfuIndex + i)].push(new FunctionalStar_1.default({ | ||
name: (0, i18n_1.t)(s), | ||
@@ -77,3 +81,3 @@ type: 'major', | ||
mutagen: (0, utils_1.getMutagen)((0, i18n_1.t)(s), yearly[0]), | ||
}); | ||
})); | ||
} | ||
@@ -80,0 +84,0 @@ }); |
@@ -0,1 +1,2 @@ | ||
import FunctionalStar from './FunctionalStar'; | ||
/** | ||
@@ -9,2 +10,2 @@ * 安14辅星,寅宫下标为0,若下标对应的数组为空数组则表示没有星耀 | ||
*/ | ||
export declare const getMinorStar: (solarDateStr: string, timeIndex: number, fixLeap?: boolean) => import("../data/types").Star[][]; | ||
export declare const getMinorStar: (solarDateStr: string, timeIndex: number, fixLeap?: boolean) => FunctionalStar[][]; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -8,2 +11,3 @@ exports.getMinorStar = void 0; | ||
var utils_1 = require("../utils"); | ||
var FunctionalStar_1 = __importDefault(require("./FunctionalStar")); | ||
var location_1 = require("./location"); | ||
@@ -29,3 +33,3 @@ /** | ||
var _f = (0, location_1.getLuYangTuoMaIndex)(yearly[0], yearly[1]), luIndex = _f.luIndex, yangIndex = _f.yangIndex, tuoIndex = _f.tuoIndex, maIndex = _f.maIndex; | ||
stars[zuoIndex].push({ | ||
stars[zuoIndex].push(new FunctionalStar_1.default({ | ||
name: (0, i18n_1.t)('zuofuMin'), | ||
@@ -36,4 +40,4 @@ type: 'soft', | ||
mutagen: (0, utils_1.getMutagen)('左辅', yearly[0]), | ||
}); | ||
stars[youIndex].push({ | ||
})); | ||
stars[youIndex].push(new FunctionalStar_1.default({ | ||
name: (0, i18n_1.t)('youbiMin'), | ||
@@ -44,4 +48,4 @@ type: 'soft', | ||
mutagen: (0, utils_1.getMutagen)('右弼', yearly[0]), | ||
}); | ||
stars[changIndex].push({ | ||
})); | ||
stars[changIndex].push(new FunctionalStar_1.default({ | ||
name: (0, i18n_1.t)('wenchangMin'), | ||
@@ -52,4 +56,4 @@ type: 'soft', | ||
mutagen: (0, utils_1.getMutagen)('文昌', yearly[0]), | ||
}); | ||
stars[quIndex].push({ | ||
})); | ||
stars[quIndex].push(new FunctionalStar_1.default({ | ||
name: (0, i18n_1.t)('wenquMin'), | ||
@@ -60,4 +64,4 @@ type: 'soft', | ||
mutagen: (0, utils_1.getMutagen)('文曲', yearly[0]), | ||
}); | ||
stars[kuiIndex].push({ | ||
})); | ||
stars[kuiIndex].push(new FunctionalStar_1.default({ | ||
name: (0, i18n_1.t)('tiankuiMin'), | ||
@@ -67,4 +71,4 @@ type: 'soft', | ||
brightness: (0, utils_1.getBrightness)('天魁', kuiIndex), | ||
}); | ||
stars[yueIndex].push({ | ||
})); | ||
stars[yueIndex].push(new FunctionalStar_1.default({ | ||
name: (0, i18n_1.t)('tianyueMin'), | ||
@@ -74,4 +78,4 @@ type: 'soft', | ||
brightness: (0, utils_1.getBrightness)('天钺', yueIndex), | ||
}); | ||
stars[luIndex].push({ | ||
})); | ||
stars[luIndex].push(new FunctionalStar_1.default({ | ||
name: (0, i18n_1.t)('lucunMin'), | ||
@@ -81,4 +85,4 @@ type: 'lucun', | ||
brightness: (0, utils_1.getBrightness)('禄存', luIndex), | ||
}); | ||
stars[maIndex].push({ | ||
})); | ||
stars[maIndex].push(new FunctionalStar_1.default({ | ||
name: (0, i18n_1.t)('tianmaMin'), | ||
@@ -88,4 +92,4 @@ type: 'tianma', | ||
brightness: (0, utils_1.getBrightness)('天马', maIndex), | ||
}); | ||
stars[kongIndex].push({ | ||
})); | ||
stars[kongIndex].push(new FunctionalStar_1.default({ | ||
name: (0, i18n_1.t)('dikongMin'), | ||
@@ -95,4 +99,4 @@ type: 'tough', | ||
brightness: (0, utils_1.getBrightness)('地空', kongIndex), | ||
}); | ||
stars[jieIndex].push({ | ||
})); | ||
stars[jieIndex].push(new FunctionalStar_1.default({ | ||
name: (0, i18n_1.t)('dijieMin'), | ||
@@ -102,4 +106,4 @@ type: 'tough', | ||
brightness: (0, utils_1.getBrightness)('地劫', jieIndex), | ||
}); | ||
stars[huoIndex].push({ | ||
})); | ||
stars[huoIndex].push(new FunctionalStar_1.default({ | ||
name: (0, i18n_1.t)('huoxingMin'), | ||
@@ -109,4 +113,4 @@ type: 'tough', | ||
brightness: (0, utils_1.getBrightness)('火星', huoIndex), | ||
}); | ||
stars[lingIndex].push({ | ||
})); | ||
stars[lingIndex].push(new FunctionalStar_1.default({ | ||
name: (0, i18n_1.t)('lingxingMin'), | ||
@@ -116,4 +120,4 @@ type: 'tough', | ||
brightness: (0, utils_1.getBrightness)('铃星', lingIndex), | ||
}); | ||
stars[yangIndex].push({ | ||
})); | ||
stars[yangIndex].push(new FunctionalStar_1.default({ | ||
name: (0, i18n_1.t)('qingyangMin'), | ||
@@ -123,4 +127,4 @@ type: 'tough', | ||
brightness: (0, utils_1.getBrightness)('擎羊', yangIndex), | ||
}); | ||
stars[tuoIndex].push({ | ||
})); | ||
stars[tuoIndex].push(new FunctionalStar_1.default({ | ||
name: (0, i18n_1.t)('tuoluoMin'), | ||
@@ -130,5 +134,5 @@ type: 'tough', | ||
brightness: (0, utils_1.getBrightness)('陀罗', tuoIndex), | ||
}); | ||
})); | ||
return stars; | ||
}; | ||
exports.getMinorStar = getMinorStar; |
import { Brightness, EarthlyBranchName, HeavenlyStemName, Mutagen, StarName } from '../i18n'; | ||
import { Star } from '../data/types'; | ||
import FunctionalStar from '../star/FunctionalStar'; | ||
/** | ||
@@ -60,6 +60,6 @@ * 用于处理索引,将索引锁定在 0~max 范围内 | ||
* | ||
* @param {Star[][][]} stars 星耀数组 | ||
* @returns {Star[][]} 合并后的星耀 | ||
* @param {FunctionalStar[][][]} stars 星耀数组 | ||
* @returns {FunctionalStar[][]} 合并后的星耀 | ||
*/ | ||
export declare const mergeStars: (...stars: Star[][][]) => Star[][]; | ||
export declare const mergeStars: (...stars: FunctionalStar[][][]) => FunctionalStar[][]; | ||
/** | ||
@@ -66,0 +66,0 @@ * 将时间的小时转化为时辰的索引 |
@@ -123,4 +123,4 @@ "use strict"; | ||
* | ||
* @param {Star[][][]} stars 星耀数组 | ||
* @returns {Star[][]} 合并后的星耀 | ||
* @param {FunctionalStar[][][]} stars 星耀数组 | ||
* @returns {FunctionalStar[][]} 合并后的星耀 | ||
*/ | ||
@@ -127,0 +127,0 @@ var mergeStars = function () { |
{ | ||
"name": "iztro", | ||
"version": "1.3.3", | ||
"version": "1.3.4", | ||
"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", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
460802
12129