Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
15 lines
348 B
Plaintext
15 lines
348 B
Plaintext
import { isNumber } from "./isNumber.mjs";
|
|
import { isValidDate } from "./isValidDate.mjs";
|
|
function isLeapYear(value) {
|
|
let year = value;
|
|
if (isValidDate(value)) {
|
|
year = value.getFullYear();
|
|
} else if (!isNumber(value)) {
|
|
return false;
|
|
}
|
|
return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
|
|
}
|
|
export {
|
|
isLeapYear
|
|
};
|