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

@naturalcycles/js-lib

Package Overview
Dependencies
Maintainers
2
Versions
525
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@naturalcycles/js-lib - npm Package Compare versions

Comparing version 14.237.0 to 14.238.0

12

dist-esm/datetime/localDate.js

@@ -108,2 +108,14 @@ import { _assert } from '../error/assert';

}
getAgeInYears(today) {
return this.getAgeIn('year', today);
}
getAgeInMonths(today) {
return this.getAgeIn('month', today);
}
getAgeInDays(today) {
return this.getAgeIn('day', today);
}
getAgeIn(unit, today) {
return localDate.of(today || new Date()).diff(this, unit);
}
/**

@@ -110,0 +122,0 @@ * Returns 1 if this > d

@@ -418,2 +418,23 @@ import { _assert } from '../error/assert';

}
getAgeInYears(now) {
return this.getAgeIn('year', now);
}
getAgeInMonths(now) {
return this.getAgeIn('month', now);
}
getAgeInDays(now) {
return this.getAgeIn('day', now);
}
getAgeInHours(now) {
return this.getAgeIn('hour', now);
}
getAgeInMinutes(now) {
return this.getAgeIn('minute', now);
}
getAgeInSeconds(now) {
return this.getAgeIn('second', now);
}
getAgeIn(unit, now) {
return localTime.of(now ?? new Date()).diff(this, unit);
}
/**

@@ -420,0 +441,0 @@ * Returns 1 if this > d

4

dist/datetime/localDate.d.ts

@@ -60,2 +60,6 @@ import { Iterable2 } from '../iter/iterable2';

isSameOrYoungerThan(n: number, unit: LocalDateUnit, today?: LocalDateInput): boolean;
getAgeInYears(today?: LocalDateInput): number;
getAgeInMonths(today?: LocalDateInput): number;
getAgeInDays(today?: LocalDateInput): number;
getAgeIn(unit: LocalDateUnit, today?: LocalDateInput): number;
/**

@@ -62,0 +66,0 @@ * Returns 1 if this > d

@@ -111,2 +111,14 @@ "use strict";

}
getAgeInYears(today) {
return this.getAgeIn('year', today);
}
getAgeInMonths(today) {
return this.getAgeIn('month', today);
}
getAgeInDays(today) {
return this.getAgeIn('day', today);
}
getAgeIn(unit, today) {
return exports.localDate.of(today || new Date()).diff(this, unit);
}
/**

@@ -113,0 +125,0 @@ * Returns 1 if this > d

@@ -166,2 +166,9 @@ import type { Inclusiveness, IsoDateString, IsoDateTimeString, MonthId, NumberOfHours, NumberOfMinutes, SortDirection, UnixTimestampMillisNumber, UnixTimestampNumber } from '../types';

isSameOrYoungerThan(n: number, unit: LocalTimeUnit, now?: LocalTimeInput): boolean;
getAgeInYears(now?: LocalTimeInput): number;
getAgeInMonths(now?: LocalTimeInput): number;
getAgeInDays(now?: LocalTimeInput): number;
getAgeInHours(now?: LocalTimeInput): number;
getAgeInMinutes(now?: LocalTimeInput): number;
getAgeInSeconds(now?: LocalTimeInput): number;
getAgeIn(unit: LocalTimeUnit, now?: LocalTimeInput): number;
/**

@@ -168,0 +175,0 @@ * Returns 1 if this > d

@@ -421,2 +421,23 @@ "use strict";

}
getAgeInYears(now) {
return this.getAgeIn('year', now);
}
getAgeInMonths(now) {
return this.getAgeIn('month', now);
}
getAgeInDays(now) {
return this.getAgeIn('day', now);
}
getAgeInHours(now) {
return this.getAgeIn('hour', now);
}
getAgeInMinutes(now) {
return this.getAgeIn('minute', now);
}
getAgeInSeconds(now) {
return this.getAgeIn('second', now);
}
getAgeIn(unit, now) {
return exports.localTime.of(now ?? new Date()).diff(this, unit);
}
/**

@@ -423,0 +444,0 @@ * Returns 1 if this > d

2

package.json
{
"name": "@naturalcycles/js-lib",
"version": "14.237.0",
"version": "14.238.0",
"scripts": {

@@ -5,0 +5,0 @@ "prepare": "husky",

@@ -144,2 +144,15 @@ import { _assert } from '../error/assert'

getAgeInYears(today?: LocalDateInput): number {
return this.getAgeIn('year', today)
}
getAgeInMonths(today?: LocalDateInput): number {
return this.getAgeIn('month', today)
}
getAgeInDays(today?: LocalDateInput): number {
return this.getAgeIn('day', today)
}
getAgeIn(unit: LocalDateUnit, today?: LocalDateInput): number {
return localDate.of(today || new Date()).diff(this, unit)
}
/**

@@ -146,0 +159,0 @@ * Returns 1 if this > d

@@ -503,2 +503,24 @@ import { _assert } from '../error/assert'

getAgeInYears(now?: LocalTimeInput): number {
return this.getAgeIn('year', now)
}
getAgeInMonths(now?: LocalTimeInput): number {
return this.getAgeIn('month', now)
}
getAgeInDays(now?: LocalTimeInput): number {
return this.getAgeIn('day', now)
}
getAgeInHours(now?: LocalTimeInput): number {
return this.getAgeIn('hour', now)
}
getAgeInMinutes(now?: LocalTimeInput): number {
return this.getAgeIn('minute', now)
}
getAgeInSeconds(now?: LocalTimeInput): number {
return this.getAgeIn('second', now)
}
getAgeIn(unit: LocalTimeUnit, now?: LocalTimeInput): number {
return localTime.of(now ?? new Date()).diff(this, unit)
}
/**

@@ -505,0 +527,0 @@ * Returns 1 if this > d

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