Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lunar-lite

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lunar-lite - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

2

lib/convertor.js

@@ -29,3 +29,3 @@ "use strict";

.reduce(function (prev, next) { return prev.concat(next); }, [])
.map(function (item) { return +item; });
.map(function (item) { return Math.abs(+item); });
};

@@ -32,0 +32,0 @@ exports.normalizeDateStr = normalizeDateStr;

@@ -15,3 +15,3 @@ "use strict";

var getHeavenlyStemAndEarthlyBranchByLunarDate = function (dateStr, timeIndex, isLeap, options) {
if (options === void 0) { options = { year: 'normal' }; }
if (options === void 0) { options = { year: "normal" }; }
var solarDate = (0, convertor_1.lunar2solar)(dateStr, isLeap);

@@ -29,8 +29,12 @@ return (0, exports.getHeavenlyStemAndEarthlyBranchBySolarDate)(solarDate.toString(), timeIndex, options);

var getHeavenlyStemAndEarthlyBranchBySolarDate = function (dateStr, timeIndex, options) {
if (options === void 0) { options = { year: 'exact' }; }
if (options === void 0) { options = { year: "exact" }; }
var _a = (0, convertor_1.normalizeDateStr)(dateStr), year = _a[0], month = _a[1], date = _a[2];
var solar = lunar_typescript_1.Solar.fromYmdHms(year, month, date, Math.max(timeIndex * 2 - 1, 0), 30, 0);
var lunar = solar.getLunar();
var yearlyGan = (options === null || options === void 0 ? void 0 : options.year) === 'normal' ? lunar.getYearGan() : lunar.getYearGanByLiChun();
var yearlyZhi = (options === null || options === void 0 ? void 0 : options.year) === 'normal' ? lunar.getYearZhi() : lunar.getYearZhiByLiChun();
var yearlyGan = (options === null || options === void 0 ? void 0 : options.year) === "normal"
? lunar.getYearGan()
: lunar.getYearGanByLiChun();
var yearlyZhi = (options === null || options === void 0 ? void 0 : options.year) === "normal"
? lunar.getYearZhi()
: lunar.getYearZhiByLiChun();
var yearly = [

@@ -37,0 +41,0 @@ yearlyGan,

@@ -95,3 +95,3 @@ import { EARTHLY_BRANCHES, HEAVENLY_STEMS } from "./constants";

/** exact:立春分界,normal:除夕分界 */
year: 'exact' | 'normal';
year: "exact" | "normal";
};
{
"name": "lunar-lite",
"version": "0.2.1",
"version": "0.2.2",
"description": "精简版的农历和阳历日期转换库。",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc