@duplojs/utils 1.3.28 → 1.3.30

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 (218) hide show
  1. package/dist/clean/index.cjs +13 -0
  2. package/dist/clean/index.mjs +7 -1
  3. package/dist/clean/primitive/base.cjs +3 -0
  4. package/dist/clean/primitive/base.d.ts +4 -2
  5. package/dist/clean/primitive/base.mjs +3 -1
  6. package/dist/clean/primitive/operations/date/dateAddTime.cjs +16 -0
  7. package/dist/clean/primitive/operations/date/dateAddTime.d.ts +4 -0
  8. package/dist/clean/primitive/operations/date/dateAddTime.mjs +14 -0
  9. package/dist/clean/primitive/operations/date/dateMax.cjs +1 -5
  10. package/dist/clean/primitive/operations/date/dateMax.d.ts +1 -2
  11. package/dist/clean/primitive/operations/date/dateMax.mjs +1 -5
  12. package/dist/clean/primitive/operations/date/dateMin.cjs +1 -5
  13. package/dist/clean/primitive/operations/date/dateMin.d.ts +1 -2
  14. package/dist/clean/primitive/operations/date/dateMin.mjs +1 -5
  15. package/dist/clean/primitive/operations/date/dateSubtractTime.cjs +16 -0
  16. package/dist/clean/primitive/operations/date/dateSubtractTime.d.ts +4 -0
  17. package/dist/clean/primitive/operations/date/dateSubtractTime.mjs +14 -0
  18. package/dist/clean/primitive/operations/date/index.d.ts +2 -4
  19. package/dist/clean/primitive/operations/equal.d.ts +3 -3
  20. package/dist/clean/primitive/operations/index.d.ts +1 -0
  21. package/dist/clean/primitive/operations/sort.cjs +6 -0
  22. package/dist/clean/primitive/operations/sort.d.ts +4 -8
  23. package/dist/clean/primitive/operations/sort.mjs +6 -0
  24. package/dist/clean/primitive/operations/time/index.d.ts +4 -0
  25. package/dist/clean/primitive/operations/time/timeGreaterThan.cjs +15 -0
  26. package/dist/clean/primitive/operations/time/timeGreaterThan.d.ts +4 -0
  27. package/dist/clean/primitive/operations/time/timeGreaterThan.mjs +13 -0
  28. package/dist/clean/primitive/operations/time/timeLessThan.cjs +15 -0
  29. package/dist/clean/primitive/operations/time/timeLessThan.d.ts +4 -0
  30. package/dist/clean/primitive/operations/time/timeLessThan.mjs +13 -0
  31. package/dist/clean/primitive/operations/time/timeMax.cjs +12 -0
  32. package/dist/clean/primitive/operations/time/timeMax.d.ts +4 -0
  33. package/dist/clean/primitive/operations/time/timeMax.mjs +10 -0
  34. package/dist/clean/primitive/operations/time/timeMin.cjs +12 -0
  35. package/dist/clean/primitive/operations/time/timeMin.d.ts +4 -0
  36. package/dist/clean/primitive/operations/time/timeMin.mjs +10 -0
  37. package/dist/common/hasSomeKinds.cjs +17 -0
  38. package/dist/common/hasSomeKinds.d.ts +4 -0
  39. package/dist/common/hasSomeKinds.mjs +15 -0
  40. package/dist/common/index.d.ts +1 -0
  41. package/dist/common/toWrappedValue.d.ts +2 -1
  42. package/dist/dataParser/extended/coerce/index.cjs +2 -0
  43. package/dist/dataParser/extended/coerce/index.d.ts +1 -0
  44. package/dist/dataParser/extended/coerce/index.mjs +1 -0
  45. package/dist/dataParser/extended/coerce/time.cjs +12 -0
  46. package/dist/dataParser/extended/coerce/time.d.ts +7 -0
  47. package/dist/dataParser/extended/coerce/time.mjs +10 -0
  48. package/dist/dataParser/extended/index.cjs +2 -0
  49. package/dist/dataParser/extended/index.d.ts +1 -0
  50. package/dist/dataParser/extended/index.mjs +1 -0
  51. package/dist/dataParser/extended/time.cjs +22 -0
  52. package/dist/dataParser/extended/time.d.ts +34 -0
  53. package/dist/dataParser/extended/time.mjs +20 -0
  54. package/dist/dataParser/identifier.d.ts +10 -4
  55. package/dist/dataParser/index.cjs +33 -24
  56. package/dist/dataParser/index.mjs +3 -0
  57. package/dist/dataParser/parsers/coerce/index.cjs +2 -0
  58. package/dist/dataParser/parsers/coerce/index.d.ts +1 -0
  59. package/dist/dataParser/parsers/coerce/index.mjs +1 -0
  60. package/dist/dataParser/parsers/coerce/time.cjs +12 -0
  61. package/dist/dataParser/parsers/coerce/time.d.ts +6 -0
  62. package/dist/dataParser/parsers/coerce/time.mjs +10 -0
  63. package/dist/dataParser/parsers/date.cjs +6 -12
  64. package/dist/dataParser/parsers/date.mjs +6 -12
  65. package/dist/dataParser/parsers/index.d.ts +1 -0
  66. package/dist/dataParser/parsers/time/checkers/index.d.ts +2 -0
  67. package/dist/dataParser/parsers/time/checkers/max.cjs +19 -0
  68. package/dist/dataParser/parsers/time/checkers/max.d.ts +12 -0
  69. package/dist/dataParser/parsers/time/checkers/max.mjs +16 -0
  70. package/dist/dataParser/parsers/time/checkers/min.cjs +19 -0
  71. package/dist/dataParser/parsers/time/checkers/min.d.ts +12 -0
  72. package/dist/dataParser/parsers/time/checkers/min.mjs +16 -0
  73. package/dist/dataParser/parsers/time/index.cjs +47 -0
  74. package/dist/dataParser/parsers/time/index.d.ts +33 -0
  75. package/dist/dataParser/parsers/time/index.mjs +44 -0
  76. package/dist/dataParser/types/checkers.d.ts +1 -1
  77. package/dist/dataParser/types/dataParsers.d.ts +2 -2
  78. package/dist/date/applyTimezone.cjs +17 -0
  79. package/dist/date/applyTimezone.d.ts +4 -0
  80. package/dist/date/applyTimezone.mjs +15 -0
  81. package/dist/date/constants.cjs +13 -3
  82. package/dist/date/constants.d.ts +6 -1
  83. package/dist/date/constants.mjs +9 -4
  84. package/dist/date/create.cjs +62 -29
  85. package/dist/date/create.d.ts +10 -6
  86. package/dist/date/create.mjs +60 -27
  87. package/dist/date/createOrThrow.cjs +4 -1
  88. package/dist/date/createOrThrow.d.ts +5 -4
  89. package/dist/date/createOrThrow.mjs +4 -1
  90. package/dist/date/createTheDate.cjs +10 -0
  91. package/dist/date/createTheDate.d.ts +2 -0
  92. package/dist/date/createTheDate.mjs +8 -0
  93. package/dist/date/createTheTime.cjs +10 -0
  94. package/dist/date/createTheTime.d.ts +2 -0
  95. package/dist/date/createTheTime.mjs +8 -0
  96. package/dist/date/createTime.cjs +61 -0
  97. package/dist/date/createTime.d.ts +44 -0
  98. package/dist/date/createTime.mjs +59 -0
  99. package/dist/date/createTimeOrThrow.cjs +28 -0
  100. package/dist/date/createTimeOrThrow.d.ts +10 -0
  101. package/dist/date/createTimeOrThrow.mjs +25 -0
  102. package/dist/date/format.cjs +37 -0
  103. package/dist/date/format.d.ts +4 -0
  104. package/dist/date/format.mjs +35 -0
  105. package/dist/date/getTimezoneOffset.cjs +27 -0
  106. package/dist/date/getTimezoneOffset.d.ts +4 -0
  107. package/dist/date/getTimezoneOffset.mjs +25 -0
  108. package/dist/date/getters/getDayOfYear.cjs +2 -1
  109. package/dist/date/getters/getDayOfYear.mjs +2 -1
  110. package/dist/date/index.cjs +51 -2
  111. package/dist/date/index.d.ts +15 -0
  112. package/dist/date/index.mjs +25 -3
  113. package/dist/date/is.cjs +9 -1
  114. package/dist/date/is.mjs +9 -1
  115. package/dist/date/isSafeTimeValue.cjs +15 -0
  116. package/dist/date/isSafeTimeValue.d.ts +1 -0
  117. package/dist/date/isSafeTimeValue.mjs +13 -0
  118. package/dist/date/isSafeTimestamp.cjs +3 -3
  119. package/dist/date/isSafeTimestamp.d.ts +1 -1
  120. package/dist/date/isSafeTimestamp.mjs +3 -3
  121. package/dist/date/isTime.cjs +17 -0
  122. package/dist/date/isTime.d.ts +2 -0
  123. package/dist/date/isTime.mjs +15 -0
  124. package/dist/date/makeSafeTimeValue.cjs +20 -0
  125. package/dist/date/makeSafeTimeValue.d.ts +1 -0
  126. package/dist/date/makeSafeTimeValue.mjs +18 -0
  127. package/dist/date/makeSafeTimestamp.cjs +20 -0
  128. package/dist/date/makeSafeTimestamp.d.ts +1 -0
  129. package/dist/date/makeSafeTimestamp.mjs +18 -0
  130. package/dist/date/maxTime.cjs +10 -0
  131. package/dist/date/maxTime.d.ts +3 -0
  132. package/dist/date/maxTime.mjs +8 -0
  133. package/dist/date/minTime.cjs +10 -0
  134. package/dist/date/minTime.d.ts +3 -0
  135. package/dist/date/minTime.mjs +8 -0
  136. package/dist/date/operators/addDays.cjs +2 -3
  137. package/dist/date/operators/addDays.mjs +2 -3
  138. package/dist/date/operators/addHours.cjs +2 -3
  139. package/dist/date/operators/addHours.mjs +2 -3
  140. package/dist/date/operators/addMilliseconds.cjs +2 -3
  141. package/dist/date/operators/addMilliseconds.mjs +2 -3
  142. package/dist/date/operators/addMinutes.cjs +2 -3
  143. package/dist/date/operators/addMinutes.mjs +2 -3
  144. package/dist/date/operators/addMonths.cjs +2 -3
  145. package/dist/date/operators/addMonths.mjs +2 -3
  146. package/dist/date/operators/addSeconds.cjs +2 -3
  147. package/dist/date/operators/addSeconds.mjs +2 -3
  148. package/dist/date/operators/addTime.cjs +21 -0
  149. package/dist/date/operators/addTime.d.ts +5 -0
  150. package/dist/date/operators/addTime.mjs +19 -0
  151. package/dist/date/operators/addWeeks.cjs +2 -3
  152. package/dist/date/operators/addWeeks.mjs +2 -3
  153. package/dist/date/operators/addYears.cjs +2 -3
  154. package/dist/date/operators/addYears.mjs +2 -3
  155. package/dist/date/operators/betweenThanTime.cjs +17 -0
  156. package/dist/date/operators/betweenThanTime.d.ts +3 -0
  157. package/dist/date/operators/betweenThanTime.mjs +15 -0
  158. package/dist/date/operators/betweenTime.cjs +17 -0
  159. package/dist/date/operators/betweenTime.d.ts +3 -0
  160. package/dist/date/operators/betweenTime.mjs +15 -0
  161. package/dist/date/operators/greaterThanTime.cjs +16 -0
  162. package/dist/date/operators/greaterThanTime.d.ts +3 -0
  163. package/dist/date/operators/greaterThanTime.mjs +14 -0
  164. package/dist/date/operators/greaterTime.cjs +16 -0
  165. package/dist/date/operators/greaterTime.d.ts +3 -0
  166. package/dist/date/operators/greaterTime.mjs +14 -0
  167. package/dist/date/operators/index.d.ts +8 -0
  168. package/dist/date/operators/lessThanTime.cjs +16 -0
  169. package/dist/date/operators/lessThanTime.d.ts +3 -0
  170. package/dist/date/operators/lessThanTime.mjs +14 -0
  171. package/dist/date/operators/lessTime.cjs +16 -0
  172. package/dist/date/operators/lessTime.d.ts +3 -0
  173. package/dist/date/operators/lessTime.mjs +14 -0
  174. package/dist/date/operators/subtractDays.cjs +2 -3
  175. package/dist/date/operators/subtractDays.mjs +2 -3
  176. package/dist/date/operators/subtractHours.cjs +2 -3
  177. package/dist/date/operators/subtractHours.mjs +2 -3
  178. package/dist/date/operators/subtractMilliseconds.cjs +2 -3
  179. package/dist/date/operators/subtractMilliseconds.mjs +2 -3
  180. package/dist/date/operators/subtractMinutes.cjs +2 -3
  181. package/dist/date/operators/subtractMinutes.mjs +2 -3
  182. package/dist/date/operators/subtractMonths.cjs +2 -3
  183. package/dist/date/operators/subtractMonths.mjs +2 -3
  184. package/dist/date/operators/subtractSeconds.cjs +2 -3
  185. package/dist/date/operators/subtractSeconds.mjs +2 -3
  186. package/dist/date/operators/subtractTime.cjs +21 -0
  187. package/dist/date/operators/subtractTime.d.ts +5 -0
  188. package/dist/date/operators/subtractTime.mjs +19 -0
  189. package/dist/date/operators/subtractWeeks.cjs +2 -3
  190. package/dist/date/operators/subtractWeeks.mjs +2 -3
  191. package/dist/date/operators/subtractYears.cjs +2 -3
  192. package/dist/date/operators/subtractYears.mjs +2 -3
  193. package/dist/date/sortTimes.cjs +20 -0
  194. package/dist/date/sortTimes.d.ts +4 -0
  195. package/dist/date/sortTimes.mjs +18 -0
  196. package/dist/date/{types/timezone.cjs → timezone.cjs} +1 -1
  197. package/dist/date/{types/timezone.d.ts → timezone.d.ts} +1 -1
  198. package/dist/date/{types/timezone.mjs → timezone.mjs} +1 -1
  199. package/dist/date/toTimeValue.cjs +14 -0
  200. package/dist/date/toTimeValue.d.ts +2 -0
  201. package/dist/date/toTimeValue.mjs +12 -0
  202. package/dist/date/toTimestamp.cjs +6 -21
  203. package/dist/date/toTimestamp.d.ts +0 -8
  204. package/dist/date/toTimestamp.mjs +8 -22
  205. package/dist/date/types/index.d.ts +3 -1
  206. package/dist/date/types/isSafeYear.d.ts +5 -52
  207. package/dist/date/types/spoolingDate.d.ts +12 -0
  208. package/dist/date/types/spoolingTime.d.ts +9 -0
  209. package/dist/date/types/theTime.d.ts +1 -0
  210. package/dist/index.cjs +2 -0
  211. package/dist/index.mjs +1 -0
  212. package/dist/metadata.json +368 -5
  213. package/dist/number/types/index.d.ts +2 -0
  214. package/dist/number/types/isGreater.d.ts +50 -0
  215. package/dist/number/types/isLess.d.ts +3 -0
  216. package/dist/string/types/index.d.ts +1 -0
  217. package/dist/string/types/replace.d.ts +1 -0
  218. package/package.json +1 -1
@@ -26,9 +26,15 @@ var lengthLessThan = require('./primitive/operations/string/lengthLessThan.cjs')
26
26
  var concat = require('./primitive/operations/string/concat.cjs');
27
27
  var dateGreaterThan = require('./primitive/operations/date/dateGreaterThan.cjs');
28
28
  var dateLessThan = require('./primitive/operations/date/dateLessThan.cjs');
29
+ var dateAddTime = require('./primitive/operations/date/dateAddTime.cjs');
30
+ var dateSubtractTime = require('./primitive/operations/date/dateSubtractTime.cjs');
29
31
  var dateMin = require('./primitive/operations/date/dateMin.cjs');
30
32
  var dateMax = require('./primitive/operations/date/dateMax.cjs');
31
33
  var sort = require('./primitive/operations/sort.cjs');
34
+ var timeGreaterThan = require('./primitive/operations/time/timeGreaterThan.cjs');
35
+ var timeLessThan = require('./primitive/operations/time/timeLessThan.cjs');
36
+ var timeMin = require('./primitive/operations/time/timeMin.cjs');
37
+ var timeMax = require('./primitive/operations/time/timeMax.cjs');
32
38
 
33
39
 
34
40
 
@@ -62,6 +68,7 @@ exports.CreatePrimitiveError = base$1.CreatePrimitiveError;
62
68
  exports.Date = base$1.Date;
63
69
  exports.Number = base$1.Number;
64
70
  exports.String = base$1.String;
71
+ exports.Time = base$1.Time;
65
72
  exports.primitiveHandlerKind = base$1.primitiveHandlerKind;
66
73
  exports.equal = equal.equal;
67
74
  exports.add = add.add;
@@ -79,6 +86,12 @@ exports.lengthLessThan = lengthLessThan.lengthLessThan;
79
86
  exports.concat = concat.concat;
80
87
  exports.dateGreaterThan = dateGreaterThan.dateGreaterThan;
81
88
  exports.dateLessThan = dateLessThan.dateLessThan;
89
+ exports.dateAddTime = dateAddTime.dateAddTime;
90
+ exports.dateSubtractTime = dateSubtractTime.dateSubtractTime;
82
91
  exports.dateMin = dateMin.dateMin;
83
92
  exports.dateMax = dateMax.dateMax;
84
93
  exports.sort = sort.sort;
94
+ exports.timeGreaterThan = timeGreaterThan.timeGreaterThan;
95
+ exports.timeLessThan = timeLessThan.timeLessThan;
96
+ exports.timeMin = timeMin.timeMin;
97
+ exports.timeMax = timeMax.timeMax;
@@ -7,7 +7,7 @@ export { createFlag, flagKind } from './flag.mjs';
7
7
  export { CreateConstrainedTypeError, constrainedTypeKind, constraintHandlerKind, createConstraint } from './constraint/base.mjs';
8
8
  export { Int, Negative, Positive } from './constraint/defaultConstraint/number.mjs';
9
9
  export { Email, Url } from './constraint/defaultConstraint/string.mjs';
10
- export { BigInt, Boolean, CreatePrimitiveError, Date, Number, String, primitiveHandlerKind } from './primitive/base.mjs';
10
+ export { BigInt, Boolean, CreatePrimitiveError, Date, Number, String, Time, primitiveHandlerKind } from './primitive/base.mjs';
11
11
  export { equal } from './primitive/operations/equal.mjs';
12
12
  export { add } from './primitive/operations/number/add.mjs';
13
13
  export { divide } from './primitive/operations/number/divide.mjs';
@@ -24,6 +24,12 @@ export { lengthLessThan } from './primitive/operations/string/lengthLessThan.mjs
24
24
  export { concat } from './primitive/operations/string/concat.mjs';
25
25
  export { dateGreaterThan } from './primitive/operations/date/dateGreaterThan.mjs';
26
26
  export { dateLessThan } from './primitive/operations/date/dateLessThan.mjs';
27
+ export { dateAddTime } from './primitive/operations/date/dateAddTime.mjs';
28
+ export { dateSubtractTime } from './primitive/operations/date/dateSubtractTime.mjs';
27
29
  export { dateMin } from './primitive/operations/date/dateMin.mjs';
28
30
  export { dateMax } from './primitive/operations/date/dateMax.mjs';
29
31
  export { sort } from './primitive/operations/sort.mjs';
32
+ export { timeGreaterThan } from './primitive/operations/time/timeGreaterThan.mjs';
33
+ export { timeLessThan } from './primitive/operations/time/timeLessThan.mjs';
34
+ export { timeMin } from './primitive/operations/time/timeMin.mjs';
35
+ export { timeMax } from './primitive/operations/time/timeMax.mjs';
@@ -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 type Primitives = (String | Number | BigInt | Boolean | Date);
35
- export type PrimitiveHandlers = (typeof String | typeof Number | typeof BigInt | typeof Boolean | typeof Date);
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,4 @@
1
+ import { type Date, type Time } from "../../base";
2
+ import { type TheTime } from "../../../../date";
3
+ export declare function dateAddTime(time: Time | TheTime): (primitive: Date) => Date;
4
+ export declare function dateAddTime(primitive: Date, time: Time | TheTime): Date;
@@ -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(...input) {
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(first: Date | TheDate): (...rest: (Date | TheDate)[]) => Date;
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(...input) {
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(...input) {
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(first: Date | TheDate): (...rest: (Date | TheDate)[]) => Date;
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(...input) {
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>>;
@@ -3,3 +3,4 @@ export * from "./number";
3
3
  export * from "./string";
4
4
  export * from "./date";
5
5
  export * from "./sort";
6
+ export * from "./time";
@@ -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(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[];
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,4 @@
1
+ export * from "./timeGreaterThan";
2
+ export * from "./timeLessThan";
3
+ export * from "./timeMin";
4
+ export * from "./timeMax";
@@ -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,4 @@
1
+ import { type TheTime } from "../../../../date";
2
+ import { type Time } from "../../base";
3
+ import { type AnyTuple } from "../../../../common";
4
+ export declare function timeMax(input: AnyTuple<Time | TheTime>): Time;
@@ -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,4 @@
1
+ import { type TheTime } from "../../../../date";
2
+ import { type Time } from "../../base";
3
+ import { type AnyTuple } from "../../../../common";
4
+ export declare function timeMin(input: AnyTuple<Time | TheTime>): Time;
@@ -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,17 @@
1
+ 'use strict';
2
+
3
+ function hasSomeKinds(...args) {
4
+ if (args.length === 1) {
5
+ const [kinds] = args;
6
+ return (input) => hasSomeKinds(input, kinds);
7
+ }
8
+ const [input, kinds] = args;
9
+ for (const kind of kinds) {
10
+ if (kind.has(input)) {
11
+ return true;
12
+ }
13
+ }
14
+ return false;
15
+ }
16
+
17
+ exports.hasSomeKinds = hasSomeKinds;
@@ -0,0 +1,4 @@
1
+ import { type Kind, type KindHandler } from "./kind";
2
+ import { type AnyTuple } from "./types";
3
+ export declare function hasSomeKinds<GenericInput extends unknown, const GenericKindHandlers extends AnyTuple<KindHandler>, GenericKindHandler extends GenericKindHandlers[number]>(kinds: GenericKindHandlers): (input: GenericInput) => input is Extract<GenericInput, GenericKindHandler extends any ? Kind<GenericKindHandler["definition"]> : never>;
4
+ export declare function hasSomeKinds<GenericInput extends unknown, const GenericKindHandlers extends AnyTuple<KindHandler>, GenericKindHandler extends GenericKindHandlers[number]>(input: GenericInput, kinds: GenericKindHandlers): input is Extract<GenericInput, GenericKindHandler extends any ? Kind<GenericKindHandler["definition"]> : never>;
@@ -0,0 +1,15 @@
1
+ function hasSomeKinds(...args) {
2
+ if (args.length === 1) {
3
+ const [kinds] = args;
4
+ return (input) => hasSomeKinds(input, kinds);
5
+ }
6
+ const [input, kinds] = args;
7
+ for (const kind of kinds) {
8
+ if (kind.has(input)) {
9
+ return true;
10
+ }
11
+ }
12
+ return false;
13
+ }
14
+
15
+ export { hasSomeKinds };
@@ -43,4 +43,5 @@ export * from "./override";
43
43
  export * from "./errorKindNamespace";
44
44
  export * from "./truthy";
45
45
  export * from "./falsy";
46
+ export * from "./hasSomeKinds";
46
47
  export * from "./hasKinds";
@@ -1,4 +1,5 @@
1
1
  import { type WrappedValue } from "../common/wrapValue";
2
2
  import { type MaybeWrapped } from "./types/maybeWrapped";
3
3
  import { type AnyValue } from "./types";
4
- export declare function toWrappedValue<GenericInnerValue extends AnyValue, GenericValue extends MaybeWrapped<GenericInnerValue>>(value: GenericValue): GenericValue extends WrappedValue ? GenericValue : WrappedValue<GenericValue>;
4
+ export type ToWrappedValue<GenericValue extends unknown> = GenericValue extends WrappedValue ? GenericValue : WrappedValue<GenericValue>;
5
+ export declare function toWrappedValue<GenericInnerValue extends AnyValue, GenericValue extends MaybeWrapped<GenericInnerValue>>(value: GenericValue): ToWrappedValue<GenericValue>;
@@ -3,6 +3,7 @@
3
3
  var bigint = require('./bigint.cjs');
4
4
  var boolean = require('./boolean.cjs');
5
5
  var date = require('./date.cjs');
6
+ var time = require('./time.cjs');
6
7
  var empty = require('./empty.cjs');
7
8
  var nil = require('./nil.cjs');
8
9
  var number = require('./number.cjs');
@@ -13,6 +14,7 @@ var string = require('./string.cjs');
13
14
  exports.bigint = bigint.bigint;
14
15
  exports.boolean = boolean.boolean;
15
16
  exports.date = date.date;
17
+ exports.time = time.time;
16
18
  exports.empty = empty.empty;
17
19
  exports.nil = nil.nil;
18
20
  exports.number = number.number;
@@ -1,6 +1,7 @@
1
1
  export * from "./bigint";
2
2
  export * from "./boolean";
3
3
  export * from "./date";
4
+ export * from "./time";
4
5
  export * from "./empty";
5
6
  export * from "./nil";
6
7
  export * from "./number";
@@ -1,6 +1,7 @@
1
1
  export { bigint } from './bigint.mjs';
2
2
  export { boolean } from './boolean.mjs';
3
3
  export { date } from './date.mjs';
4
+ export { time } from './time.mjs';
4
5
  export { empty } from './empty.mjs';
5
6
  export { nil } from './nil.mjs';
6
7
  export { number } from './number.mjs';
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ var time$1 = require('../time.cjs');
4
+
5
+ function time(definition) {
6
+ return time$1.time({
7
+ ...definition,
8
+ coerce: true,
9
+ });
10
+ }
11
+
12
+ exports.time = time;
@@ -0,0 +1,7 @@
1
+ import { type NeverCoalescing } from "../../../common";
2
+ import { type MergeDefinition } from "../../types";
3
+ import type * as dataParsers from "../../parsers";
4
+ import * as dataParsersExtended from "..";
5
+ export declare function time<const GenericDefinition extends Partial<Omit<dataParsers.DataParserDefinitionTime, "coerce">> = never>(definition?: GenericDefinition): dataParsersExtended.DataParserTimeExtended<MergeDefinition<dataParsers.DataParserDefinitionTime, NeverCoalescing<GenericDefinition, {}> & {
6
+ coerce: true;
7
+ }>>;
@@ -0,0 +1,10 @@
1
+ import { time as time$1 } from '../time.mjs';
2
+
3
+ function time(definition) {
4
+ return time$1({
5
+ ...definition,
6
+ coerce: true,
7
+ });
8
+ }
9
+
10
+ export { time };