Initial commit

This commit is contained in:
Brian McGonagill 2026-03-18 09:02:21 -05:00
commit b3a51a4115
10336 changed files with 2381973 additions and 0 deletions

View file

@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.timeToDateMapper = timeToDateMapper;
exports.timeToDateUnmapper = timeToDateUnmapper;
exports.timeToDateMapperWithNaN = timeToDateMapperWithNaN;
exports.timeToDateUnmapperWithNaN = timeToDateUnmapperWithNaN;
const globals_1 = require("../../../utils/globals");
const safeNaN = Number.NaN;
const safeNumberIsNaN = Number.isNaN;
function timeToDateMapper(time) {
return new globals_1.Date(time);
}
function timeToDateUnmapper(value) {
if (!(value instanceof globals_1.Date) || value.constructor !== globals_1.Date) {
throw new globals_1.Error('Not a valid value for date unmapper');
}
return (0, globals_1.safeGetTime)(value);
}
function timeToDateMapperWithNaN(valueForNaN) {
return (time) => {
return time === valueForNaN ? new globals_1.Date(safeNaN) : timeToDateMapper(time);
};
}
function timeToDateUnmapperWithNaN(valueForNaN) {
return (value) => {
const time = timeToDateUnmapper(value);
return safeNumberIsNaN(time) ? valueForNaN : time;
};
}