New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@axah/js-utils

Package Overview
Dependencies
Maintainers
10
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@axah/js-utils - npm Package Compare versions

Comparing version

to
1.8.3

2

lib/age/age.d.ts

@@ -1,2 +0,2 @@

export declare const getAge: (dateString: string, today?: Date) => number;
export declare const getAge: (birthDate: string | Date, today?: Date) => number;
export declare function isChild(age: number): boolean;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isChild = exports.getAge = void 0;
const getAge = (dateString, today = new Date()) => {
const birthDate = new Date(dateString);
let age = today.getFullYear() - birthDate.getFullYear();
const month = today.getMonth() - birthDate.getMonth();
if (month < 0 || (month === 0 && today.getDate() < birthDate.getDate())) {
const getAge = (birthDate, today = new Date()) => {
let birthDateToUse;
if (typeof birthDate === 'string') {
birthDateToUse = new Date(birthDate);
}
else {
birthDateToUse = birthDate;
}
let age = today.getFullYear() - birthDateToUse.getFullYear();
const month = today.getMonth() - birthDateToUse.getMonth();
if (month < 0 || (month === 0 && today.getDate() < birthDateToUse.getDate())) {
age -= 1;

@@ -10,0 +16,0 @@ }

{
"name": "@axah/js-utils",
"version": "1.8.2",
"version": "1.8.3",
"description": "",

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

Sorry, the diff of this file is not supported yet