@duplojs/utils 1.2.17 → 1.2.19

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.
Files changed (245) hide show
  1. package/dist/array/chunk.cjs +16 -0
  2. package/dist/array/chunk.d.ts +2 -0
  3. package/dist/array/chunk.mjs +14 -0
  4. package/dist/array/every.cjs +6 -3
  5. package/dist/array/every.d.ts +4 -3
  6. package/dist/array/every.mjs +6 -3
  7. package/dist/array/fill/all.d.ts +2 -2
  8. package/dist/array/filter.cjs +6 -3
  9. package/dist/array/filter.d.ts +6 -5
  10. package/dist/array/filter.mjs +6 -3
  11. package/dist/array/flatMap.cjs +6 -3
  12. package/dist/array/flatMap.d.ts +4 -3
  13. package/dist/array/flatMap.mjs +6 -3
  14. package/dist/array/index.cjs +13 -10
  15. package/dist/array/index.d.ts +3 -0
  16. package/dist/array/index.mjs +5 -4
  17. package/dist/array/insert.cjs +12 -0
  18. package/dist/array/insert.d.ts +2 -0
  19. package/dist/array/insert.mjs +10 -0
  20. package/dist/array/isLastIndex.cjs +12 -0
  21. package/dist/array/isLastIndex.d.ts +2 -0
  22. package/dist/array/isLastIndex.mjs +10 -0
  23. package/dist/array/map.cjs +6 -3
  24. package/dist/array/map.d.ts +4 -3
  25. package/dist/array/map.mjs +6 -3
  26. package/dist/array/push.cjs +3 -3
  27. package/dist/array/push.d.ts +2 -2
  28. package/dist/array/push.mjs +3 -3
  29. package/dist/array/reduce.cjs +22 -9
  30. package/dist/array/reduce.d.ts +7 -4
  31. package/dist/array/reduce.mjs +22 -10
  32. package/dist/array/reduceRight.cjs +7 -10
  33. package/dist/array/reduceRight.d.ts +2 -2
  34. package/dist/array/reduceRight.mjs +7 -10
  35. package/dist/array/some.cjs +6 -3
  36. package/dist/array/some.d.ts +4 -3
  37. package/dist/array/some.mjs +6 -3
  38. package/dist/array/types/ArrayCoalescing.d.ts +1 -1
  39. package/dist/clean/constraint/base.cjs +77 -0
  40. package/dist/clean/constraint/base.d.ts +36 -0
  41. package/dist/clean/constraint/base.mjs +72 -0
  42. package/dist/{array/sort → clean/constraint/defaultConstraint}/index.d.ts +0 -1
  43. package/dist/clean/constraint/defaultConstraint/number.cjs +15 -0
  44. package/dist/clean/constraint/defaultConstraint/number.d.ts +8 -0
  45. package/dist/clean/constraint/defaultConstraint/number.mjs +11 -0
  46. package/dist/clean/constraint/defaultConstraint/string.cjs +12 -0
  47. package/dist/clean/constraint/defaultConstraint/string.d.ts +6 -0
  48. package/dist/clean/constraint/defaultConstraint/string.mjs +9 -0
  49. package/dist/clean/constraint/index.d.ts +2 -0
  50. package/dist/clean/entity.cjs +125 -0
  51. package/dist/clean/entity.d.ts +74 -0
  52. package/dist/clean/entity.mjs +121 -0
  53. package/dist/clean/flag.cjs +26 -0
  54. package/dist/clean/flag.d.ts +16 -0
  55. package/dist/clean/flag.mjs +23 -0
  56. package/dist/clean/index.cjs +84 -0
  57. package/dist/clean/index.d.ts +8 -0
  58. package/dist/clean/index.mjs +29 -0
  59. package/dist/clean/kind.cjs +9 -0
  60. package/dist/clean/kind.d.ts +1 -0
  61. package/dist/clean/kind.mjs +7 -0
  62. package/dist/clean/newType.cjs +91 -0
  63. package/dist/clean/newType.d.ts +38 -0
  64. package/dist/clean/newType.mjs +86 -0
  65. package/dist/clean/primitive/base.cjs +72 -0
  66. package/dist/clean/primitive/base.d.ts +36 -0
  67. package/dist/clean/primitive/base.mjs +64 -0
  68. package/dist/clean/primitive/index.d.ts +2 -0
  69. package/dist/clean/primitive/operations/date/dateGreaterThan.cjs +15 -0
  70. package/dist/clean/primitive/operations/date/dateGreaterThan.d.ts +4 -0
  71. package/dist/clean/primitive/operations/date/dateGreaterThan.mjs +13 -0
  72. package/dist/clean/primitive/operations/date/dateLessThan.cjs +15 -0
  73. package/dist/clean/primitive/operations/date/dateLessThan.d.ts +4 -0
  74. package/dist/clean/primitive/operations/date/dateLessThan.mjs +13 -0
  75. package/dist/clean/primitive/operations/date/dateMax.cjs +15 -0
  76. package/dist/clean/primitive/operations/date/dateMax.d.ts +5 -0
  77. package/dist/clean/primitive/operations/date/dateMax.mjs +13 -0
  78. package/dist/clean/primitive/operations/date/dateMin.cjs +15 -0
  79. package/dist/clean/primitive/operations/date/dateMin.d.ts +5 -0
  80. package/dist/clean/primitive/operations/date/dateMin.mjs +13 -0
  81. package/dist/clean/primitive/operations/date/index.d.ts +8 -0
  82. package/dist/clean/primitive/operations/equal.cjs +14 -0
  83. package/dist/clean/primitive/operations/equal.d.ts +4 -0
  84. package/dist/clean/primitive/operations/equal.mjs +12 -0
  85. package/dist/clean/primitive/operations/index.d.ts +5 -0
  86. package/dist/clean/primitive/operations/number/add.cjs +15 -0
  87. package/dist/clean/primitive/operations/number/add.d.ts +3 -0
  88. package/dist/clean/primitive/operations/number/add.mjs +13 -0
  89. package/dist/clean/primitive/operations/number/divide.cjs +15 -0
  90. package/dist/clean/primitive/operations/number/divide.d.ts +3 -0
  91. package/dist/clean/primitive/operations/number/divide.mjs +13 -0
  92. package/dist/clean/primitive/operations/number/greaterThan.cjs +14 -0
  93. package/dist/clean/primitive/operations/number/greaterThan.d.ts +3 -0
  94. package/dist/clean/primitive/operations/number/greaterThan.mjs +12 -0
  95. package/dist/clean/primitive/operations/number/index.d.ts +8 -0
  96. package/dist/clean/primitive/operations/number/lessThan.cjs +14 -0
  97. package/dist/clean/primitive/operations/number/lessThan.d.ts +3 -0
  98. package/dist/clean/primitive/operations/number/lessThan.mjs +12 -0
  99. package/dist/clean/primitive/operations/number/max.cjs +10 -0
  100. package/dist/clean/primitive/operations/number/max.d.ts +3 -0
  101. package/dist/clean/primitive/operations/number/max.mjs +8 -0
  102. package/dist/clean/primitive/operations/number/min.cjs +10 -0
  103. package/dist/clean/primitive/operations/number/min.d.ts +3 -0
  104. package/dist/clean/primitive/operations/number/min.mjs +8 -0
  105. package/dist/clean/primitive/operations/number/multiply.cjs +15 -0
  106. package/dist/clean/primitive/operations/number/multiply.d.ts +3 -0
  107. package/dist/clean/primitive/operations/number/multiply.mjs +13 -0
  108. package/dist/clean/primitive/operations/number/subtract.cjs +15 -0
  109. package/dist/clean/primitive/operations/number/subtract.d.ts +3 -0
  110. package/dist/clean/primitive/operations/number/subtract.mjs +13 -0
  111. package/dist/clean/primitive/operations/sort.cjs +35 -0
  112. package/dist/clean/primitive/operations/sort.d.ts +9 -0
  113. package/dist/clean/primitive/operations/sort.mjs +33 -0
  114. package/dist/clean/primitive/operations/string/concat.cjs +16 -0
  115. package/dist/clean/primitive/operations/string/concat.d.ts +3 -0
  116. package/dist/clean/primitive/operations/string/concat.mjs +14 -0
  117. package/dist/clean/primitive/operations/string/index.d.ts +5 -0
  118. package/dist/clean/primitive/operations/string/length.cjs +10 -0
  119. package/dist/clean/primitive/operations/string/length.d.ts +2 -0
  120. package/dist/clean/primitive/operations/string/length.mjs +8 -0
  121. package/dist/clean/primitive/operations/string/lengthEqual.cjs +14 -0
  122. package/dist/clean/primitive/operations/string/lengthEqual.d.ts +3 -0
  123. package/dist/clean/primitive/operations/string/lengthEqual.mjs +12 -0
  124. package/dist/clean/primitive/operations/string/lengthGreaterThan.cjs +14 -0
  125. package/dist/clean/primitive/operations/string/lengthGreaterThan.d.ts +3 -0
  126. package/dist/clean/primitive/operations/string/lengthGreaterThan.mjs +12 -0
  127. package/dist/clean/primitive/operations/string/lengthLessThan.cjs +14 -0
  128. package/dist/clean/primitive/operations/string/lengthLessThan.d.ts +3 -0
  129. package/dist/clean/primitive/operations/string/lengthLessThan.mjs +12 -0
  130. package/dist/clean/repository.cjs +15 -0
  131. package/dist/clean/repository.d.ts +8 -0
  132. package/dist/clean/repository.mjs +12 -0
  133. package/dist/clean/useCase.cjs +25 -0
  134. package/dist/clean/useCase.d.ts +23 -0
  135. package/dist/clean/useCase.mjs +21 -0
  136. package/dist/common/index.d.ts +0 -1
  137. package/dist/common/kind.d.ts +1 -0
  138. package/dist/common/types/index.d.ts +1 -0
  139. package/dist/common/types/sortType.d.ts +1 -0
  140. package/dist/common/unwrap.d.ts +1 -2
  141. package/dist/dataParser/base.d.ts +5 -4
  142. package/dist/dataParser/baseExtended.d.ts +4 -4
  143. package/dist/dataParser/extended/array.d.ts +3 -3
  144. package/dist/dataParser/extended/bigint.d.ts +2 -2
  145. package/dist/dataParser/extended/boolean.d.ts +2 -2
  146. package/dist/dataParser/extended/date.d.ts +3 -2
  147. package/dist/dataParser/extended/empty.d.ts +2 -2
  148. package/dist/dataParser/extended/lazy.d.ts +3 -3
  149. package/dist/dataParser/extended/literal.d.ts +2 -2
  150. package/dist/dataParser/extended/nil.d.ts +2 -2
  151. package/dist/dataParser/extended/nullable.d.ts +3 -3
  152. package/dist/dataParser/extended/number.cjs +3 -0
  153. package/dist/dataParser/extended/number.d.ts +5 -2
  154. package/dist/dataParser/extended/number.mjs +3 -0
  155. package/dist/dataParser/extended/object.cjs +8 -13
  156. package/dist/dataParser/extended/object.d.ts +4 -2
  157. package/dist/dataParser/extended/object.mjs +8 -13
  158. package/dist/dataParser/extended/optional.d.ts +3 -3
  159. package/dist/dataParser/extended/pipe.d.ts +3 -3
  160. package/dist/dataParser/extended/record.d.ts +3 -3
  161. package/dist/dataParser/extended/recover.d.ts +3 -3
  162. package/dist/dataParser/extended/string.d.ts +2 -2
  163. package/dist/dataParser/extended/templateLiteral.d.ts +2 -2
  164. package/dist/dataParser/extended/transform.d.ts +3 -3
  165. package/dist/dataParser/extended/tuple.d.ts +3 -3
  166. package/dist/dataParser/extended/union.d.ts +3 -3
  167. package/dist/dataParser/extended/unknown.d.ts +2 -2
  168. package/dist/dataParser/identifier.d.ts +10 -160
  169. package/dist/dataParser/index.cjs +4 -0
  170. package/dist/dataParser/index.mjs +2 -0
  171. package/dist/dataParser/parsers/array/index.cjs +2 -2
  172. package/dist/dataParser/parsers/array/index.mjs +2 -2
  173. package/dist/dataParser/parsers/literal.d.ts +1 -1
  174. package/dist/dataParser/parsers/object/index.cjs +3 -3
  175. package/dist/dataParser/parsers/object/index.d.ts +2 -0
  176. package/dist/dataParser/parsers/object/index.mjs +3 -3
  177. package/dist/dataParser/parsers/object/partial.cjs +20 -0
  178. package/dist/dataParser/parsers/object/partial.d.ts +14 -0
  179. package/dist/dataParser/parsers/object/partial.mjs +18 -0
  180. package/dist/dataParser/parsers/object/required.cjs +20 -0
  181. package/dist/dataParser/parsers/object/required.d.ts +10 -0
  182. package/dist/dataParser/parsers/object/required.mjs +18 -0
  183. package/dist/dataParser/parsers/record/index.cjs +2 -2
  184. package/dist/dataParser/parsers/record/index.mjs +2 -2
  185. package/dist/dataParser/parsers/refine.d.ts +1 -1
  186. package/dist/dataParser/parsers/tuple.cjs +2 -2
  187. package/dist/dataParser/parsers/tuple.mjs +2 -2
  188. package/dist/date/index.cjs +8 -0
  189. package/dist/date/index.d.ts +4 -0
  190. package/dist/date/index.mjs +4 -0
  191. package/dist/date/is.cjs +9 -0
  192. package/dist/date/is.d.ts +2 -0
  193. package/dist/date/is.mjs +7 -0
  194. package/dist/date/max.cjs +10 -0
  195. package/dist/date/max.d.ts +3 -0
  196. package/dist/date/max.mjs +8 -0
  197. package/dist/date/min.cjs +10 -0
  198. package/dist/date/min.d.ts +3 -0
  199. package/dist/date/min.mjs +8 -0
  200. package/dist/date/sort.cjs +20 -0
  201. package/dist/date/sort.d.ts +4 -0
  202. package/dist/date/sort.mjs +18 -0
  203. package/dist/generator/chunk.cjs +24 -0
  204. package/dist/generator/chunk.d.ts +2 -0
  205. package/dist/generator/chunk.mjs +22 -0
  206. package/dist/generator/index.cjs +2 -0
  207. package/dist/generator/index.d.ts +1 -0
  208. package/dist/generator/index.mjs +1 -0
  209. package/dist/generator/reduce.cjs +2 -6
  210. package/dist/generator/reduce.d.ts +1 -0
  211. package/dist/generator/reduce.mjs +2 -6
  212. package/dist/index.cjs +3 -2
  213. package/dist/index.d.ts +2 -0
  214. package/dist/index.mjs +3 -1
  215. package/dist/number/index.cjs +2 -0
  216. package/dist/number/index.d.ts +1 -0
  217. package/dist/number/index.mjs +1 -0
  218. package/dist/number/max.cjs +2 -7
  219. package/dist/number/max.d.ts +2 -2
  220. package/dist/number/max.mjs +2 -7
  221. package/dist/number/min.cjs +2 -7
  222. package/dist/number/min.d.ts +2 -2
  223. package/dist/number/min.mjs +2 -7
  224. package/dist/number/sort.cjs +14 -0
  225. package/dist/number/sort.d.ts +3 -0
  226. package/dist/number/sort.mjs +12 -0
  227. package/dist/pattern/match/index.d.ts +3 -3
  228. package/dist/pattern/when.d.ts +5 -5
  229. package/dist/string/index.cjs +2 -0
  230. package/dist/string/index.d.ts +1 -0
  231. package/dist/string/index.mjs +1 -0
  232. package/dist/{array/sort/string.cjs → string/sort.cjs} +6 -6
  233. package/dist/string/sort.d.ts +3 -0
  234. package/dist/{array/sort/string.mjs → string/sort.mjs} +6 -6
  235. package/package.json +7 -2
  236. package/dist/array/sort/number.cjs +0 -14
  237. package/dist/array/sort/number.d.ts +0 -4
  238. package/dist/array/sort/number.mjs +0 -12
  239. package/dist/array/sort/string.d.ts +0 -4
  240. package/dist/common/not.cjs +0 -12
  241. package/dist/common/not.d.ts +0 -2
  242. package/dist/common/not.mjs +0 -10
  243. /package/dist/array/{sort/default.cjs → sort.cjs} +0 -0
  244. /package/dist/array/{sort/default.d.ts → sort.d.ts} +0 -0
  245. /package/dist/array/{sort/default.mjs → sort.mjs} +0 -0
@@ -0,0 +1,36 @@
1
+ import { type Kind, type WrappedValue } from "../../common";
2
+ import * as DDataParser from "../../dataParser";
3
+ import * as DEither from "../../either";
4
+ export type EligiblePrimitive = string | number | boolean | bigint;
5
+ export interface Primitive<GenericValue extends EligiblePrimitive> extends WrappedValue<GenericValue> {
6
+ }
7
+ export declare const primitiveHandlerKind: import("../../common").KindHandler<import("../../common").KindDefinition<"@DuplojsUtilsClean/primitive-handler", unknown>>;
8
+ export interface PrimitiveHandler<GenericValue extends EligiblePrimitive = EligiblePrimitive> extends Kind<typeof primitiveHandlerKind.definition> {
9
+ readonly dataParser: DDataParser.Contract<GenericValue>;
10
+ create<GenericData extends GenericValue>(data: GenericData): (DEither.EitherRight<"createNewType", Primitive<GenericData>> | DEither.EitherLeft<"createNewTypeError", DDataParser.DataParserError>);
11
+ createOrThrow<GenericData extends GenericValue>(data: GenericData): Primitive<GenericData>;
12
+ createWithUnknown<GenericData extends unknown>(data: GenericData): (DEither.EitherRight<"createNewType", Primitive<GenericValue>> | DEither.EitherLeft<"createNewTypeError", DDataParser.DataParserError>);
13
+ createWithUnknownOrThrow<GenericData extends unknown>(data: GenericData): Primitive<GenericValue>;
14
+ is<GenericInput extends WrappedValue>(input: GenericInput): input is Extract<GenericInput, Primitive<GenericValue>>;
15
+ }
16
+ declare const CreatePrimitiveError_base: new (params: {
17
+ "@DuplojsUtilsError/create-primitive-error"?: unknown;
18
+ }, parentParams: [message?: string | undefined, options?: ErrorOptions | undefined]) => Error & Kind<import("../../common").KindDefinition<"create-primitive-error", unknown>, unknown> & Kind<import("../../common").KindDefinition<"@DuplojsUtilsError/create-primitive-error", unknown>, unknown>;
19
+ export declare class CreatePrimitiveError extends CreatePrimitiveError_base {
20
+ data: unknown;
21
+ dataParserError: DDataParser.DataParserError;
22
+ constructor(data: unknown, dataParserError: DDataParser.DataParserError);
23
+ }
24
+ export declare const String: PrimitiveHandler<string>;
25
+ export type String = ReturnType<typeof String["createWithUnknownOrThrow"]>;
26
+ export declare const Number: PrimitiveHandler<number>;
27
+ export type Number = ReturnType<typeof Number["createWithUnknownOrThrow"]>;
28
+ export declare const BigInt: PrimitiveHandler<bigint>;
29
+ export type BigInt = ReturnType<typeof BigInt["createWithUnknownOrThrow"]>;
30
+ export declare const Boolean: PrimitiveHandler<boolean>;
31
+ export type Boolean = ReturnType<typeof Boolean["createWithUnknownOrThrow"]>;
32
+ export declare const Date: PrimitiveHandler<`date${number}-` | `date${number}+`>;
33
+ export type Date = ReturnType<typeof Date["createWithUnknownOrThrow"]>;
34
+ export type Primitives = (String | Number | BigInt | Boolean | Date);
35
+ export type PrimitiveHandlers = (typeof String | typeof Number | typeof BigInt | typeof Boolean | typeof Date);
36
+ export {};
@@ -0,0 +1,64 @@
1
+ import { createCleanKind } from '../kind.mjs';
2
+ import { kindHeritage } from '../../common/kind.mjs';
3
+ import { string } from '../../dataParser/parsers/string/index.mjs';
4
+ import { number } from '../../dataParser/parsers/number/index.mjs';
5
+ import { bigint } from '../../dataParser/parsers/bigint/index.mjs';
6
+ import { boolean } from '../../dataParser/parsers/boolean.mjs';
7
+ import { date } from '../../dataParser/parsers/date.mjs';
8
+ import { createErrorKind } from '../../common/errorKindNamespace.mjs';
9
+ import { unwrap } from '../../common/unwrap.mjs';
10
+ import { isRight } from '../../either/right/is.mjs';
11
+ import { isLeft } from '../../either/left/is.mjs';
12
+ import { left } from '../../either/left/create.mjs';
13
+ import { right } from '../../either/right/create.mjs';
14
+ import { wrapValue } from '../../common/wrapValue.mjs';
15
+
16
+ const primitiveHandlerKind = createCleanKind("primitive-handler");
17
+ class CreatePrimitiveError extends kindHeritage("create-primitive-error", createErrorKind("create-primitive-error"), Error) {
18
+ data;
19
+ dataParserError;
20
+ constructor(data, dataParserError) {
21
+ super({}, ["Error when create primitive."]);
22
+ this.data = data;
23
+ this.dataParserError = dataParserError;
24
+ }
25
+ }
26
+ function createPrimitive(dataParser) {
27
+ function create(data) {
28
+ const result = dataParser.parse(data);
29
+ if (isLeft(result)) {
30
+ return left("createPrimitiveError", unwrap(result));
31
+ }
32
+ else {
33
+ return right("createPrimitive", wrapValue(unwrap(result)));
34
+ }
35
+ }
36
+ function createOrThrow(data) {
37
+ const result = create(data);
38
+ if (isLeft(result)) {
39
+ throw new CreatePrimitiveError(data, unwrap(result));
40
+ }
41
+ else {
42
+ return unwrap(result);
43
+ }
44
+ }
45
+ function is(input) {
46
+ const result = dataParser.parse(unwrap(input));
47
+ return isRight(result);
48
+ }
49
+ return primitiveHandlerKind.setTo({
50
+ dataParser,
51
+ create,
52
+ createOrThrow,
53
+ createWithUnknown: create,
54
+ createWithUnknownOrThrow: createOrThrow,
55
+ is,
56
+ });
57
+ }
58
+ const String = createPrimitive(string());
59
+ const Number = createPrimitive(number());
60
+ const BigInt = createPrimitive(bigint());
61
+ const Boolean = createPrimitive(boolean());
62
+ const Date = createPrimitive(date());
63
+
64
+ export { BigInt, Boolean, CreatePrimitiveError, Date, Number, String, primitiveHandlerKind };
@@ -0,0 +1,2 @@
1
+ export * from "./base";
2
+ export * from "./operations";
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ var greaterThan = require('../../../../date/operators/greaterThan.cjs');
4
+ var unwrap = require('../../../../common/unwrap.cjs');
5
+
6
+ function dateGreaterThan(...args) {
7
+ if (args.length === 1) {
8
+ const [threshold] = args;
9
+ return (primitive) => dateGreaterThan(primitive, threshold);
10
+ }
11
+ const [primitive, threshold] = args;
12
+ return greaterThan.greaterThan(unwrap.unwrap(primitive), unwrap.unwrap(threshold));
13
+ }
14
+
15
+ exports.dateGreaterThan = dateGreaterThan;
@@ -0,0 +1,4 @@
1
+ import { type Date } from "../../base";
2
+ import { type TheDate } from "../../../../date";
3
+ export declare function dateGreaterThan(threshold: Date | TheDate): (primitive: Date) => boolean;
4
+ export declare function dateGreaterThan(primitive: Date, threshold: Date | TheDate): boolean;
@@ -0,0 +1,13 @@
1
+ import { greaterThan } from '../../../../date/operators/greaterThan.mjs';
2
+ import { unwrap } from '../../../../common/unwrap.mjs';
3
+
4
+ function dateGreaterThan(...args) {
5
+ if (args.length === 1) {
6
+ const [threshold] = args;
7
+ return (primitive) => dateGreaterThan(primitive, threshold);
8
+ }
9
+ const [primitive, threshold] = args;
10
+ return greaterThan(unwrap(primitive), unwrap(threshold));
11
+ }
12
+
13
+ export { dateGreaterThan };
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ var lessThan = require('../../../../date/operators/lessThan.cjs');
4
+ var unwrap = require('../../../../common/unwrap.cjs');
5
+
6
+ function dateLessThan(...args) {
7
+ if (args.length === 1) {
8
+ const [threshold] = args;
9
+ return (primitive) => dateLessThan(primitive, threshold);
10
+ }
11
+ const [primitive, threshold] = args;
12
+ return lessThan.lessThan(unwrap.unwrap(primitive), unwrap.unwrap(threshold));
13
+ }
14
+
15
+ exports.dateLessThan = dateLessThan;
@@ -0,0 +1,4 @@
1
+ import { type Date } from "../../base";
2
+ import { type TheDate } from "../../../../date";
3
+ export declare function dateLessThan(threshold: Date | TheDate): (primitive: Date) => boolean;
4
+ export declare function dateLessThan(primitive: Date, threshold: Date | TheDate): boolean;
@@ -0,0 +1,13 @@
1
+ import { lessThan } from '../../../../date/operators/lessThan.mjs';
2
+ import { unwrap } from '../../../../common/unwrap.mjs';
3
+
4
+ function dateLessThan(...args) {
5
+ if (args.length === 1) {
6
+ const [threshold] = args;
7
+ return (primitive) => dateLessThan(primitive, threshold);
8
+ }
9
+ const [primitive, threshold] = args;
10
+ return lessThan(unwrap(primitive), unwrap(threshold));
11
+ }
12
+
13
+ export { dateLessThan };
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ var max = require('../../../../date/max.cjs');
4
+ var wrapValue = require('../../../../common/wrapValue.cjs');
5
+ var unwrap = require('../../../../common/unwrap.cjs');
6
+
7
+ function dateMax(...input) {
8
+ if (input.length === 1) {
9
+ const [first] = input;
10
+ return (...rest) => (dateMax(...[first, ...rest]));
11
+ }
12
+ return wrapValue.wrapValue(max.max(input.map(unwrap.unwrap)));
13
+ }
14
+
15
+ exports.dateMax = dateMax;
@@ -0,0 +1,5 @@
1
+ import { type TheDate } from "../../../../date";
2
+ import { type Date } from "../../base";
3
+ import { type AnyTuple } from "../../../../common";
4
+ export declare function dateMax(first: Date | TheDate): (...rest: (Date | TheDate)[]) => Date;
5
+ export declare function dateMax(...input: AnyTuple<Date | TheDate>): Date;
@@ -0,0 +1,13 @@
1
+ import { max } from '../../../../date/max.mjs';
2
+ import { wrapValue } from '../../../../common/wrapValue.mjs';
3
+ import { unwrap } from '../../../../common/unwrap.mjs';
4
+
5
+ function dateMax(...input) {
6
+ if (input.length === 1) {
7
+ const [first] = input;
8
+ return (...rest) => (dateMax(...[first, ...rest]));
9
+ }
10
+ return wrapValue(max(input.map(unwrap)));
11
+ }
12
+
13
+ export { dateMax };
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ var min = require('../../../../date/min.cjs');
4
+ var wrapValue = require('../../../../common/wrapValue.cjs');
5
+ var unwrap = require('../../../../common/unwrap.cjs');
6
+
7
+ function dateMin(...input) {
8
+ if (input.length === 1) {
9
+ const [first] = input;
10
+ return (...rest) => (dateMin(...[first, ...rest]));
11
+ }
12
+ return wrapValue.wrapValue(min.min(input.map(unwrap.unwrap)));
13
+ }
14
+
15
+ exports.dateMin = dateMin;
@@ -0,0 +1,5 @@
1
+ import { type TheDate } from "../../../../date";
2
+ import { type Date } from "../../base";
3
+ import { type AnyTuple } from "../../../../common";
4
+ export declare function dateMin(first: Date | TheDate): (...rest: (Date | TheDate)[]) => Date;
5
+ export declare function dateMin(...input: AnyTuple<Date | TheDate>): Date;
@@ -0,0 +1,13 @@
1
+ import { min } from '../../../../date/min.mjs';
2
+ import { wrapValue } from '../../../../common/wrapValue.mjs';
3
+ import { unwrap } from '../../../../common/unwrap.mjs';
4
+
5
+ function dateMin(...input) {
6
+ if (input.length === 1) {
7
+ const [first] = input;
8
+ return (...rest) => (dateMin(...[first, ...rest]));
9
+ }
10
+ return wrapValue(min(input.map(unwrap)));
11
+ }
12
+
13
+ export { dateMin };
@@ -0,0 +1,8 @@
1
+ export * from "./dateGreaterThan";
2
+ export * from "./dateLessThan";
3
+ export * from "./dateMin";
4
+ export * from "./dateMax";
5
+ export * from "./dateGreaterThan";
6
+ export * from "./dateLessThan";
7
+ export * from "./dateMax";
8
+ export * from "./dateMin";
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ var unwrap = require('../../../common/unwrap.cjs');
4
+
5
+ function equal(...args) {
6
+ if (args.length === 1) {
7
+ const [value] = args;
8
+ return (input) => equal(input, value);
9
+ }
10
+ const [input, value] = args;
11
+ return unwrap.unwrap(input) === unwrap.unwrap(value);
12
+ }
13
+
14
+ exports.equal = equal;
@@ -0,0 +1,4 @@
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>>;
@@ -0,0 +1,12 @@
1
+ import { unwrap } from '../../../common/unwrap.mjs';
2
+
3
+ function equal(...args) {
4
+ if (args.length === 1) {
5
+ const [value] = args;
6
+ return (input) => equal(input, value);
7
+ }
8
+ const [input, value] = args;
9
+ return unwrap(input) === unwrap(value);
10
+ }
11
+
12
+ export { equal };
@@ -0,0 +1,5 @@
1
+ export * from "./equal";
2
+ export * from "./number";
3
+ export * from "./string";
4
+ export * from "./date";
5
+ export * from "./sort";
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ var wrapValue = require('../../../../common/wrapValue.cjs');
4
+ var unwrap = require('../../../../common/unwrap.cjs');
5
+
6
+ function add(...args) {
7
+ if (args.length === 1) {
8
+ const [operand] = args;
9
+ return (value) => add(value, operand);
10
+ }
11
+ const [value, operand] = args;
12
+ return wrapValue.wrapValue(unwrap.unwrap(value) + unwrap.unwrap(operand));
13
+ }
14
+
15
+ exports.add = add;
@@ -0,0 +1,3 @@
1
+ import { type Number } from "../../base";
2
+ export declare function add(operand: Number | number): (value: Number) => Number;
3
+ export declare function add(value: Number, operand: Number | number): Number;
@@ -0,0 +1,13 @@
1
+ import { wrapValue } from '../../../../common/wrapValue.mjs';
2
+ import { unwrap } from '../../../../common/unwrap.mjs';
3
+
4
+ function add(...args) {
5
+ if (args.length === 1) {
6
+ const [operand] = args;
7
+ return (value) => add(value, operand);
8
+ }
9
+ const [value, operand] = args;
10
+ return wrapValue(unwrap(value) + unwrap(operand));
11
+ }
12
+
13
+ export { add };
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ var wrapValue = require('../../../../common/wrapValue.cjs');
4
+ var unwrap = require('../../../../common/unwrap.cjs');
5
+
6
+ function divide(...args) {
7
+ if (args.length === 1) {
8
+ const [divisor] = args;
9
+ return (value) => divide(value, divisor);
10
+ }
11
+ const [value, divisor] = args;
12
+ return wrapValue.wrapValue(unwrap.unwrap(value) / unwrap.unwrap(divisor));
13
+ }
14
+
15
+ exports.divide = divide;
@@ -0,0 +1,3 @@
1
+ import { type Number } from "../../base";
2
+ export declare function divide(divisor: Number | number): (value: Number) => Number;
3
+ export declare function divide(value: Number, divisor: Number | number): Number;
@@ -0,0 +1,13 @@
1
+ import { wrapValue } from '../../../../common/wrapValue.mjs';
2
+ import { unwrap } from '../../../../common/unwrap.mjs';
3
+
4
+ function divide(...args) {
5
+ if (args.length === 1) {
6
+ const [divisor] = args;
7
+ return (value) => divide(value, divisor);
8
+ }
9
+ const [value, divisor] = args;
10
+ return wrapValue(unwrap(value) / unwrap(divisor));
11
+ }
12
+
13
+ export { divide };
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ var unwrap = require('../../../../common/unwrap.cjs');
4
+
5
+ function greaterThan(...args) {
6
+ if (args.length === 1) {
7
+ const [threshold] = args;
8
+ return (primitive) => greaterThan(primitive, threshold);
9
+ }
10
+ const [primitive, threshold] = args;
11
+ return unwrap.unwrap(primitive) > unwrap.unwrap(threshold);
12
+ }
13
+
14
+ exports.greaterThan = greaterThan;
@@ -0,0 +1,3 @@
1
+ import { type Number } from "../../base";
2
+ export declare function greaterThan(threshold: Number | number): (value: Number) => boolean;
3
+ export declare function greaterThan(primitive: Number, threshold: Number | number): boolean;
@@ -0,0 +1,12 @@
1
+ import { unwrap } from '../../../../common/unwrap.mjs';
2
+
3
+ function greaterThan(...args) {
4
+ if (args.length === 1) {
5
+ const [threshold] = args;
6
+ return (primitive) => greaterThan(primitive, threshold);
7
+ }
8
+ const [primitive, threshold] = args;
9
+ return unwrap(primitive) > unwrap(threshold);
10
+ }
11
+
12
+ export { greaterThan };
@@ -0,0 +1,8 @@
1
+ export * from "./add";
2
+ export * from "./divide";
3
+ export * from "./greaterThan";
4
+ export * from "./lessThan";
5
+ export * from "./max";
6
+ export * from "./min";
7
+ export * from "./multiply";
8
+ export * from "./subtract";
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ var unwrap = require('../../../../common/unwrap.cjs');
4
+
5
+ function lessThan(...args) {
6
+ if (args.length === 1) {
7
+ const [threshold] = args;
8
+ return (primitive) => lessThan(primitive, threshold);
9
+ }
10
+ const [primitive, threshold] = args;
11
+ return unwrap.unwrap(primitive) < unwrap.unwrap(threshold);
12
+ }
13
+
14
+ exports.lessThan = lessThan;
@@ -0,0 +1,3 @@
1
+ import { type Number } from "../../base";
2
+ export declare function lessThan(threshold: Number | number): (value: Number) => boolean;
3
+ export declare function lessThan(primitive: Number, threshold: Number | number): boolean;
@@ -0,0 +1,12 @@
1
+ import { unwrap } from '../../../../common/unwrap.mjs';
2
+
3
+ function lessThan(...args) {
4
+ if (args.length === 1) {
5
+ const [threshold] = args;
6
+ return (primitive) => lessThan(primitive, threshold);
7
+ }
8
+ const [primitive, threshold] = args;
9
+ return unwrap(primitive) < unwrap(threshold);
10
+ }
11
+
12
+ export { lessThan };
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ var wrapValue = require('../../../../common/wrapValue.cjs');
4
+ var unwrap = require('../../../../common/unwrap.cjs');
5
+
6
+ function max(input) {
7
+ return wrapValue.wrapValue(Math.max(...input.map(unwrap.unwrap)));
8
+ }
9
+
10
+ exports.max = max;
@@ -0,0 +1,3 @@
1
+ import { type AnyTuple } from "../../../../common";
2
+ import { type Number } from "../../base";
3
+ export declare function max(input: AnyTuple<Number | number>): Number;
@@ -0,0 +1,8 @@
1
+ import { wrapValue } from '../../../../common/wrapValue.mjs';
2
+ import { unwrap } from '../../../../common/unwrap.mjs';
3
+
4
+ function max(input) {
5
+ return wrapValue(Math.max(...input.map(unwrap)));
6
+ }
7
+
8
+ export { max };
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ var wrapValue = require('../../../../common/wrapValue.cjs');
4
+ var unwrap = require('../../../../common/unwrap.cjs');
5
+
6
+ function min(input) {
7
+ return wrapValue.wrapValue(Math.min(...input.map(unwrap.unwrap)));
8
+ }
9
+
10
+ exports.min = min;
@@ -0,0 +1,3 @@
1
+ import { type AnyTuple } from "../../../../common";
2
+ import { type Number } from "../../base";
3
+ export declare function min(input: AnyTuple<Number | number>): Number;
@@ -0,0 +1,8 @@
1
+ import { wrapValue } from '../../../../common/wrapValue.mjs';
2
+ import { unwrap } from '../../../../common/unwrap.mjs';
3
+
4
+ function min(input) {
5
+ return wrapValue(Math.min(...input.map(unwrap)));
6
+ }
7
+
8
+ export { min };
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ var wrapValue = require('../../../../common/wrapValue.cjs');
4
+ var unwrap = require('../../../../common/unwrap.cjs');
5
+
6
+ function multiply(...args) {
7
+ if (args.length === 1) {
8
+ const [multiplier] = args;
9
+ return (value) => multiply(value, multiplier);
10
+ }
11
+ const [value, multiplier] = args;
12
+ return wrapValue.wrapValue(unwrap.unwrap(value) * unwrap.unwrap(multiplier));
13
+ }
14
+
15
+ exports.multiply = multiply;
@@ -0,0 +1,3 @@
1
+ import { type Number } from "../../base";
2
+ export declare function multiply(multiplier: Number | number): (value: Number) => Number;
3
+ export declare function multiply(value: Number, multiplier: Number | number): Number;
@@ -0,0 +1,13 @@
1
+ import { wrapValue } from '../../../../common/wrapValue.mjs';
2
+ import { unwrap } from '../../../../common/unwrap.mjs';
3
+
4
+ function multiply(...args) {
5
+ if (args.length === 1) {
6
+ const [multiplier] = args;
7
+ return (value) => multiply(value, multiplier);
8
+ }
9
+ const [value, multiplier] = args;
10
+ return wrapValue(unwrap(value) * unwrap(multiplier));
11
+ }
12
+
13
+ export { multiply };
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ var wrapValue = require('../../../../common/wrapValue.cjs');
4
+ var unwrap = require('../../../../common/unwrap.cjs');
5
+
6
+ function subtract(...args) {
7
+ if (args.length === 1) {
8
+ const [subtrahend] = args;
9
+ return (value) => subtract(value, subtrahend);
10
+ }
11
+ const [value, subtrahend] = args;
12
+ return wrapValue.wrapValue(unwrap.unwrap(value) - unwrap.unwrap(subtrahend));
13
+ }
14
+
15
+ exports.subtract = subtract;
@@ -0,0 +1,3 @@
1
+ import { type Number } from "../../base";
2
+ export declare function subtract(subtrahend: Number | number): (value: Number) => Number;
3
+ export declare function subtract(value: Number, subtrahend: Number | number): Number;
@@ -0,0 +1,13 @@
1
+ import { wrapValue } from '../../../../common/wrapValue.mjs';
2
+ import { unwrap } from '../../../../common/unwrap.mjs';
3
+
4
+ function subtract(...args) {
5
+ if (args.length === 1) {
6
+ const [subtrahend] = args;
7
+ return (value) => subtract(value, subtrahend);
8
+ }
9
+ const [value, subtrahend] = args;
10
+ return wrapValue(unwrap(value) - unwrap(subtrahend));
11
+ }
12
+
13
+ export { subtract };
@@ -0,0 +1,35 @@
1
+ 'use strict';
2
+
3
+ var unwrap = require('../../../common/unwrap.cjs');
4
+ var sort$1 = require('../../../number/sort.cjs');
5
+ var wrapValue = require('../../../common/wrapValue.cjs');
6
+ var is = require('../../../date/is.cjs');
7
+ var sort$2 = require('../../../date/sort.cjs');
8
+ var sort$3 = require('../../../string/sort.cjs');
9
+
10
+ function sort(...args) {
11
+ if (args.length === 1) {
12
+ const [type] = args;
13
+ return ((input) => sort(input, type));
14
+ }
15
+ const [input, type] = args;
16
+ const rawArray = input.map(unwrap.unwrap);
17
+ const first = rawArray.at(0);
18
+ if (!first) {
19
+ return [];
20
+ }
21
+ if (typeof first === "number") {
22
+ return sort$1.sort(rawArray, type)
23
+ .map(wrapValue.wrapValue);
24
+ }
25
+ else if (is.is(first)) {
26
+ return sort$2.sort(rawArray, type)
27
+ .map(wrapValue.wrapValue);
28
+ }
29
+ else {
30
+ return sort$3.sort(rawArray, type)
31
+ .map(wrapValue.wrapValue);
32
+ }
33
+ }
34
+
35
+ exports.sort = sort;
@@ -0,0 +1,9 @@
1
+ import { type Date, type Number, type String } from "../base";
2
+ import { type SortType } from "../../../common";
3
+ import * as DDate from "../../../date";
4
+ export declare function sort(type: SortType): (input: readonly (Date | DDate.TheDate)[]) => Date[];
5
+ export declare function sort(input: readonly (Date | DDate.TheDate)[], type: SortType): Date[];
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[];