Добавлена ДБ

This commit is contained in:
Georgiy Syralev
2025-09-15 18:10:26 +03:00
parent 253ad8c19b
commit c954b5268e
5824 changed files with 1107594 additions and 19141 deletions

20
node_modules/fast-check/lib/esm/arbitrary/date.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
import { safeGetTime } from '../utils/globals.js';
import { integer } from './integer.js';
import { timeToDateMapper, timeToDateMapperWithNaN, timeToDateUnmapper, timeToDateUnmapperWithNaN, } from './_internals/mappers/TimeToDate.js';
const safeNumberIsNaN = Number.isNaN;
export function date(constraints = {}) {
const intMin = constraints.min !== undefined ? safeGetTime(constraints.min) : -8640000000000000;
const intMax = constraints.max !== undefined ? safeGetTime(constraints.max) : 8640000000000000;
const noInvalidDate = constraints.noInvalidDate === undefined || constraints.noInvalidDate;
if (safeNumberIsNaN(intMin))
throw new Error('fc.date min must be valid instance of Date');
if (safeNumberIsNaN(intMax))
throw new Error('fc.date max must be valid instance of Date');
if (intMin > intMax)
throw new Error('fc.date max must be greater or equal to min');
if (noInvalidDate) {
return integer({ min: intMin, max: intMax }).map(timeToDateMapper, timeToDateUnmapper);
}
const valueForNaN = intMax + 1;
return integer({ min: intMin, max: intMax + 1 }).map(timeToDateMapperWithNaN(valueForNaN), timeToDateUnmapperWithNaN(valueForNaN));
}