@duplojs/utils 1.3.29 → 1.3.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/clean/entity.d.ts +2 -2
- package/dist/clean/flag.cjs +4 -0
- package/dist/clean/flag.d.ts +1 -0
- package/dist/clean/flag.mjs +4 -0
- package/dist/clean/index.cjs +15 -0
- package/dist/clean/index.d.ts +1 -0
- package/dist/clean/index.mjs +8 -1
- package/dist/clean/newType.d.ts +2 -2
- package/dist/clean/primitive/base.cjs +3 -0
- package/dist/clean/primitive/base.d.ts +4 -2
- package/dist/clean/primitive/base.mjs +3 -1
- package/dist/clean/primitive/operations/date/dateAddTime.cjs +16 -0
- package/dist/clean/primitive/operations/date/dateAddTime.d.ts +4 -0
- package/dist/clean/primitive/operations/date/dateAddTime.mjs +14 -0
- package/dist/clean/primitive/operations/date/dateMax.cjs +1 -5
- package/dist/clean/primitive/operations/date/dateMax.d.ts +1 -2
- package/dist/clean/primitive/operations/date/dateMax.mjs +1 -5
- package/dist/clean/primitive/operations/date/dateMin.cjs +1 -5
- package/dist/clean/primitive/operations/date/dateMin.d.ts +1 -2
- package/dist/clean/primitive/operations/date/dateMin.mjs +1 -5
- package/dist/clean/primitive/operations/date/dateSubtractTime.cjs +16 -0
- package/dist/clean/primitive/operations/date/dateSubtractTime.d.ts +4 -0
- package/dist/clean/primitive/operations/date/dateSubtractTime.mjs +14 -0
- package/dist/clean/primitive/operations/date/index.d.ts +2 -4
- package/dist/clean/primitive/operations/equal.d.ts +3 -3
- package/dist/clean/primitive/operations/index.d.ts +1 -0
- package/dist/clean/primitive/operations/sort.cjs +6 -0
- package/dist/clean/primitive/operations/sort.d.ts +4 -8
- package/dist/clean/primitive/operations/sort.mjs +6 -0
- package/dist/clean/primitive/operations/time/index.d.ts +4 -0
- package/dist/clean/primitive/operations/time/timeGreaterThan.cjs +15 -0
- package/dist/clean/primitive/operations/time/timeGreaterThan.d.ts +4 -0
- package/dist/clean/primitive/operations/time/timeGreaterThan.mjs +13 -0
- package/dist/clean/primitive/operations/time/timeLessThan.cjs +15 -0
- package/dist/clean/primitive/operations/time/timeLessThan.d.ts +4 -0
- package/dist/clean/primitive/operations/time/timeLessThan.mjs +13 -0
- package/dist/clean/primitive/operations/time/timeMax.cjs +12 -0
- package/dist/clean/primitive/operations/time/timeMax.d.ts +4 -0
- package/dist/clean/primitive/operations/time/timeMax.mjs +10 -0
- package/dist/clean/primitive/operations/time/timeMin.cjs +12 -0
- package/dist/clean/primitive/operations/time/timeMin.d.ts +4 -0
- package/dist/clean/primitive/operations/time/timeMin.mjs +10 -0
- package/dist/clean/unwrapEntity.cjs +26 -0
- package/dist/clean/unwrapEntity.d.ts +13 -0
- package/dist/clean/unwrapEntity.mjs +24 -0
- package/dist/common/index.d.ts +2 -0
- package/dist/common/override.cjs +38 -17
- package/dist/common/override.d.ts +5 -8
- package/dist/common/override.mjs +38 -17
- package/dist/common/pipeCall.cjs +7 -0
- package/dist/common/pipeCall.d.ts +1 -0
- package/dist/common/pipeCall.mjs +5 -0
- package/dist/common/toCurriedPredicate.cjs +7 -0
- package/dist/common/toCurriedPredicate.d.ts +1 -0
- package/dist/common/toCurriedPredicate.mjs +5 -0
- package/dist/common/toWrappedValue.d.ts +2 -1
- package/dist/common/types/DeepReadonly.d.ts +3 -0
- package/dist/common/types/index.d.ts +1 -0
- package/dist/dataParser/extended/coerce/index.cjs +2 -0
- package/dist/dataParser/extended/coerce/index.d.ts +1 -0
- package/dist/dataParser/extended/coerce/index.mjs +1 -0
- package/dist/dataParser/extended/coerce/time.cjs +12 -0
- package/dist/dataParser/extended/coerce/time.d.ts +7 -0
- package/dist/dataParser/extended/coerce/time.mjs +10 -0
- package/dist/dataParser/extended/index.cjs +2 -0
- package/dist/dataParser/extended/index.d.ts +1 -0
- package/dist/dataParser/extended/index.mjs +1 -0
- package/dist/dataParser/extended/object.cjs +5 -0
- package/dist/dataParser/extended/object.d.ts +4 -0
- package/dist/dataParser/extended/object.mjs +5 -0
- package/dist/dataParser/extended/time.cjs +22 -0
- package/dist/dataParser/extended/time.d.ts +34 -0
- package/dist/dataParser/extended/time.mjs +20 -0
- package/dist/dataParser/identifier.d.ts +10 -4
- package/dist/dataParser/index.cjs +36 -24
- package/dist/dataParser/index.mjs +4 -0
- package/dist/dataParser/parsers/coerce/index.cjs +2 -0
- package/dist/dataParser/parsers/coerce/index.d.ts +1 -0
- package/dist/dataParser/parsers/coerce/index.mjs +1 -0
- package/dist/dataParser/parsers/coerce/time.cjs +12 -0
- package/dist/dataParser/parsers/coerce/time.d.ts +6 -0
- package/dist/dataParser/parsers/coerce/time.mjs +10 -0
- package/dist/dataParser/parsers/date.cjs +6 -12
- package/dist/dataParser/parsers/date.mjs +6 -12
- package/dist/dataParser/parsers/index.d.ts +1 -0
- package/dist/dataParser/parsers/literal.d.ts +2 -2
- package/dist/dataParser/parsers/object/extends.cjs +15 -0
- package/dist/dataParser/parsers/object/extends.d.ts +9 -0
- package/dist/dataParser/parsers/object/extends.mjs +12 -0
- package/dist/dataParser/parsers/object/index.d.ts +1 -0
- package/dist/dataParser/parsers/time/checkers/index.d.ts +2 -0
- package/dist/dataParser/parsers/time/checkers/max.cjs +19 -0
- package/dist/dataParser/parsers/time/checkers/max.d.ts +12 -0
- package/dist/dataParser/parsers/time/checkers/max.mjs +16 -0
- package/dist/dataParser/parsers/time/checkers/min.cjs +19 -0
- package/dist/dataParser/parsers/time/checkers/min.d.ts +12 -0
- package/dist/dataParser/parsers/time/checkers/min.mjs +16 -0
- package/dist/dataParser/parsers/time/index.cjs +47 -0
- package/dist/dataParser/parsers/time/index.d.ts +33 -0
- package/dist/dataParser/parsers/time/index.mjs +44 -0
- package/dist/dataParser/types/checkers.d.ts +1 -1
- package/dist/dataParser/types/dataParsers.d.ts +2 -2
- package/dist/date/applyTimezone.cjs +17 -0
- package/dist/date/applyTimezone.d.ts +4 -0
- package/dist/date/applyTimezone.mjs +15 -0
- package/dist/date/constants.cjs +13 -3
- package/dist/date/constants.d.ts +6 -1
- package/dist/date/constants.mjs +9 -4
- package/dist/date/create.cjs +62 -29
- package/dist/date/create.d.ts +10 -6
- package/dist/date/create.mjs +60 -27
- package/dist/date/createOrThrow.cjs +4 -1
- package/dist/date/createOrThrow.d.ts +5 -4
- package/dist/date/createOrThrow.mjs +4 -1
- package/dist/date/createTheDate.cjs +10 -0
- package/dist/date/createTheDate.d.ts +2 -0
- package/dist/date/createTheDate.mjs +8 -0
- package/dist/date/createTheTime.cjs +10 -0
- package/dist/date/createTheTime.d.ts +2 -0
- package/dist/date/createTheTime.mjs +8 -0
- package/dist/date/createTime.cjs +61 -0
- package/dist/date/createTime.d.ts +44 -0
- package/dist/date/createTime.mjs +59 -0
- package/dist/date/createTimeOrThrow.cjs +28 -0
- package/dist/date/createTimeOrThrow.d.ts +10 -0
- package/dist/date/createTimeOrThrow.mjs +25 -0
- package/dist/date/format.cjs +37 -0
- package/dist/date/format.d.ts +4 -0
- package/dist/date/format.mjs +35 -0
- package/dist/date/getTimezoneOffset.cjs +27 -0
- package/dist/date/getTimezoneOffset.d.ts +4 -0
- package/dist/date/getTimezoneOffset.mjs +25 -0
- package/dist/date/getters/getDayOfYear.cjs +2 -1
- package/dist/date/getters/getDayOfYear.mjs +2 -1
- package/dist/date/index.cjs +51 -2
- package/dist/date/index.d.ts +15 -0
- package/dist/date/index.mjs +25 -3
- package/dist/date/is.cjs +9 -1
- package/dist/date/is.mjs +9 -1
- package/dist/date/isSafeTimeValue.cjs +15 -0
- package/dist/date/isSafeTimeValue.d.ts +1 -0
- package/dist/date/isSafeTimeValue.mjs +13 -0
- package/dist/date/isSafeTimestamp.cjs +3 -3
- package/dist/date/isSafeTimestamp.d.ts +1 -1
- package/dist/date/isSafeTimestamp.mjs +3 -3
- package/dist/date/isTime.cjs +17 -0
- package/dist/date/isTime.d.ts +2 -0
- package/dist/date/isTime.mjs +15 -0
- package/dist/date/makeSafeTimeValue.cjs +20 -0
- package/dist/date/makeSafeTimeValue.d.ts +1 -0
- package/dist/date/makeSafeTimeValue.mjs +18 -0
- package/dist/date/makeSafeTimestamp.cjs +20 -0
- package/dist/date/makeSafeTimestamp.d.ts +1 -0
- package/dist/date/makeSafeTimestamp.mjs +18 -0
- package/dist/date/maxTime.cjs +10 -0
- package/dist/date/maxTime.d.ts +3 -0
- package/dist/date/maxTime.mjs +8 -0
- package/dist/date/minTime.cjs +10 -0
- package/dist/date/minTime.d.ts +3 -0
- package/dist/date/minTime.mjs +8 -0
- package/dist/date/operators/addDays.cjs +2 -3
- package/dist/date/operators/addDays.mjs +2 -3
- package/dist/date/operators/addHours.cjs +2 -3
- package/dist/date/operators/addHours.mjs +2 -3
- package/dist/date/operators/addMilliseconds.cjs +2 -3
- package/dist/date/operators/addMilliseconds.mjs +2 -3
- package/dist/date/operators/addMinutes.cjs +2 -3
- package/dist/date/operators/addMinutes.mjs +2 -3
- package/dist/date/operators/addMonths.cjs +2 -3
- package/dist/date/operators/addMonths.mjs +2 -3
- package/dist/date/operators/addSeconds.cjs +2 -3
- package/dist/date/operators/addSeconds.mjs +2 -3
- package/dist/date/operators/addTime.cjs +21 -0
- package/dist/date/operators/addTime.d.ts +5 -0
- package/dist/date/operators/addTime.mjs +19 -0
- package/dist/date/operators/addWeeks.cjs +2 -3
- package/dist/date/operators/addWeeks.mjs +2 -3
- package/dist/date/operators/addYears.cjs +2 -3
- package/dist/date/operators/addYears.mjs +2 -3
- package/dist/date/operators/betweenThanTime.cjs +17 -0
- package/dist/date/operators/betweenThanTime.d.ts +3 -0
- package/dist/date/operators/betweenThanTime.mjs +15 -0
- package/dist/date/operators/betweenTime.cjs +17 -0
- package/dist/date/operators/betweenTime.d.ts +3 -0
- package/dist/date/operators/betweenTime.mjs +15 -0
- package/dist/date/operators/greaterThanTime.cjs +16 -0
- package/dist/date/operators/greaterThanTime.d.ts +3 -0
- package/dist/date/operators/greaterThanTime.mjs +14 -0
- package/dist/date/operators/greaterTime.cjs +16 -0
- package/dist/date/operators/greaterTime.d.ts +3 -0
- package/dist/date/operators/greaterTime.mjs +14 -0
- package/dist/date/operators/index.d.ts +8 -0
- package/dist/date/operators/lessThanTime.cjs +16 -0
- package/dist/date/operators/lessThanTime.d.ts +3 -0
- package/dist/date/operators/lessThanTime.mjs +14 -0
- package/dist/date/operators/lessTime.cjs +16 -0
- package/dist/date/operators/lessTime.d.ts +3 -0
- package/dist/date/operators/lessTime.mjs +14 -0
- package/dist/date/operators/subtractDays.cjs +2 -3
- package/dist/date/operators/subtractDays.mjs +2 -3
- package/dist/date/operators/subtractHours.cjs +2 -3
- package/dist/date/operators/subtractHours.mjs +2 -3
- package/dist/date/operators/subtractMilliseconds.cjs +2 -3
- package/dist/date/operators/subtractMilliseconds.mjs +2 -3
- package/dist/date/operators/subtractMinutes.cjs +2 -3
- package/dist/date/operators/subtractMinutes.mjs +2 -3
- package/dist/date/operators/subtractMonths.cjs +2 -3
- package/dist/date/operators/subtractMonths.mjs +2 -3
- package/dist/date/operators/subtractSeconds.cjs +2 -3
- package/dist/date/operators/subtractSeconds.mjs +2 -3
- package/dist/date/operators/subtractTime.cjs +21 -0
- package/dist/date/operators/subtractTime.d.ts +5 -0
- package/dist/date/operators/subtractTime.mjs +19 -0
- package/dist/date/operators/subtractWeeks.cjs +2 -3
- package/dist/date/operators/subtractWeeks.mjs +2 -3
- package/dist/date/operators/subtractYears.cjs +2 -3
- package/dist/date/operators/subtractYears.mjs +2 -3
- package/dist/date/sortTimes.cjs +20 -0
- package/dist/date/sortTimes.d.ts +4 -0
- package/dist/date/sortTimes.mjs +18 -0
- package/dist/date/{types/timezone.cjs → timezone.cjs} +1 -1
- package/dist/date/{types/timezone.d.ts → timezone.d.ts} +1 -1
- package/dist/date/{types/timezone.mjs → timezone.mjs} +1 -1
- package/dist/date/toTimeValue.cjs +14 -0
- package/dist/date/toTimeValue.d.ts +2 -0
- package/dist/date/toTimeValue.mjs +12 -0
- package/dist/date/toTimestamp.cjs +6 -21
- package/dist/date/toTimestamp.d.ts +0 -8
- package/dist/date/toTimestamp.mjs +8 -22
- package/dist/date/types/index.d.ts +3 -1
- package/dist/date/types/isSafeYear.d.ts +5 -52
- package/dist/date/types/spoolingDate.d.ts +12 -0
- package/dist/date/types/spoolingTime.d.ts +9 -0
- package/dist/date/types/theTime.d.ts +1 -0
- package/dist/index.cjs +4 -0
- package/dist/index.mjs +2 -0
- package/dist/metadata.json +401 -5
- package/dist/number/types/index.d.ts +2 -0
- package/dist/number/types/isGreater.d.ts +50 -0
- package/dist/number/types/isLess.d.ts +3 -0
- package/dist/object/hasKeys.d.ts +2 -2
- package/dist/object/types/forbiddenKey.d.ts +6 -0
- package/dist/object/types/index.d.ts +1 -0
- package/dist/string/types/index.d.ts +1 -0
- package/dist/string/types/replace.d.ts +1 -0
- package/package.json +1 -1
package/dist/clean/entity.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export interface EntityHandler<GenericName extends string = string, GenericPrope
|
|
|
40
40
|
readonly name: GenericName;
|
|
41
41
|
readonly propertiesDefinition: GenericPropertiesDefinition;
|
|
42
42
|
readonly mapDataParser: DDataParser.Contract<EntityProperties<GenericPropertiesDefinition>, EntityRawProperties<GenericPropertiesDefinition>>;
|
|
43
|
-
"new"<GenericProperties extends EntityProperties<GenericPropertiesDefinition>>(properties: GenericProperties): Entity<GenericName> & GenericProperties;
|
|
43
|
+
"new"<const GenericProperties extends EntityProperties<GenericPropertiesDefinition>>(properties: GenericProperties): Entity<GenericName> & GenericProperties;
|
|
44
44
|
map(rawProperties: EntityRawProperties<GenericPropertiesDefinition>): (DEither.EitherRight<"createEntity", Entity<GenericName> & EntityProperties<GenericPropertiesDefinition>> | DEither.EitherLeft<"createEntityError", DDataParser.DataParserError>);
|
|
45
45
|
mapOrThrow(rawProperties: EntityRawProperties<GenericPropertiesDefinition>): Entity<GenericName> & EntityProperties<GenericPropertiesDefinition>;
|
|
46
46
|
is<GenericInput extends unknown>(input: GenericInput): input is Extract<GenericInput, Entity<GenericName>>;
|
|
@@ -70,6 +70,6 @@ export interface PropertiesDefinitionParams {
|
|
|
70
70
|
inArray: NeverCoalescing<GenericAdvancedArrayPropertyDefinition, true>;
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
|
-
export declare function createEntity<GenericName extends string, const GenericPropertiesDefinition extends EntityPropertiesDefinition>(name: GenericName, getPropertiesDefinition: (params: PropertiesDefinitionParams) => GenericPropertiesDefinition): EntityHandler<GenericName, GenericPropertiesDefinition>;
|
|
73
|
+
export declare function createEntity<GenericName extends string, const GenericPropertiesDefinition extends EntityPropertiesDefinition>(name: GenericName, getPropertiesDefinition: (params: PropertiesDefinitionParams) => GenericPropertiesDefinition & DObject.ForbiddenKey<GenericPropertiesDefinition, "_entityName" | "_flags">): EntityHandler<GenericName, GenericPropertiesDefinition>;
|
|
74
74
|
export type GetEntity<GenericEntityHandler extends EntityHandler<string, any>> = Extract<ReturnType<GenericEntityHandler["new"]>, any>;
|
|
75
75
|
export {};
|
package/dist/clean/flag.cjs
CHANGED
package/dist/clean/flag.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export interface FlagHandler<GenericEntity extends Entity = Entity, GenericName
|
|
|
6
6
|
readonly name: GenericName;
|
|
7
7
|
append<GenericInputEntity extends GenericEntity, GenericInputValue extends GenericValue>(entity: GenericInputEntity, ...args: IsEqual<GenericValue, never> extends true ? [] : [GenericInputValue]): (GenericInputEntity & Flag<GenericName, GenericInputValue>);
|
|
8
8
|
getValue<GenericInputEntity extends GenericEntity & Flag<GenericName, GenericValue>>(entity: GenericInputEntity): GetKindValue<typeof flagKind, GenericInputEntity>[GenericName];
|
|
9
|
+
has<GenericInputEntity extends GenericEntity>(entity: GenericInputEntity): Extract<GenericInputEntity, Flag<GenericName, any>>;
|
|
9
10
|
}
|
|
10
11
|
export interface Flag<GenericName extends string = string, GenericValue extends unknown = never> extends Kind<typeof flagKind.definition, Record<GenericName, GenericValue>> {
|
|
11
12
|
}
|
package/dist/clean/flag.mjs
CHANGED
package/dist/clean/index.cjs
CHANGED
|
@@ -6,6 +6,7 @@ var entity = require('./entity.cjs');
|
|
|
6
6
|
var repository = require('./repository.cjs');
|
|
7
7
|
var useCase = require('./useCase.cjs');
|
|
8
8
|
var flag = require('./flag.cjs');
|
|
9
|
+
var unwrapEntity = require('./unwrapEntity.cjs');
|
|
9
10
|
var base = require('./constraint/base.cjs');
|
|
10
11
|
var number = require('./constraint/defaultConstraint/number.cjs');
|
|
11
12
|
var string = require('./constraint/defaultConstraint/string.cjs');
|
|
@@ -26,9 +27,15 @@ var lengthLessThan = require('./primitive/operations/string/lengthLessThan.cjs')
|
|
|
26
27
|
var concat = require('./primitive/operations/string/concat.cjs');
|
|
27
28
|
var dateGreaterThan = require('./primitive/operations/date/dateGreaterThan.cjs');
|
|
28
29
|
var dateLessThan = require('./primitive/operations/date/dateLessThan.cjs');
|
|
30
|
+
var dateAddTime = require('./primitive/operations/date/dateAddTime.cjs');
|
|
31
|
+
var dateSubtractTime = require('./primitive/operations/date/dateSubtractTime.cjs');
|
|
29
32
|
var dateMin = require('./primitive/operations/date/dateMin.cjs');
|
|
30
33
|
var dateMax = require('./primitive/operations/date/dateMax.cjs');
|
|
31
34
|
var sort = require('./primitive/operations/sort.cjs');
|
|
35
|
+
var timeGreaterThan = require('./primitive/operations/time/timeGreaterThan.cjs');
|
|
36
|
+
var timeLessThan = require('./primitive/operations/time/timeLessThan.cjs');
|
|
37
|
+
var timeMin = require('./primitive/operations/time/timeMin.cjs');
|
|
38
|
+
var timeMax = require('./primitive/operations/time/timeMax.cjs');
|
|
32
39
|
|
|
33
40
|
|
|
34
41
|
|
|
@@ -47,6 +54,7 @@ exports.useCaseHandlerKind = useCase.useCaseHandlerKind;
|
|
|
47
54
|
exports.useCaseInstances = useCase.useCaseInstances;
|
|
48
55
|
exports.createFlag = flag.createFlag;
|
|
49
56
|
exports.flagKind = flag.flagKind;
|
|
57
|
+
exports.unwrapEntity = unwrapEntity.unwrapEntity;
|
|
50
58
|
exports.CreateConstrainedTypeError = base.CreateConstrainedTypeError;
|
|
51
59
|
exports.constrainedTypeKind = base.constrainedTypeKind;
|
|
52
60
|
exports.constraintHandlerKind = base.constraintHandlerKind;
|
|
@@ -62,6 +70,7 @@ exports.CreatePrimitiveError = base$1.CreatePrimitiveError;
|
|
|
62
70
|
exports.Date = base$1.Date;
|
|
63
71
|
exports.Number = base$1.Number;
|
|
64
72
|
exports.String = base$1.String;
|
|
73
|
+
exports.Time = base$1.Time;
|
|
65
74
|
exports.primitiveHandlerKind = base$1.primitiveHandlerKind;
|
|
66
75
|
exports.equal = equal.equal;
|
|
67
76
|
exports.add = add.add;
|
|
@@ -79,6 +88,12 @@ exports.lengthLessThan = lengthLessThan.lengthLessThan;
|
|
|
79
88
|
exports.concat = concat.concat;
|
|
80
89
|
exports.dateGreaterThan = dateGreaterThan.dateGreaterThan;
|
|
81
90
|
exports.dateLessThan = dateLessThan.dateLessThan;
|
|
91
|
+
exports.dateAddTime = dateAddTime.dateAddTime;
|
|
92
|
+
exports.dateSubtractTime = dateSubtractTime.dateSubtractTime;
|
|
82
93
|
exports.dateMin = dateMin.dateMin;
|
|
83
94
|
exports.dateMax = dateMax.dateMax;
|
|
84
95
|
exports.sort = sort.sort;
|
|
96
|
+
exports.timeGreaterThan = timeGreaterThan.timeGreaterThan;
|
|
97
|
+
exports.timeLessThan = timeLessThan.timeLessThan;
|
|
98
|
+
exports.timeMin = timeMin.timeMin;
|
|
99
|
+
exports.timeMax = timeMax.timeMax;
|
package/dist/clean/index.d.ts
CHANGED
package/dist/clean/index.mjs
CHANGED
|
@@ -4,10 +4,11 @@ export { CreateEntityError, createEntity, entityKind } from './entity.mjs';
|
|
|
4
4
|
export { createRepository, repositoryHandlerKind } from './repository.mjs';
|
|
5
5
|
export { createUseCase, useCaseHandlerKind, useCaseInstances } from './useCase.mjs';
|
|
6
6
|
export { createFlag, flagKind } from './flag.mjs';
|
|
7
|
+
export { unwrapEntity } from './unwrapEntity.mjs';
|
|
7
8
|
export { CreateConstrainedTypeError, constrainedTypeKind, constraintHandlerKind, createConstraint } from './constraint/base.mjs';
|
|
8
9
|
export { Int, Negative, Positive } from './constraint/defaultConstraint/number.mjs';
|
|
9
10
|
export { Email, Url } from './constraint/defaultConstraint/string.mjs';
|
|
10
|
-
export { BigInt, Boolean, CreatePrimitiveError, Date, Number, String, primitiveHandlerKind } from './primitive/base.mjs';
|
|
11
|
+
export { BigInt, Boolean, CreatePrimitiveError, Date, Number, String, Time, primitiveHandlerKind } from './primitive/base.mjs';
|
|
11
12
|
export { equal } from './primitive/operations/equal.mjs';
|
|
12
13
|
export { add } from './primitive/operations/number/add.mjs';
|
|
13
14
|
export { divide } from './primitive/operations/number/divide.mjs';
|
|
@@ -24,6 +25,12 @@ export { lengthLessThan } from './primitive/operations/string/lengthLessThan.mjs
|
|
|
24
25
|
export { concat } from './primitive/operations/string/concat.mjs';
|
|
25
26
|
export { dateGreaterThan } from './primitive/operations/date/dateGreaterThan.mjs';
|
|
26
27
|
export { dateLessThan } from './primitive/operations/date/dateLessThan.mjs';
|
|
28
|
+
export { dateAddTime } from './primitive/operations/date/dateAddTime.mjs';
|
|
29
|
+
export { dateSubtractTime } from './primitive/operations/date/dateSubtractTime.mjs';
|
|
27
30
|
export { dateMin } from './primitive/operations/date/dateMin.mjs';
|
|
28
31
|
export { dateMax } from './primitive/operations/date/dateMax.mjs';
|
|
29
32
|
export { sort } from './primitive/operations/sort.mjs';
|
|
33
|
+
export { timeGreaterThan } from './primitive/operations/time/timeGreaterThan.mjs';
|
|
34
|
+
export { timeLessThan } from './primitive/operations/time/timeLessThan.mjs';
|
|
35
|
+
export { timeMin } from './primitive/operations/time/timeMin.mjs';
|
|
36
|
+
export { timeMax } from './primitive/operations/time/timeMax.mjs';
|
package/dist/clean/newType.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Kind, type WrappedValue, type Unwrap, type NeverCoalescing } from "..";
|
|
1
|
+
import { type Kind, type WrappedValue, type Unwrap, type NeverCoalescing, type DeepReadonly } from "..";
|
|
2
2
|
import { constrainedTypeKind, type ConstraintHandler } from "./constraint";
|
|
3
3
|
import { type Primitive, type EligiblePrimitive } from "./primitive";
|
|
4
4
|
import * as DEither from "../either";
|
|
@@ -34,6 +34,6 @@ export declare class CreateNewTypeError extends CreateNewTypeError_base {
|
|
|
34
34
|
export declare function createNewType<GenericName extends string, GenericDataParser extends DDataParser.DataParser, const GenericConstrainHandler extends (ConstraintHandler<string, EligiblePrimitive, readonly DDataParser.DataParserChecker<DDataParser.DataParserCheckerDefinition, DDataParser.Output<GenericDataParser>>[]> | readonly [
|
|
35
35
|
ConstraintHandler<string, EligiblePrimitive, readonly DDataParser.DataParserChecker<DDataParser.DataParserCheckerDefinition, DDataParser.Output<GenericDataParser>>[]>,
|
|
36
36
|
...ConstraintHandler<string, EligiblePrimitive, readonly DDataParser.DataParserChecker<DDataParser.DataParserCheckerDefinition, DDataParser.Output<GenericDataParser>>[]>[]
|
|
37
|
-
]) = never>(name: GenericName, dataParser: GenericDataParser & DataParserContainTransform<GenericDataParser>, constraint?: GenericConstrainHandler): NewTypeHandler<GenericName, DDataParser.Output<GenericDataParser
|
|
37
|
+
]) = never>(name: GenericName, dataParser: GenericDataParser & DataParserContainTransform<GenericDataParser>, constraint?: GenericConstrainHandler): NewTypeHandler<GenericName, DeepReadonly<DDataParser.Output<GenericDataParser>>, DArray.ArrayCoalescing<NeverCoalescing<GenericConstrainHandler, readonly []>>>;
|
|
38
38
|
export type GetNewType<GenericHandler extends NewTypeHandler<string, unknown, readonly any[]>> = Extract<GenericHandler extends any ? NewType<GenericHandler["name"], DDataParser.Output<GenericHandler["dataParser"]>, GenericHandler["constrains"][number]["name"]> : never, any>;
|
|
39
39
|
export {};
|
|
@@ -7,6 +7,7 @@ var index$1 = require('../../dataParser/parsers/number/index.cjs');
|
|
|
7
7
|
var index$2 = require('../../dataParser/parsers/bigint/index.cjs');
|
|
8
8
|
var boolean = require('../../dataParser/parsers/boolean.cjs');
|
|
9
9
|
var date = require('../../dataParser/parsers/date.cjs');
|
|
10
|
+
var index$3 = require('../../dataParser/parsers/time/index.cjs');
|
|
10
11
|
var errorKindNamespace = require('../../common/errorKindNamespace.cjs');
|
|
11
12
|
var unwrap = require('../../common/unwrap.cjs');
|
|
12
13
|
var is = require('../../either/right/is.cjs');
|
|
@@ -62,6 +63,7 @@ const Number = createPrimitive(index$1.number());
|
|
|
62
63
|
const BigInt = createPrimitive(index$2.bigint());
|
|
63
64
|
const Boolean = createPrimitive(boolean.boolean());
|
|
64
65
|
const Date = createPrimitive(date.date());
|
|
66
|
+
const Time = createPrimitive(index$3.time());
|
|
65
67
|
|
|
66
68
|
exports.BigInt = BigInt;
|
|
67
69
|
exports.Boolean = Boolean;
|
|
@@ -69,4 +71,5 @@ exports.CreatePrimitiveError = CreatePrimitiveError;
|
|
|
69
71
|
exports.Date = Date;
|
|
70
72
|
exports.Number = Number;
|
|
71
73
|
exports.String = String;
|
|
74
|
+
exports.Time = Time;
|
|
72
75
|
exports.primitiveHandlerKind = primitiveHandlerKind;
|
|
@@ -31,6 +31,8 @@ export declare const Boolean: PrimitiveHandler<boolean>;
|
|
|
31
31
|
export type Boolean = ReturnType<typeof Boolean["createWithUnknownOrThrow"]>;
|
|
32
32
|
export declare const Date: PrimitiveHandler<`date${number}-` | `date${number}+`>;
|
|
33
33
|
export type Date = ReturnType<typeof Date["createWithUnknownOrThrow"]>;
|
|
34
|
-
export
|
|
35
|
-
export type
|
|
34
|
+
export declare const Time: PrimitiveHandler<`time${number}-` | `time${number}+`>;
|
|
35
|
+
export type Time = ReturnType<typeof Time["createWithUnknownOrThrow"]>;
|
|
36
|
+
export type Primitives = (String | Number | BigInt | Boolean | Date | Time);
|
|
37
|
+
export type PrimitiveHandlers = (typeof String | typeof Number | typeof BigInt | typeof Boolean | typeof Date | typeof Time);
|
|
36
38
|
export {};
|
|
@@ -5,6 +5,7 @@ import { number } from '../../dataParser/parsers/number/index.mjs';
|
|
|
5
5
|
import { bigint } from '../../dataParser/parsers/bigint/index.mjs';
|
|
6
6
|
import { boolean } from '../../dataParser/parsers/boolean.mjs';
|
|
7
7
|
import { date } from '../../dataParser/parsers/date.mjs';
|
|
8
|
+
import { time } from '../../dataParser/parsers/time/index.mjs';
|
|
8
9
|
import { createErrorKind } from '../../common/errorKindNamespace.mjs';
|
|
9
10
|
import { unwrap } from '../../common/unwrap.mjs';
|
|
10
11
|
import { isRight } from '../../either/right/is.mjs';
|
|
@@ -60,5 +61,6 @@ const Number = createPrimitive(number());
|
|
|
60
61
|
const BigInt = createPrimitive(bigint());
|
|
61
62
|
const Boolean = createPrimitive(boolean());
|
|
62
63
|
const Date = createPrimitive(date());
|
|
64
|
+
const Time = createPrimitive(time());
|
|
63
65
|
|
|
64
|
-
export { BigInt, Boolean, CreatePrimitiveError, Date, Number, String, primitiveHandlerKind };
|
|
66
|
+
export { BigInt, Boolean, CreatePrimitiveError, Date, Number, String, Time, primitiveHandlerKind };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var addTime = require('../../../../date/operators/addTime.cjs');
|
|
4
|
+
var wrapValue = require('../../../../common/wrapValue.cjs');
|
|
5
|
+
var unwrap = require('../../../../common/unwrap.cjs');
|
|
6
|
+
|
|
7
|
+
function dateAddTime(...args) {
|
|
8
|
+
if (args.length === 1) {
|
|
9
|
+
const [time] = args;
|
|
10
|
+
return (primitive) => dateAddTime(primitive, time);
|
|
11
|
+
}
|
|
12
|
+
const [primitive, time] = args;
|
|
13
|
+
return wrapValue.wrapValue(addTime.addTime(unwrap.unwrap(primitive), unwrap.unwrap(time)));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
exports.dateAddTime = dateAddTime;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { addTime } from '../../../../date/operators/addTime.mjs';
|
|
2
|
+
import { wrapValue } from '../../../../common/wrapValue.mjs';
|
|
3
|
+
import { unwrap } from '../../../../common/unwrap.mjs';
|
|
4
|
+
|
|
5
|
+
function dateAddTime(...args) {
|
|
6
|
+
if (args.length === 1) {
|
|
7
|
+
const [time] = args;
|
|
8
|
+
return (primitive) => dateAddTime(primitive, time);
|
|
9
|
+
}
|
|
10
|
+
const [primitive, time] = args;
|
|
11
|
+
return wrapValue(addTime(unwrap(primitive), unwrap(time)));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { dateAddTime };
|
|
@@ -4,11 +4,7 @@ var max = require('../../../../date/max.cjs');
|
|
|
4
4
|
var wrapValue = require('../../../../common/wrapValue.cjs');
|
|
5
5
|
var unwrap = require('../../../../common/unwrap.cjs');
|
|
6
6
|
|
|
7
|
-
function dateMax(
|
|
8
|
-
if (input.length === 1) {
|
|
9
|
-
const [first] = input;
|
|
10
|
-
return (...rest) => (dateMax(...[first, ...rest]));
|
|
11
|
-
}
|
|
7
|
+
function dateMax(input) {
|
|
12
8
|
return wrapValue.wrapValue(max.max(input.map(unwrap.unwrap)));
|
|
13
9
|
}
|
|
14
10
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type TheDate } from "../../../../date";
|
|
2
2
|
import { type Date } from "../../base";
|
|
3
3
|
import { type AnyTuple } from "../../../../common";
|
|
4
|
-
export declare function dateMax(
|
|
5
|
-
export declare function dateMax(...input: AnyTuple<Date | TheDate>): Date;
|
|
4
|
+
export declare function dateMax(input: AnyTuple<Date | TheDate>): Date;
|
|
@@ -2,11 +2,7 @@ import { max } from '../../../../date/max.mjs';
|
|
|
2
2
|
import { wrapValue } from '../../../../common/wrapValue.mjs';
|
|
3
3
|
import { unwrap } from '../../../../common/unwrap.mjs';
|
|
4
4
|
|
|
5
|
-
function dateMax(
|
|
6
|
-
if (input.length === 1) {
|
|
7
|
-
const [first] = input;
|
|
8
|
-
return (...rest) => (dateMax(...[first, ...rest]));
|
|
9
|
-
}
|
|
5
|
+
function dateMax(input) {
|
|
10
6
|
return wrapValue(max(input.map(unwrap)));
|
|
11
7
|
}
|
|
12
8
|
|
|
@@ -4,11 +4,7 @@ var min = require('../../../../date/min.cjs');
|
|
|
4
4
|
var wrapValue = require('../../../../common/wrapValue.cjs');
|
|
5
5
|
var unwrap = require('../../../../common/unwrap.cjs');
|
|
6
6
|
|
|
7
|
-
function dateMin(
|
|
8
|
-
if (input.length === 1) {
|
|
9
|
-
const [first] = input;
|
|
10
|
-
return (...rest) => (dateMin(...[first, ...rest]));
|
|
11
|
-
}
|
|
7
|
+
function dateMin(input) {
|
|
12
8
|
return wrapValue.wrapValue(min.min(input.map(unwrap.unwrap)));
|
|
13
9
|
}
|
|
14
10
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type TheDate } from "../../../../date";
|
|
2
2
|
import { type Date } from "../../base";
|
|
3
3
|
import { type AnyTuple } from "../../../../common";
|
|
4
|
-
export declare function dateMin(
|
|
5
|
-
export declare function dateMin(...input: AnyTuple<Date | TheDate>): Date;
|
|
4
|
+
export declare function dateMin(input: AnyTuple<Date | TheDate>): Date;
|
|
@@ -2,11 +2,7 @@ import { min } from '../../../../date/min.mjs';
|
|
|
2
2
|
import { wrapValue } from '../../../../common/wrapValue.mjs';
|
|
3
3
|
import { unwrap } from '../../../../common/unwrap.mjs';
|
|
4
4
|
|
|
5
|
-
function dateMin(
|
|
6
|
-
if (input.length === 1) {
|
|
7
|
-
const [first] = input;
|
|
8
|
-
return (...rest) => (dateMin(...[first, ...rest]));
|
|
9
|
-
}
|
|
5
|
+
function dateMin(input) {
|
|
10
6
|
return wrapValue(min(input.map(unwrap)));
|
|
11
7
|
}
|
|
12
8
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var subtractTime = require('../../../../date/operators/subtractTime.cjs');
|
|
4
|
+
var wrapValue = require('../../../../common/wrapValue.cjs');
|
|
5
|
+
var unwrap = require('../../../../common/unwrap.cjs');
|
|
6
|
+
|
|
7
|
+
function dateSubtractTime(...args) {
|
|
8
|
+
if (args.length === 1) {
|
|
9
|
+
const [time] = args;
|
|
10
|
+
return (primitive) => dateSubtractTime(primitive, time);
|
|
11
|
+
}
|
|
12
|
+
const [primitive, time] = args;
|
|
13
|
+
return wrapValue.wrapValue(subtractTime.subtractTime(unwrap.unwrap(primitive), unwrap.unwrap(time)));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
exports.dateSubtractTime = dateSubtractTime;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Date, type Time } from "../../base";
|
|
2
|
+
import { type TheTime } from "../../../../date";
|
|
3
|
+
export declare function dateSubtractTime(time: Time | TheTime): (primitive: Date) => Date;
|
|
4
|
+
export declare function dateSubtractTime(primitive: Date, time: Time | TheTime): Date;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { subtractTime } from '../../../../date/operators/subtractTime.mjs';
|
|
2
|
+
import { wrapValue } from '../../../../common/wrapValue.mjs';
|
|
3
|
+
import { unwrap } from '../../../../common/unwrap.mjs';
|
|
4
|
+
|
|
5
|
+
function dateSubtractTime(...args) {
|
|
6
|
+
if (args.length === 1) {
|
|
7
|
+
const [time] = args;
|
|
8
|
+
return (primitive) => dateSubtractTime(primitive, time);
|
|
9
|
+
}
|
|
10
|
+
const [primitive, time] = args;
|
|
11
|
+
return wrapValue(subtractTime(unwrap(primitive), unwrap(time)));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { dateSubtractTime };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export * from "./dateGreaterThan";
|
|
2
2
|
export * from "./dateLessThan";
|
|
3
|
+
export * from "./dateAddTime";
|
|
4
|
+
export * from "./dateSubtractTime";
|
|
3
5
|
export * from "./dateMin";
|
|
4
6
|
export * from "./dateMax";
|
|
5
|
-
export * from "./dateGreaterThan";
|
|
6
|
-
export * from "./dateLessThan";
|
|
7
|
-
export * from "./dateMax";
|
|
8
|
-
export * from "./dateMin";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type ToLargeEnsemble, type Unwrap } from "../../../common";
|
|
2
|
-
import { type Primitive, type Primitives, type Date } from "../base";
|
|
3
|
-
export declare function equal<GenericInput extends Primitives, GenericValue extends (GenericInput extends Date ? (Date | Unwrap<Date>) : (Primitive<ToLargeEnsemble<Unwrap<GenericInput>>> | ToLargeEnsemble<Unwrap<GenericInput>>))>(value: GenericValue): (input: GenericInput) => input is GenericInput & Primitive<Unwrap<GenericValue>>;
|
|
4
|
-
export declare function equal<GenericInput extends Primitives, GenericValue extends (GenericInput extends Date ? (Date | Unwrap<Date>) : (Primitive<ToLargeEnsemble<Unwrap<GenericInput>>> | ToLargeEnsemble<Unwrap<GenericInput>>))>(input: GenericInput, value: GenericValue): input is GenericInput & Primitive<Unwrap<GenericValue>>;
|
|
2
|
+
import { type Primitive, type Primitives, type Date, type Time } from "../base";
|
|
3
|
+
export declare function equal<GenericInput extends Primitives, GenericValue extends (GenericInput extends Date ? (Date | Unwrap<Date>) : GenericInput extends Time ? (Time | Unwrap<Time>) : (Primitive<ToLargeEnsemble<Unwrap<GenericInput>>> | ToLargeEnsemble<Unwrap<GenericInput>>))>(value: GenericValue): (input: GenericInput) => input is GenericInput & Primitive<Unwrap<GenericValue>>;
|
|
4
|
+
export declare function equal<GenericInput extends Primitives, GenericValue extends (GenericInput extends Date ? (Date | Unwrap<Date>) : GenericInput extends Time ? (Time | Unwrap<Time>) : (Primitive<ToLargeEnsemble<Unwrap<GenericInput>>> | ToLargeEnsemble<Unwrap<GenericInput>>))>(input: GenericInput, value: GenericValue): input is GenericInput & Primitive<Unwrap<GenericValue>>;
|
|
@@ -5,6 +5,8 @@ var sort$1 = require('../../../number/sort.cjs');
|
|
|
5
5
|
var wrapValue = require('../../../common/wrapValue.cjs');
|
|
6
6
|
var is = require('../../../date/is.cjs');
|
|
7
7
|
var sort$2 = require('../../../date/sort.cjs');
|
|
8
|
+
var isTime = require('../../../date/isTime.cjs');
|
|
9
|
+
var sortTimes = require('../../../date/sortTimes.cjs');
|
|
8
10
|
var sort$3 = require('../../../string/sort.cjs');
|
|
9
11
|
|
|
10
12
|
function sort(...args) {
|
|
@@ -26,6 +28,10 @@ function sort(...args) {
|
|
|
26
28
|
return sort$2.sort(rawArray, type)
|
|
27
29
|
.map(wrapValue.wrapValue);
|
|
28
30
|
}
|
|
31
|
+
else if (isTime.isTime(first)) {
|
|
32
|
+
return sortTimes.sortTimes(rawArray, type)
|
|
33
|
+
.map(wrapValue.wrapValue);
|
|
34
|
+
}
|
|
29
35
|
else {
|
|
30
36
|
return sort$3.sort(rawArray, type)
|
|
31
37
|
.map(wrapValue.wrapValue);
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import { type Date, type Number, type String } from "../base";
|
|
2
|
-
import { type SortType } from "../../../common";
|
|
1
|
+
import { type Date, type Number, type String, type Time } from "../base";
|
|
2
|
+
import { type ToWrappedValue, type SortType } from "../../../common";
|
|
3
3
|
import * as DDate from "../../../date";
|
|
4
|
-
export declare function sort(
|
|
5
|
-
export declare function sort(
|
|
6
|
-
export declare function sort(type: SortType): (input: readonly (Number | number)[]) => Number[];
|
|
7
|
-
export declare function sort(input: readonly (Number | number)[], type: SortType): Number[];
|
|
8
|
-
export declare function sort(type: SortType): (input: readonly (String | string)[]) => String[];
|
|
9
|
-
export declare function sort(input: readonly (String | string)[], type: SortType): String[];
|
|
4
|
+
export declare function sort<GenericInput extends (readonly (Date | DDate.TheDate)[] | readonly (Number | number)[] | readonly (String | string)[] | readonly (Time | DDate.TheTime)[])>(type: SortType): (input: GenericInput) => ToWrappedValue<GenericInput[number]>[];
|
|
5
|
+
export declare function sort<GenericInput extends (readonly (Date | DDate.TheDate)[] | readonly (Number | number)[] | readonly (String | string)[] | readonly (Time | DDate.TheTime)[])>(input: GenericInput, type: SortType): ToWrappedValue<GenericInput[number]>[];
|
|
@@ -3,6 +3,8 @@ import { sort as sort$1 } from '../../../number/sort.mjs';
|
|
|
3
3
|
import { wrapValue } from '../../../common/wrapValue.mjs';
|
|
4
4
|
import { is } from '../../../date/is.mjs';
|
|
5
5
|
import { sort as sort$2 } from '../../../date/sort.mjs';
|
|
6
|
+
import { isTime } from '../../../date/isTime.mjs';
|
|
7
|
+
import { sortTimes } from '../../../date/sortTimes.mjs';
|
|
6
8
|
import { sort as sort$3 } from '../../../string/sort.mjs';
|
|
7
9
|
|
|
8
10
|
function sort(...args) {
|
|
@@ -24,6 +26,10 @@ function sort(...args) {
|
|
|
24
26
|
return sort$2(rawArray, type)
|
|
25
27
|
.map(wrapValue);
|
|
26
28
|
}
|
|
29
|
+
else if (isTime(first)) {
|
|
30
|
+
return sortTimes(rawArray, type)
|
|
31
|
+
.map(wrapValue);
|
|
32
|
+
}
|
|
27
33
|
else {
|
|
28
34
|
return sort$3(rawArray, type)
|
|
29
35
|
.map(wrapValue);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var greaterThanTime = require('../../../../date/operators/greaterThanTime.cjs');
|
|
4
|
+
var unwrap = require('../../../../common/unwrap.cjs');
|
|
5
|
+
|
|
6
|
+
function timeGreaterThan(...args) {
|
|
7
|
+
if (args.length === 1) {
|
|
8
|
+
const [threshold] = args;
|
|
9
|
+
return (primitive) => timeGreaterThan(primitive, threshold);
|
|
10
|
+
}
|
|
11
|
+
const [primitive, threshold] = args;
|
|
12
|
+
return greaterThanTime.greaterThanTime(unwrap.unwrap(primitive), unwrap.unwrap(threshold));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
exports.timeGreaterThan = timeGreaterThan;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Time } from "../../base";
|
|
2
|
+
import { type TheTime } from "../../../../date";
|
|
3
|
+
export declare function timeGreaterThan(threshold: Time | TheTime): (primitive: Time) => boolean;
|
|
4
|
+
export declare function timeGreaterThan(primitive: Time, threshold: Time | TheTime): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { greaterThanTime } from '../../../../date/operators/greaterThanTime.mjs';
|
|
2
|
+
import { unwrap } from '../../../../common/unwrap.mjs';
|
|
3
|
+
|
|
4
|
+
function timeGreaterThan(...args) {
|
|
5
|
+
if (args.length === 1) {
|
|
6
|
+
const [threshold] = args;
|
|
7
|
+
return (primitive) => timeGreaterThan(primitive, threshold);
|
|
8
|
+
}
|
|
9
|
+
const [primitive, threshold] = args;
|
|
10
|
+
return greaterThanTime(unwrap(primitive), unwrap(threshold));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { timeGreaterThan };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var lessThanTime = require('../../../../date/operators/lessThanTime.cjs');
|
|
4
|
+
var unwrap = require('../../../../common/unwrap.cjs');
|
|
5
|
+
|
|
6
|
+
function timeLessThan(...args) {
|
|
7
|
+
if (args.length === 1) {
|
|
8
|
+
const [threshold] = args;
|
|
9
|
+
return (primitive) => timeLessThan(primitive, threshold);
|
|
10
|
+
}
|
|
11
|
+
const [primitive, threshold] = args;
|
|
12
|
+
return lessThanTime.lessThanTime(unwrap.unwrap(primitive), unwrap.unwrap(threshold));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
exports.timeLessThan = timeLessThan;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Time } from "../../base";
|
|
2
|
+
import { type TheTime } from "../../../../date";
|
|
3
|
+
export declare function timeLessThan(threshold: Time | TheTime): (primitive: Time) => boolean;
|
|
4
|
+
export declare function timeLessThan(primitive: Time, threshold: Time | TheTime): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { lessThanTime } from '../../../../date/operators/lessThanTime.mjs';
|
|
2
|
+
import { unwrap } from '../../../../common/unwrap.mjs';
|
|
3
|
+
|
|
4
|
+
function timeLessThan(...args) {
|
|
5
|
+
if (args.length === 1) {
|
|
6
|
+
const [threshold] = args;
|
|
7
|
+
return (primitive) => timeLessThan(primitive, threshold);
|
|
8
|
+
}
|
|
9
|
+
const [primitive, threshold] = args;
|
|
10
|
+
return lessThanTime(unwrap(primitive), unwrap(threshold));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { timeLessThan };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var wrapValue = require('../../../../common/wrapValue.cjs');
|
|
4
|
+
var createTheTime = require('../../../../date/createTheTime.cjs');
|
|
5
|
+
var unwrap = require('../../../../common/unwrap.cjs');
|
|
6
|
+
var toTimeValue = require('../../../../date/toTimeValue.cjs');
|
|
7
|
+
|
|
8
|
+
function timeMax(input) {
|
|
9
|
+
return wrapValue.wrapValue(createTheTime.createTheTime(Math.max(...input.map(unwrap.unwrap).map(toTimeValue.toTimeValue))));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
exports.timeMax = timeMax;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { wrapValue } from '../../../../common/wrapValue.mjs';
|
|
2
|
+
import { createTheTime } from '../../../../date/createTheTime.mjs';
|
|
3
|
+
import { unwrap } from '../../../../common/unwrap.mjs';
|
|
4
|
+
import { toTimeValue } from '../../../../date/toTimeValue.mjs';
|
|
5
|
+
|
|
6
|
+
function timeMax(input) {
|
|
7
|
+
return wrapValue(createTheTime(Math.max(...input.map(unwrap).map(toTimeValue))));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { timeMax };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var toTimeValue = require('../../../../date/toTimeValue.cjs');
|
|
4
|
+
var wrapValue = require('../../../../common/wrapValue.cjs');
|
|
5
|
+
var createTheTime = require('../../../../date/createTheTime.cjs');
|
|
6
|
+
var unwrap = require('../../../../common/unwrap.cjs');
|
|
7
|
+
|
|
8
|
+
function timeMin(input) {
|
|
9
|
+
return wrapValue.wrapValue(createTheTime.createTheTime(Math.min(...input.map(unwrap.unwrap).map(toTimeValue.toTimeValue))));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
exports.timeMin = timeMin;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { toTimeValue } from '../../../../date/toTimeValue.mjs';
|
|
2
|
+
import { wrapValue } from '../../../../common/wrapValue.mjs';
|
|
3
|
+
import { createTheTime } from '../../../../date/createTheTime.mjs';
|
|
4
|
+
import { unwrap } from '../../../../common/unwrap.mjs';
|
|
5
|
+
|
|
6
|
+
function timeMin(input) {
|
|
7
|
+
return wrapValue(createTheTime(Math.min(...input.map(unwrap).map(toTimeValue))));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { timeMin };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var entity = require('./entity.cjs');
|
|
4
|
+
var flag = require('./flag.cjs');
|
|
5
|
+
var unwrap = require('../common/unwrap.cjs');
|
|
6
|
+
|
|
7
|
+
function unwrapEntity(entity$1) {
|
|
8
|
+
const unwrapEntity = {};
|
|
9
|
+
for (const prop in entity$1) {
|
|
10
|
+
if (prop === entity.entityKind.runTimeKey) {
|
|
11
|
+
unwrapEntity._entityName = entity$1[prop];
|
|
12
|
+
}
|
|
13
|
+
else if (prop === flag.flagKind.runTimeKey) {
|
|
14
|
+
unwrapEntity._flags = entity$1[prop];
|
|
15
|
+
}
|
|
16
|
+
else if (entity$1[prop] instanceof Array) {
|
|
17
|
+
unwrapEntity[prop] = entity$1[prop].map(unwrap.unwrap);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
unwrapEntity[prop] = unwrap.unwrap(entity$1[prop]);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return unwrapEntity;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
exports.unwrapEntity = unwrapEntity;
|