@duplojs/utils 1.1.15 → 1.2.16

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 (480) hide show
  1. package/dist/array/reduce.cjs +25 -0
  2. package/dist/array/reduce.mjs +25 -0
  3. package/dist/array/reduceRight.cjs +25 -0
  4. package/dist/array/reduceRight.mjs +25 -0
  5. package/dist/array/types/extractTuple.d.ts +1 -1
  6. package/dist/common/asyncInnerPipe.d.ts +16 -11
  7. package/dist/common/asyncPipe.d.ts +16 -11
  8. package/dist/common/builder.cjs +5 -11
  9. package/dist/common/builder.d.ts +7 -7
  10. package/dist/common/builder.mjs +4 -10
  11. package/dist/common/createKindIdentifier.cjs +23 -0
  12. package/dist/common/createKindIdentifier.mjs +23 -0
  13. package/dist/common/equal.d.ts +4 -4
  14. package/dist/common/errorKindNamespace.cjs +9 -0
  15. package/dist/common/errorKindNamespace.d.ts +1 -0
  16. package/dist/common/errorKindNamespace.mjs +7 -0
  17. package/dist/common/forwardLog.cjs +8 -0
  18. package/dist/common/forwardLog.d.ts +1 -0
  19. package/dist/common/forwardLog.mjs +6 -0
  20. package/dist/common/index.d.ts +3 -0
  21. package/dist/common/innerPipe.d.ts +16 -11
  22. package/dist/common/instanceOf.cjs +25 -0
  23. package/dist/common/instanceOf.mjs +25 -0
  24. package/dist/common/kind.d.ts +1 -0
  25. package/dist/common/override.cjs +61 -0
  26. package/dist/common/override.d.ts +18 -0
  27. package/dist/common/override.mjs +59 -0
  28. package/dist/common/pipe.d.ts +16 -11
  29. package/dist/common/stringToBytes.cjs +4 -9
  30. package/dist/common/stringToBytes.d.ts +4 -4
  31. package/dist/common/stringToBytes.mjs +4 -9
  32. package/dist/common/stringToMillisecond.cjs +4 -9
  33. package/dist/common/stringToMillisecond.d.ts +4 -4
  34. package/dist/common/stringToMillisecond.mjs +4 -9
  35. package/dist/common/types/objectEntry.d.ts +1 -1
  36. package/dist/dataParser/base.cjs +27 -2
  37. package/dist/dataParser/base.d.ts +3 -0
  38. package/dist/dataParser/base.mjs +27 -2
  39. package/dist/dataParser/baseExtended.cjs +65 -5
  40. package/dist/dataParser/baseExtended.d.ts +3 -0
  41. package/dist/dataParser/baseExtended.mjs +65 -5
  42. package/dist/dataParser/extended/array.cjs +50 -4
  43. package/dist/dataParser/extended/array.d.ts +3 -0
  44. package/dist/dataParser/extended/array.mjs +50 -4
  45. package/dist/dataParser/extended/bigint.cjs +50 -4
  46. package/dist/dataParser/extended/bigint.d.ts +3 -0
  47. package/dist/dataParser/extended/bigint.mjs +50 -4
  48. package/dist/dataParser/extended/boolean.cjs +50 -4
  49. package/dist/dataParser/extended/boolean.d.ts +3 -0
  50. package/dist/dataParser/extended/boolean.mjs +50 -4
  51. package/dist/dataParser/extended/coerce/bigint.cjs +21 -4
  52. package/dist/dataParser/extended/coerce/bigint.mjs +21 -4
  53. package/dist/dataParser/extended/coerce/boolean.cjs +21 -4
  54. package/dist/dataParser/extended/coerce/boolean.mjs +21 -4
  55. package/dist/dataParser/extended/coerce/date.cjs +33 -0
  56. package/dist/dataParser/extended/coerce/date.d.ts +7 -0
  57. package/dist/dataParser/extended/coerce/date.mjs +31 -0
  58. package/dist/dataParser/extended/coerce/empty.cjs +21 -4
  59. package/dist/dataParser/extended/coerce/empty.mjs +21 -4
  60. package/dist/dataParser/extended/coerce/index.cjs +2 -0
  61. package/dist/dataParser/extended/coerce/index.d.ts +1 -0
  62. package/dist/dataParser/extended/coerce/index.mjs +1 -0
  63. package/dist/dataParser/extended/coerce/nil.cjs +21 -4
  64. package/dist/dataParser/extended/coerce/nil.mjs +21 -4
  65. package/dist/dataParser/extended/coerce/number.cjs +21 -4
  66. package/dist/dataParser/extended/coerce/number.mjs +21 -4
  67. package/dist/dataParser/extended/coerce/string.cjs +21 -4
  68. package/dist/dataParser/extended/coerce/string.mjs +21 -4
  69. package/dist/dataParser/extended/date.cjs +60 -0
  70. package/dist/dataParser/extended/date.d.ts +23 -0
  71. package/dist/dataParser/extended/date.mjs +58 -0
  72. package/dist/dataParser/extended/empty.cjs +50 -4
  73. package/dist/dataParser/extended/empty.d.ts +3 -0
  74. package/dist/dataParser/extended/empty.mjs +50 -4
  75. package/dist/dataParser/extended/index.cjs +15 -0
  76. package/dist/dataParser/extended/index.d.ts +3 -0
  77. package/dist/dataParser/extended/index.mjs +2 -0
  78. package/dist/dataParser/extended/lazy.cjs +50 -4
  79. package/dist/dataParser/extended/lazy.d.ts +5 -2
  80. package/dist/dataParser/extended/lazy.mjs +50 -4
  81. package/dist/dataParser/extended/literal.cjs +50 -4
  82. package/dist/dataParser/extended/literal.d.ts +3 -0
  83. package/dist/dataParser/extended/literal.mjs +50 -4
  84. package/dist/dataParser/extended/nil.cjs +50 -4
  85. package/dist/dataParser/extended/nil.d.ts +3 -0
  86. package/dist/dataParser/extended/nil.mjs +50 -4
  87. package/dist/dataParser/extended/nullable.cjs +50 -4
  88. package/dist/dataParser/extended/nullable.d.ts +3 -0
  89. package/dist/dataParser/extended/nullable.mjs +50 -4
  90. package/dist/dataParser/extended/number.cjs +50 -4
  91. package/dist/dataParser/extended/number.d.ts +3 -0
  92. package/dist/dataParser/extended/number.mjs +50 -4
  93. package/dist/dataParser/extended/object.cjs +65 -5
  94. package/dist/dataParser/extended/object.d.ts +5 -0
  95. package/dist/dataParser/extended/object.mjs +65 -5
  96. package/dist/dataParser/extended/optional.cjs +50 -4
  97. package/dist/dataParser/extended/optional.d.ts +3 -0
  98. package/dist/dataParser/extended/optional.mjs +50 -4
  99. package/dist/dataParser/extended/pipe.cjs +50 -4
  100. package/dist/dataParser/extended/pipe.d.ts +3 -0
  101. package/dist/dataParser/extended/pipe.mjs +50 -4
  102. package/dist/dataParser/extended/record.cjs +50 -4
  103. package/dist/dataParser/extended/record.d.ts +3 -0
  104. package/dist/dataParser/extended/record.mjs +50 -4
  105. package/dist/dataParser/extended/recover.cjs +50 -4
  106. package/dist/dataParser/extended/recover.d.ts +3 -0
  107. package/dist/dataParser/extended/recover.mjs +50 -4
  108. package/dist/dataParser/extended/string.cjs +51 -5
  109. package/dist/dataParser/extended/string.d.ts +3 -0
  110. package/dist/dataParser/extended/string.mjs +51 -5
  111. package/dist/dataParser/extended/templateLiteral.cjs +50 -4
  112. package/dist/dataParser/extended/templateLiteral.d.ts +3 -0
  113. package/dist/dataParser/extended/templateLiteral.mjs +50 -4
  114. package/dist/dataParser/extended/transform.cjs +50 -4
  115. package/dist/dataParser/extended/transform.d.ts +3 -0
  116. package/dist/dataParser/extended/transform.mjs +50 -4
  117. package/dist/dataParser/extended/tuple.cjs +52 -6
  118. package/dist/dataParser/extended/tuple.d.ts +3 -0
  119. package/dist/dataParser/extended/tuple.mjs +52 -6
  120. package/dist/dataParser/extended/union.cjs +50 -4
  121. package/dist/dataParser/extended/union.d.ts +3 -0
  122. package/dist/dataParser/extended/union.mjs +50 -4
  123. package/dist/dataParser/extended/unknown.cjs +50 -4
  124. package/dist/dataParser/extended/unknown.d.ts +3 -0
  125. package/dist/dataParser/extended/unknown.mjs +50 -4
  126. package/dist/dataParser/identifier.cjs +3 -0
  127. package/dist/dataParser/identifier.d.ts +52 -10
  128. package/dist/dataParser/identifier.mjs +3 -0
  129. package/dist/dataParser/index.cjs +25 -18
  130. package/dist/dataParser/index.mjs +4 -1
  131. package/dist/dataParser/kind.cjs +25 -0
  132. package/dist/dataParser/kind.mjs +25 -0
  133. package/dist/dataParser/parsers/array/index.cjs +36 -1
  134. package/dist/dataParser/parsers/array/index.d.ts +3 -0
  135. package/dist/dataParser/parsers/array/index.mjs +32 -1
  136. package/dist/dataParser/parsers/bigint/index.cjs +36 -1
  137. package/dist/dataParser/parsers/bigint/index.d.ts +3 -0
  138. package/dist/dataParser/parsers/bigint/index.mjs +32 -1
  139. package/dist/dataParser/parsers/boolean.cjs +30 -1
  140. package/dist/dataParser/parsers/boolean.d.ts +3 -0
  141. package/dist/dataParser/parsers/boolean.mjs +30 -1
  142. package/dist/dataParser/parsers/coerce/bigint.cjs +21 -4
  143. package/dist/dataParser/parsers/coerce/bigint.mjs +21 -4
  144. package/dist/dataParser/parsers/coerce/boolean.cjs +21 -4
  145. package/dist/dataParser/parsers/coerce/boolean.mjs +21 -4
  146. package/dist/dataParser/parsers/coerce/date.cjs +33 -0
  147. package/dist/dataParser/parsers/coerce/date.d.ts +6 -0
  148. package/dist/dataParser/parsers/coerce/date.mjs +31 -0
  149. package/dist/dataParser/parsers/coerce/empty.cjs +21 -4
  150. package/dist/dataParser/parsers/coerce/empty.mjs +21 -4
  151. package/dist/dataParser/parsers/coerce/index.cjs +2 -0
  152. package/dist/dataParser/parsers/coerce/index.d.ts +1 -0
  153. package/dist/dataParser/parsers/coerce/index.mjs +1 -0
  154. package/dist/dataParser/parsers/coerce/nil.cjs +21 -4
  155. package/dist/dataParser/parsers/coerce/nil.mjs +21 -4
  156. package/dist/dataParser/parsers/coerce/number.cjs +21 -4
  157. package/dist/dataParser/parsers/coerce/number.mjs +21 -4
  158. package/dist/dataParser/parsers/coerce/string.cjs +21 -4
  159. package/dist/dataParser/parsers/coerce/string.mjs +21 -4
  160. package/dist/dataParser/parsers/date.cjs +79 -0
  161. package/dist/dataParser/parsers/date.d.ts +28 -0
  162. package/dist/dataParser/parsers/date.mjs +76 -0
  163. package/dist/dataParser/parsers/empty.cjs +30 -1
  164. package/dist/dataParser/parsers/empty.d.ts +3 -0
  165. package/dist/dataParser/parsers/empty.mjs +30 -1
  166. package/dist/dataParser/parsers/index.d.ts +1 -0
  167. package/dist/dataParser/parsers/lazy.cjs +34 -4
  168. package/dist/dataParser/parsers/lazy.d.ts +7 -4
  169. package/dist/dataParser/parsers/lazy.mjs +34 -4
  170. package/dist/dataParser/parsers/literal.cjs +31 -4
  171. package/dist/dataParser/parsers/literal.d.ts +3 -0
  172. package/dist/dataParser/parsers/literal.mjs +31 -4
  173. package/dist/dataParser/parsers/nil.cjs +30 -1
  174. package/dist/dataParser/parsers/nil.d.ts +3 -0
  175. package/dist/dataParser/parsers/nil.mjs +30 -1
  176. package/dist/dataParser/parsers/nullable.cjs +30 -1
  177. package/dist/dataParser/parsers/nullable.d.ts +3 -0
  178. package/dist/dataParser/parsers/nullable.mjs +30 -1
  179. package/dist/dataParser/parsers/number/index.cjs +40 -1
  180. package/dist/dataParser/parsers/number/index.d.ts +3 -0
  181. package/dist/dataParser/parsers/number/index.mjs +33 -1
  182. package/dist/dataParser/parsers/{object.cjs → object/index.cjs} +39 -12
  183. package/dist/dataParser/parsers/{object.d.ts → object/index.d.ts} +16 -12
  184. package/dist/dataParser/parsers/{object.mjs → object/index.mjs} +39 -12
  185. package/dist/dataParser/parsers/object/omit.cjs +42 -0
  186. package/dist/dataParser/parsers/object/omit.d.ts +6 -0
  187. package/dist/dataParser/parsers/object/omit.mjs +40 -0
  188. package/dist/dataParser/parsers/object/pick.cjs +42 -0
  189. package/dist/dataParser/parsers/object/pick.d.ts +6 -0
  190. package/dist/dataParser/parsers/object/pick.mjs +40 -0
  191. package/dist/dataParser/parsers/optional.cjs +30 -1
  192. package/dist/dataParser/parsers/optional.d.ts +3 -0
  193. package/dist/dataParser/parsers/optional.mjs +30 -1
  194. package/dist/dataParser/parsers/pipe.cjs +30 -1
  195. package/dist/dataParser/parsers/pipe.d.ts +3 -0
  196. package/dist/dataParser/parsers/pipe.mjs +30 -1
  197. package/dist/dataParser/parsers/record/findRecordRequiredKey.cjs +26 -0
  198. package/dist/dataParser/parsers/record/findRecordRequiredKey.mjs +26 -0
  199. package/dist/dataParser/parsers/record/index.cjs +30 -1
  200. package/dist/dataParser/parsers/record/index.d.ts +3 -0
  201. package/dist/dataParser/parsers/record/index.mjs +30 -1
  202. package/dist/dataParser/parsers/recover.cjs +30 -1
  203. package/dist/dataParser/parsers/recover.d.ts +3 -0
  204. package/dist/dataParser/parsers/recover.mjs +30 -1
  205. package/dist/dataParser/parsers/string/index.cjs +47 -1
  206. package/dist/dataParser/parsers/string/index.d.ts +3 -0
  207. package/dist/dataParser/parsers/string/index.mjs +35 -1
  208. package/dist/dataParser/parsers/templateLiteral/createTemplateLiteralPattern.cjs +26 -0
  209. package/dist/dataParser/parsers/templateLiteral/createTemplateLiteralPattern.mjs +26 -0
  210. package/dist/dataParser/parsers/templateLiteral/index.cjs +28 -1
  211. package/dist/dataParser/parsers/templateLiteral/index.d.ts +3 -0
  212. package/dist/dataParser/parsers/templateLiteral/index.mjs +28 -1
  213. package/dist/dataParser/parsers/transform.cjs +30 -1
  214. package/dist/dataParser/parsers/transform.d.ts +3 -0
  215. package/dist/dataParser/parsers/transform.mjs +30 -1
  216. package/dist/dataParser/parsers/tuple.cjs +30 -1
  217. package/dist/dataParser/parsers/tuple.d.ts +3 -0
  218. package/dist/dataParser/parsers/tuple.mjs +30 -1
  219. package/dist/dataParser/parsers/union.cjs +30 -1
  220. package/dist/dataParser/parsers/union.d.ts +3 -0
  221. package/dist/dataParser/parsers/union.mjs +30 -1
  222. package/dist/dataParser/parsers/unknown.cjs +30 -1
  223. package/dist/dataParser/parsers/unknown.d.ts +3 -0
  224. package/dist/dataParser/parsers/unknown.mjs +30 -1
  225. package/dist/dataParser/types/dataParsers.d.ts +2 -2
  226. package/dist/date/closestTo.cjs +32 -0
  227. package/dist/date/closestTo.d.ts +7 -0
  228. package/dist/date/closestTo.mjs +30 -0
  229. package/dist/date/constants.cjs +29 -0
  230. package/dist/date/constants.d.ts +13 -0
  231. package/dist/date/constants.mjs +15 -0
  232. package/dist/date/create.cjs +75 -0
  233. package/dist/date/create.d.ts +16 -0
  234. package/dist/date/create.mjs +73 -0
  235. package/dist/date/createOrThrow.cjs +52 -0
  236. package/dist/date/createOrThrow.d.ts +10 -0
  237. package/dist/date/createOrThrow.mjs +49 -0
  238. package/dist/date/each.cjs +47 -0
  239. package/dist/date/each.d.ts +5 -0
  240. package/dist/date/each.mjs +45 -0
  241. package/dist/date/getters/getDayOfMonth.cjs +47 -0
  242. package/dist/date/getters/getDayOfMonth.d.ts +2 -0
  243. package/dist/date/getters/getDayOfMonth.mjs +45 -0
  244. package/dist/date/getters/getDayOfWeek.cjs +57 -0
  245. package/dist/date/getters/getDayOfWeek.d.ts +2 -0
  246. package/dist/date/getters/getDayOfWeek.mjs +55 -0
  247. package/dist/date/getters/getDayOfYear.cjs +64 -0
  248. package/dist/date/getters/getDayOfYear.d.ts +2 -0
  249. package/dist/date/getters/getDayOfYear.mjs +62 -0
  250. package/dist/date/getters/getFirstDayOfMonth.cjs +14 -0
  251. package/dist/date/getters/getFirstDayOfMonth.d.ts +2 -0
  252. package/dist/date/getters/getFirstDayOfMonth.mjs +12 -0
  253. package/dist/date/getters/getFirstDayOfWeek.cjs +16 -0
  254. package/dist/date/getters/getFirstDayOfWeek.d.ts +2 -0
  255. package/dist/date/getters/getFirstDayOfWeek.mjs +14 -0
  256. package/dist/date/getters/getHour.cjs +48 -0
  257. package/dist/date/getters/getHour.d.ts +2 -0
  258. package/dist/date/getters/getHour.mjs +46 -0
  259. package/dist/date/getters/getLastDayOfMonth.cjs +14 -0
  260. package/dist/date/getters/getLastDayOfMonth.d.ts +2 -0
  261. package/dist/date/getters/getLastDayOfMonth.mjs +12 -0
  262. package/dist/date/getters/getLastDayOfWeek.cjs +16 -0
  263. package/dist/date/getters/getLastDayOfWeek.d.ts +2 -0
  264. package/dist/date/getters/getLastDayOfWeek.mjs +14 -0
  265. package/dist/date/getters/getMilliseconds.cjs +40 -0
  266. package/dist/date/getters/getMilliseconds.d.ts +2 -0
  267. package/dist/date/getters/getMilliseconds.mjs +38 -0
  268. package/dist/date/getters/getMinute.cjs +47 -0
  269. package/dist/date/getters/getMinute.d.ts +2 -0
  270. package/dist/date/getters/getMinute.mjs +45 -0
  271. package/dist/date/getters/getMonth.cjs +47 -0
  272. package/dist/date/getters/getMonth.d.ts +2 -0
  273. package/dist/date/getters/getMonth.mjs +45 -0
  274. package/dist/date/getters/getSecond.cjs +47 -0
  275. package/dist/date/getters/getSecond.d.ts +2 -0
  276. package/dist/date/getters/getSecond.mjs +45 -0
  277. package/dist/date/getters/getWeekOfYear.cjs +67 -0
  278. package/dist/date/getters/getWeekOfYear.d.ts +2 -0
  279. package/dist/date/getters/getWeekOfYear.mjs +65 -0
  280. package/dist/date/getters/getYear.cjs +47 -0
  281. package/dist/date/getters/getYear.d.ts +2 -0
  282. package/dist/date/getters/getYear.mjs +45 -0
  283. package/dist/date/getters/index.d.ts +15 -0
  284. package/dist/date/index.cjs +121 -0
  285. package/dist/date/index.d.ts +18 -0
  286. package/dist/date/index.mjs +51 -0
  287. package/dist/date/isSafeTimestamp.cjs +15 -0
  288. package/dist/date/isSafeTimestamp.d.ts +1 -0
  289. package/dist/date/isSafeTimestamp.mjs +13 -0
  290. package/dist/date/now.cjs +8 -0
  291. package/dist/date/now.d.ts +1 -0
  292. package/dist/date/now.mjs +6 -0
  293. package/dist/date/operators/addDays.cjs +20 -0
  294. package/dist/date/operators/addDays.d.ts +4 -0
  295. package/dist/date/operators/addDays.mjs +18 -0
  296. package/dist/date/operators/addHours.cjs +20 -0
  297. package/dist/date/operators/addHours.d.ts +4 -0
  298. package/dist/date/operators/addHours.mjs +18 -0
  299. package/dist/date/operators/addMilliseconds.cjs +19 -0
  300. package/dist/date/operators/addMilliseconds.d.ts +4 -0
  301. package/dist/date/operators/addMilliseconds.mjs +17 -0
  302. package/dist/date/operators/addMinutes.cjs +20 -0
  303. package/dist/date/operators/addMinutes.d.ts +4 -0
  304. package/dist/date/operators/addMinutes.mjs +18 -0
  305. package/dist/date/operators/addMonths.cjs +19 -0
  306. package/dist/date/operators/addMonths.d.ts +4 -0
  307. package/dist/date/operators/addMonths.mjs +17 -0
  308. package/dist/date/operators/addSeconds.cjs +20 -0
  309. package/dist/date/operators/addSeconds.d.ts +4 -0
  310. package/dist/date/operators/addSeconds.mjs +18 -0
  311. package/dist/date/operators/addWeeks.cjs +20 -0
  312. package/dist/date/operators/addWeeks.d.ts +4 -0
  313. package/dist/date/operators/addWeeks.mjs +18 -0
  314. package/dist/date/operators/addYears.cjs +19 -0
  315. package/dist/date/operators/addYears.d.ts +4 -0
  316. package/dist/date/operators/addYears.mjs +17 -0
  317. package/dist/date/operators/between.cjs +17 -0
  318. package/dist/date/operators/between.d.ts +3 -0
  319. package/dist/date/operators/between.mjs +15 -0
  320. package/dist/date/operators/betweenThan.cjs +17 -0
  321. package/dist/date/operators/betweenThan.d.ts +3 -0
  322. package/dist/date/operators/betweenThan.mjs +15 -0
  323. package/dist/date/operators/greater.cjs +16 -0
  324. package/dist/date/operators/greater.d.ts +3 -0
  325. package/dist/date/operators/greater.mjs +14 -0
  326. package/dist/date/operators/greaterThan.cjs +16 -0
  327. package/dist/date/operators/greaterThan.d.ts +3 -0
  328. package/dist/date/operators/greaterThan.mjs +14 -0
  329. package/dist/date/operators/index.d.ts +22 -0
  330. package/dist/date/operators/less.cjs +16 -0
  331. package/dist/date/operators/less.d.ts +3 -0
  332. package/dist/date/operators/less.mjs +14 -0
  333. package/dist/date/operators/lessThan.cjs +16 -0
  334. package/dist/date/operators/lessThan.d.ts +3 -0
  335. package/dist/date/operators/lessThan.mjs +14 -0
  336. package/dist/date/operators/subtractDays.cjs +20 -0
  337. package/dist/date/operators/subtractDays.d.ts +4 -0
  338. package/dist/date/operators/subtractDays.mjs +18 -0
  339. package/dist/date/operators/subtractHours.cjs +20 -0
  340. package/dist/date/operators/subtractHours.d.ts +4 -0
  341. package/dist/date/operators/subtractHours.mjs +18 -0
  342. package/dist/date/operators/subtractMilliseconds.cjs +19 -0
  343. package/dist/date/operators/subtractMilliseconds.d.ts +4 -0
  344. package/dist/date/operators/subtractMilliseconds.mjs +17 -0
  345. package/dist/date/operators/subtractMinutes.cjs +20 -0
  346. package/dist/date/operators/subtractMinutes.d.ts +4 -0
  347. package/dist/date/operators/subtractMinutes.mjs +18 -0
  348. package/dist/date/operators/subtractMonths.cjs +19 -0
  349. package/dist/date/operators/subtractMonths.d.ts +4 -0
  350. package/dist/date/operators/subtractMonths.mjs +17 -0
  351. package/dist/date/operators/subtractSeconds.cjs +20 -0
  352. package/dist/date/operators/subtractSeconds.d.ts +4 -0
  353. package/dist/date/operators/subtractSeconds.mjs +18 -0
  354. package/dist/date/operators/subtractWeeks.cjs +20 -0
  355. package/dist/date/operators/subtractWeeks.d.ts +4 -0
  356. package/dist/date/operators/subtractWeeks.mjs +18 -0
  357. package/dist/date/operators/subtractYears.cjs +19 -0
  358. package/dist/date/operators/subtractYears.d.ts +4 -0
  359. package/dist/date/operators/subtractYears.mjs +17 -0
  360. package/dist/date/round.cjs +23 -0
  361. package/dist/date/round.d.ts +3 -0
  362. package/dist/date/round.mjs +21 -0
  363. package/dist/date/toISOString.cjs +10 -0
  364. package/dist/date/toISOString.d.ts +2 -0
  365. package/dist/date/toISOString.mjs +8 -0
  366. package/dist/date/toNative.cjs +10 -0
  367. package/dist/date/toNative.d.ts +2 -0
  368. package/dist/date/toNative.mjs +8 -0
  369. package/dist/date/toTimestamp.cjs +58 -0
  370. package/dist/date/toTimestamp.d.ts +10 -0
  371. package/dist/date/toTimestamp.mjs +55 -0
  372. package/dist/date/today.cjs +8 -0
  373. package/dist/date/today.d.ts +1 -0
  374. package/dist/date/today.mjs +6 -0
  375. package/dist/date/tomorrow.cjs +10 -0
  376. package/dist/date/tomorrow.d.ts +1 -0
  377. package/dist/date/tomorrow.mjs +8 -0
  378. package/dist/date/types/index.d.ts +6 -0
  379. package/dist/date/types/isLeapYear.d.ts +8 -0
  380. package/dist/date/types/month.d.ts +9 -0
  381. package/dist/date/types/theDate.d.ts +1 -0
  382. package/dist/date/types/time.d.ts +5 -0
  383. package/dist/date/types/timezone.cjs +606 -0
  384. package/dist/date/types/timezone.d.ts +604 -0
  385. package/dist/date/types/timezone.mjs +604 -0
  386. package/dist/date/types/unit.d.ts +1 -0
  387. package/dist/date/yesterday.cjs +10 -0
  388. package/dist/date/yesterday.d.ts +1 -0
  389. package/dist/date/yesterday.mjs +8 -0
  390. package/dist/either/bool/falsy.cjs +22 -1
  391. package/dist/either/bool/falsy.mjs +22 -1
  392. package/dist/either/bool/truthy.cjs +23 -2
  393. package/dist/either/bool/truthy.mjs +23 -2
  394. package/dist/either/future/create.cjs +25 -2
  395. package/dist/either/future/create.mjs +25 -2
  396. package/dist/either/future/error.cjs +21 -0
  397. package/dist/either/future/error.mjs +21 -0
  398. package/dist/either/future/success.cjs +21 -0
  399. package/dist/either/future/success.mjs +21 -0
  400. package/dist/either/hasInformation.cjs +6 -1
  401. package/dist/either/hasInformation.d.ts +1 -0
  402. package/dist/either/hasInformation.mjs +6 -1
  403. package/dist/either/kind.cjs +24 -0
  404. package/dist/either/kind.mjs +24 -0
  405. package/dist/either/left/when.cjs +25 -0
  406. package/dist/either/left/when.mjs +25 -0
  407. package/dist/either/nullable/empty.cjs +22 -1
  408. package/dist/either/nullable/empty.mjs +22 -1
  409. package/dist/either/nullable/filled.cjs +23 -2
  410. package/dist/either/nullable/filled.mjs +23 -2
  411. package/dist/either/nullish/empty.cjs +22 -1
  412. package/dist/either/nullish/empty.mjs +22 -1
  413. package/dist/either/nullish/filled.cjs +23 -2
  414. package/dist/either/nullish/filled.mjs +23 -2
  415. package/dist/either/optional/empty.cjs +21 -0
  416. package/dist/either/optional/empty.mjs +21 -0
  417. package/dist/either/optional/filled.cjs +23 -2
  418. package/dist/either/optional/filled.mjs +23 -2
  419. package/dist/either/right/asyncPipe.cjs +25 -1
  420. package/dist/either/right/asyncPipe.d.ts +5 -0
  421. package/dist/either/right/asyncPipe.mjs +25 -1
  422. package/dist/either/right/pipe.cjs +25 -1
  423. package/dist/either/right/pipe.d.ts +5 -0
  424. package/dist/either/right/pipe.mjs +25 -1
  425. package/dist/either/right/when.cjs +25 -0
  426. package/dist/either/right/when.mjs +25 -0
  427. package/dist/either/whenHasInformation.cjs +25 -1
  428. package/dist/either/whenHasInformation.d.ts +2 -2
  429. package/dist/either/whenHasInformation.mjs +25 -1
  430. package/dist/generator/asyncReduce.cjs +25 -0
  431. package/dist/generator/asyncReduce.mjs +25 -0
  432. package/dist/generator/reduce.cjs +25 -0
  433. package/dist/generator/reduce.mjs +25 -0
  434. package/dist/index.cjs +9 -0
  435. package/dist/index.d.ts +2 -0
  436. package/dist/index.mjs +6 -0
  437. package/dist/number/between.cjs +12 -0
  438. package/dist/number/between.d.ts +2 -0
  439. package/dist/number/between.mjs +10 -0
  440. package/dist/number/betweenThan.cjs +12 -0
  441. package/dist/number/betweenThan.d.ts +2 -0
  442. package/dist/number/betweenThan.mjs +10 -0
  443. package/dist/number/index.cjs +4 -0
  444. package/dist/number/index.d.ts +3 -0
  445. package/dist/number/index.mjs +2 -0
  446. package/dist/number/types/index.d.ts +1 -0
  447. package/dist/number/types/positiveNumber.d.ts +1 -0
  448. package/dist/object/deepDiscriminate.cjs +25 -0
  449. package/dist/object/deepDiscriminate.mjs +25 -0
  450. package/dist/object/discriminate.cjs +25 -0
  451. package/dist/object/discriminate.mjs +25 -0
  452. package/dist/object/entries.cjs +25 -0
  453. package/dist/object/entries.mjs +25 -0
  454. package/dist/object/entry.d.ts +2 -2
  455. package/dist/object/fromEntries.d.ts +5 -3
  456. package/dist/object/keys.cjs +25 -0
  457. package/dist/object/keys.mjs +25 -0
  458. package/dist/object/values.cjs +25 -0
  459. package/dist/object/values.mjs +25 -0
  460. package/dist/pattern/exhaustive.cjs +25 -0
  461. package/dist/pattern/exhaustive.mjs +25 -0
  462. package/dist/pattern/index.cjs +5 -2
  463. package/dist/pattern/index.mjs +2 -1
  464. package/dist/pattern/match/builder.cjs +82 -0
  465. package/dist/pattern/match/builder.d.ts +30 -0
  466. package/dist/pattern/match/builder.mjs +79 -0
  467. package/dist/pattern/match/index.cjs +28 -0
  468. package/dist/pattern/{match.d.ts → match/index.d.ts} +7 -4
  469. package/dist/pattern/match/index.mjs +25 -0
  470. package/dist/pattern/otherwise.cjs +25 -0
  471. package/dist/pattern/otherwise.mjs +25 -0
  472. package/dist/pattern/result.cjs +25 -0
  473. package/dist/pattern/result.mjs +25 -0
  474. package/dist/pattern/types/complexUnMatchedValue/array.d.ts +1 -1
  475. package/dist/string/replace.cjs +15 -0
  476. package/dist/string/replace.d.ts +10 -2
  477. package/dist/string/replace.mjs +15 -0
  478. package/package.json +6 -1
  479. package/dist/pattern/match.cjs +0 -18
  480. package/dist/pattern/match.mjs +0 -16
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ var constants = require('../constants.cjs');
4
+ var toNative = require('../toNative.cjs');
5
+
6
+ function addWeeks(...args) {
7
+ if (args.length === 1) {
8
+ const [week] = args;
9
+ return (input) => addWeeks(input, week);
10
+ }
11
+ const [input, week] = args;
12
+ const absoluteWeek = Math.abs(week);
13
+ const date = toNative.toNative(input);
14
+ date.setTime(date.getTime() + (absoluteWeek * constants.millisecondInOneWeek));
15
+ const timestamp = date.getTime();
16
+ const isNegative = timestamp < 0;
17
+ return `date${Math.abs(timestamp)}${isNegative ? "-" : "+"}`;
18
+ }
19
+
20
+ exports.addWeeks = addWeeks;
@@ -0,0 +1,4 @@
1
+ import type { TheDate } from "../types";
2
+ import type { PositiveNumber } from "../../number/types";
3
+ export declare function addWeeks<GenericInput extends TheDate, GenericWeek extends number>(week: PositiveNumber<GenericWeek>): (input: GenericInput) => TheDate;
4
+ export declare function addWeeks<GenericInput extends TheDate, GenericWeek extends number>(input: GenericInput, week: PositiveNumber<GenericWeek>): TheDate;
@@ -0,0 +1,18 @@
1
+ import { millisecondInOneWeek } from '../constants.mjs';
2
+ import { toNative } from '../toNative.mjs';
3
+
4
+ function addWeeks(...args) {
5
+ if (args.length === 1) {
6
+ const [week] = args;
7
+ return (input) => addWeeks(input, week);
8
+ }
9
+ const [input, week] = args;
10
+ const absoluteWeek = Math.abs(week);
11
+ const date = toNative(input);
12
+ date.setTime(date.getTime() + (absoluteWeek * millisecondInOneWeek));
13
+ const timestamp = date.getTime();
14
+ const isNegative = timestamp < 0;
15
+ return `date${Math.abs(timestamp)}${isNegative ? "-" : "+"}`;
16
+ }
17
+
18
+ export { addWeeks };
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ var toNative = require('../toNative.cjs');
4
+
5
+ function addYears(...args) {
6
+ if (args.length === 1) {
7
+ const [year] = args;
8
+ return (input) => addYears(input, year);
9
+ }
10
+ const [input, year] = args;
11
+ const absoluteYear = Math.abs(year);
12
+ const date = toNative.toNative(input);
13
+ date.setUTCFullYear(date.getUTCFullYear() + absoluteYear);
14
+ const timestamp = date.getTime();
15
+ const isNegative = timestamp < 0;
16
+ return `date${Math.abs(timestamp)}${isNegative ? "-" : "+"}`;
17
+ }
18
+
19
+ exports.addYears = addYears;
@@ -0,0 +1,4 @@
1
+ import type { TheDate } from "../types";
2
+ import type { PositiveNumber } from "../../number/types";
3
+ export declare function addYears<GenericInput extends TheDate, GenericYear extends number>(year: PositiveNumber<GenericYear>): (input: GenericInput) => TheDate;
4
+ export declare function addYears<GenericInput extends TheDate, GenericYear extends number>(input: GenericInput, year: PositiveNumber<GenericYear>): TheDate;
@@ -0,0 +1,17 @@
1
+ import { toNative } from '../toNative.mjs';
2
+
3
+ function addYears(...args) {
4
+ if (args.length === 1) {
5
+ const [year] = args;
6
+ return (input) => addYears(input, year);
7
+ }
8
+ const [input, year] = args;
9
+ const absoluteYear = Math.abs(year);
10
+ const date = toNative(input);
11
+ date.setUTCFullYear(date.getUTCFullYear() + absoluteYear);
12
+ const timestamp = date.getTime();
13
+ const isNegative = timestamp < 0;
14
+ return `date${Math.abs(timestamp)}${isNegative ? "-" : "+"}`;
15
+ }
16
+
17
+ export { addYears };
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ var toTimestamp = require('../toTimestamp.cjs');
4
+
5
+ function between(...args) {
6
+ if (args.length === 2) {
7
+ const [greater, less] = args;
8
+ return (input) => between(input, greater, less);
9
+ }
10
+ const [input, greater, less] = args;
11
+ const inputTimestamp = toTimestamp.toTimestamp(input);
12
+ const greaterTimestamp = toTimestamp.toTimestamp(greater);
13
+ const lessTimestamp = toTimestamp.toTimestamp(less);
14
+ return inputTimestamp >= greaterTimestamp && inputTimestamp <= lessTimestamp;
15
+ }
16
+
17
+ exports.between = between;
@@ -0,0 +1,3 @@
1
+ import type { TheDate } from "../types";
2
+ export declare function between<GenericValue extends TheDate>(greater: TheDate, less: TheDate): (input: GenericValue) => boolean;
3
+ export declare function between<GenericValue extends TheDate>(input: GenericValue, greater: TheDate, less: TheDate): boolean;
@@ -0,0 +1,15 @@
1
+ import { toTimestamp } from '../toTimestamp.mjs';
2
+
3
+ function between(...args) {
4
+ if (args.length === 2) {
5
+ const [greater, less] = args;
6
+ return (input) => between(input, greater, less);
7
+ }
8
+ const [input, greater, less] = args;
9
+ const inputTimestamp = toTimestamp(input);
10
+ const greaterTimestamp = toTimestamp(greater);
11
+ const lessTimestamp = toTimestamp(less);
12
+ return inputTimestamp >= greaterTimestamp && inputTimestamp <= lessTimestamp;
13
+ }
14
+
15
+ export { between };
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ var toTimestamp = require('../toTimestamp.cjs');
4
+
5
+ function betweenThan(...args) {
6
+ if (args.length === 2) {
7
+ const [greater, less] = args;
8
+ return (input) => betweenThan(input, greater, less);
9
+ }
10
+ const [input, greater, less] = args;
11
+ const inputTimestamp = toTimestamp.toTimestamp(input);
12
+ const greaterTimestamp = toTimestamp.toTimestamp(greater);
13
+ const lessTimestamp = toTimestamp.toTimestamp(less);
14
+ return inputTimestamp > greaterTimestamp && inputTimestamp < lessTimestamp;
15
+ }
16
+
17
+ exports.betweenThan = betweenThan;
@@ -0,0 +1,3 @@
1
+ import type { TheDate } from "../types";
2
+ export declare function betweenThan<GenericValue extends TheDate>(greater: TheDate, less: TheDate): (input: GenericValue) => boolean;
3
+ export declare function betweenThan<GenericValue extends TheDate>(input: GenericValue, greater: TheDate, less: TheDate): boolean;
@@ -0,0 +1,15 @@
1
+ import { toTimestamp } from '../toTimestamp.mjs';
2
+
3
+ function betweenThan(...args) {
4
+ if (args.length === 2) {
5
+ const [greater, less] = args;
6
+ return (input) => betweenThan(input, greater, less);
7
+ }
8
+ const [input, greater, less] = args;
9
+ const inputTimestamp = toTimestamp(input);
10
+ const greaterTimestamp = toTimestamp(greater);
11
+ const lessTimestamp = toTimestamp(less);
12
+ return inputTimestamp > greaterTimestamp && inputTimestamp < lessTimestamp;
13
+ }
14
+
15
+ export { betweenThan };
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ var toTimestamp = require('../toTimestamp.cjs');
4
+
5
+ function greater(...args) {
6
+ if (args.length === 1) {
7
+ const [threshold] = args;
8
+ return (input) => greater(input, threshold);
9
+ }
10
+ const [input, threshold] = args;
11
+ const inputTimestamp = toTimestamp.toTimestamp(input);
12
+ const thresholdTimestamp = toTimestamp.toTimestamp(threshold);
13
+ return inputTimestamp >= thresholdTimestamp;
14
+ }
15
+
16
+ exports.greater = greater;
@@ -0,0 +1,3 @@
1
+ import type { TheDate } from "../types";
2
+ export declare function greater<GenericValue extends TheDate>(threshold: TheDate): (input: GenericValue) => boolean;
3
+ export declare function greater<GenericValue extends TheDate>(input: GenericValue, threshold: TheDate): boolean;
@@ -0,0 +1,14 @@
1
+ import { toTimestamp } from '../toTimestamp.mjs';
2
+
3
+ function greater(...args) {
4
+ if (args.length === 1) {
5
+ const [threshold] = args;
6
+ return (input) => greater(input, threshold);
7
+ }
8
+ const [input, threshold] = args;
9
+ const inputTimestamp = toTimestamp(input);
10
+ const thresholdTimestamp = toTimestamp(threshold);
11
+ return inputTimestamp >= thresholdTimestamp;
12
+ }
13
+
14
+ export { greater };
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ var toTimestamp = require('../toTimestamp.cjs');
4
+
5
+ function greaterThan(...args) {
6
+ if (args.length === 1) {
7
+ const [threshold] = args;
8
+ return (input) => greaterThan(input, threshold);
9
+ }
10
+ const [input, threshold] = args;
11
+ const inputTimestamp = toTimestamp.toTimestamp(input);
12
+ const thresholdTimestamp = toTimestamp.toTimestamp(threshold);
13
+ return inputTimestamp > thresholdTimestamp;
14
+ }
15
+
16
+ exports.greaterThan = greaterThan;
@@ -0,0 +1,3 @@
1
+ import type { TheDate } from "../types";
2
+ export declare function greaterThan<GenericValue extends TheDate>(threshold: TheDate): (input: GenericValue) => boolean;
3
+ export declare function greaterThan<GenericValue extends TheDate>(input: GenericValue, threshold: TheDate): boolean;
@@ -0,0 +1,14 @@
1
+ import { toTimestamp } from '../toTimestamp.mjs';
2
+
3
+ function greaterThan(...args) {
4
+ if (args.length === 1) {
5
+ const [threshold] = args;
6
+ return (input) => greaterThan(input, threshold);
7
+ }
8
+ const [input, threshold] = args;
9
+ const inputTimestamp = toTimestamp(input);
10
+ const thresholdTimestamp = toTimestamp(threshold);
11
+ return inputTimestamp > thresholdTimestamp;
12
+ }
13
+
14
+ export { greaterThan };
@@ -0,0 +1,22 @@
1
+ export * from "./addDays";
2
+ export * from "./addHours";
3
+ export * from "./addMilliseconds";
4
+ export * from "./addMinutes";
5
+ export * from "./addMonths";
6
+ export * from "./addSeconds";
7
+ export * from "./addWeeks";
8
+ export * from "./addYears";
9
+ export * from "./subtractDays";
10
+ export * from "./subtractHours";
11
+ export * from "./subtractMilliseconds";
12
+ export * from "./subtractMinutes";
13
+ export * from "./subtractMonths";
14
+ export * from "./subtractSeconds";
15
+ export * from "./subtractWeeks";
16
+ export * from "./subtractYears";
17
+ export * from "./between";
18
+ export * from "./betweenThan";
19
+ export * from "./greater";
20
+ export * from "./greaterThan";
21
+ export * from "./less";
22
+ export * from "./lessThan";
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ var toTimestamp = require('../toTimestamp.cjs');
4
+
5
+ function less(...args) {
6
+ if (args.length === 1) {
7
+ const [threshold] = args;
8
+ return (input) => less(input, threshold);
9
+ }
10
+ const [input, threshold] = args;
11
+ const inputTimestamp = toTimestamp.toTimestamp(input);
12
+ const thresholdTimestamp = toTimestamp.toTimestamp(threshold);
13
+ return inputTimestamp <= thresholdTimestamp;
14
+ }
15
+
16
+ exports.less = less;
@@ -0,0 +1,3 @@
1
+ import type { TheDate } from "../types";
2
+ export declare function less<GenericValue extends TheDate>(threshold: TheDate): (input: GenericValue) => boolean;
3
+ export declare function less<GenericValue extends TheDate>(input: GenericValue, threshold: TheDate): boolean;
@@ -0,0 +1,14 @@
1
+ import { toTimestamp } from '../toTimestamp.mjs';
2
+
3
+ function less(...args) {
4
+ if (args.length === 1) {
5
+ const [threshold] = args;
6
+ return (input) => less(input, threshold);
7
+ }
8
+ const [input, threshold] = args;
9
+ const inputTimestamp = toTimestamp(input);
10
+ const thresholdTimestamp = toTimestamp(threshold);
11
+ return inputTimestamp <= thresholdTimestamp;
12
+ }
13
+
14
+ export { less };
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ var toTimestamp = require('../toTimestamp.cjs');
4
+
5
+ function lessThan(...args) {
6
+ if (args.length === 1) {
7
+ const [threshold] = args;
8
+ return (input) => lessThan(input, threshold);
9
+ }
10
+ const [input, threshold] = args;
11
+ const inputTimestamp = toTimestamp.toTimestamp(input);
12
+ const thresholdTimestamp = toTimestamp.toTimestamp(threshold);
13
+ return inputTimestamp < thresholdTimestamp;
14
+ }
15
+
16
+ exports.lessThan = lessThan;
@@ -0,0 +1,3 @@
1
+ import type { TheDate } from "../types";
2
+ export declare function lessThan<GenericValue extends TheDate>(threshold: TheDate): (input: GenericValue) => boolean;
3
+ export declare function lessThan<GenericValue extends TheDate>(input: GenericValue, threshold: TheDate): boolean;
@@ -0,0 +1,14 @@
1
+ import { toTimestamp } from '../toTimestamp.mjs';
2
+
3
+ function lessThan(...args) {
4
+ if (args.length === 1) {
5
+ const [threshold] = args;
6
+ return (input) => lessThan(input, threshold);
7
+ }
8
+ const [input, threshold] = args;
9
+ const inputTimestamp = toTimestamp(input);
10
+ const thresholdTimestamp = toTimestamp(threshold);
11
+ return inputTimestamp < thresholdTimestamp;
12
+ }
13
+
14
+ export { lessThan };
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ var constants = require('../constants.cjs');
4
+ var toNative = require('../toNative.cjs');
5
+
6
+ function subtractDays(...args) {
7
+ if (args.length === 1) {
8
+ const [day] = args;
9
+ return (input) => subtractDays(input, day);
10
+ }
11
+ const [input, day] = args;
12
+ const date = toNative.toNative(input);
13
+ const absoluteDay = Math.abs(day);
14
+ date.setTime(date.getTime() - (absoluteDay * constants.millisecondsInOneDay));
15
+ const timestamp = date.getTime();
16
+ const isNegative = timestamp < 0;
17
+ return `date${Math.abs(timestamp)}${isNegative ? "-" : "+"}`;
18
+ }
19
+
20
+ exports.subtractDays = subtractDays;
@@ -0,0 +1,4 @@
1
+ import type { TheDate } from "../types";
2
+ import type { PositiveNumber } from "../../number/types";
3
+ export declare function subtractDays<GenericInput extends TheDate, GenericDay extends number>(day: PositiveNumber<GenericDay>): (input: GenericInput) => TheDate;
4
+ export declare function subtractDays<GenericInput extends TheDate, GenericDay extends number>(input: GenericInput, day: PositiveNumber<GenericDay>): TheDate;
@@ -0,0 +1,18 @@
1
+ import { millisecondsInOneDay } from '../constants.mjs';
2
+ import { toNative } from '../toNative.mjs';
3
+
4
+ function subtractDays(...args) {
5
+ if (args.length === 1) {
6
+ const [day] = args;
7
+ return (input) => subtractDays(input, day);
8
+ }
9
+ const [input, day] = args;
10
+ const date = toNative(input);
11
+ const absoluteDay = Math.abs(day);
12
+ date.setTime(date.getTime() - (absoluteDay * millisecondsInOneDay));
13
+ const timestamp = date.getTime();
14
+ const isNegative = timestamp < 0;
15
+ return `date${Math.abs(timestamp)}${isNegative ? "-" : "+"}`;
16
+ }
17
+
18
+ export { subtractDays };
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ var constants = require('../constants.cjs');
4
+ var toNative = require('../toNative.cjs');
5
+
6
+ function subtractHours(...args) {
7
+ if (args.length === 1) {
8
+ const [hour] = args;
9
+ return (input) => subtractHours(input, hour);
10
+ }
11
+ const [input, hour] = args;
12
+ const date = toNative.toNative(input);
13
+ const absoluteHour = Math.abs(hour);
14
+ date.setTime(date.getTime() - (absoluteHour * constants.millisecondInOneHour));
15
+ const timestamp = date.getTime();
16
+ const isNegative = timestamp < 0;
17
+ return `date${Math.abs(timestamp)}${isNegative ? "-" : "+"}`;
18
+ }
19
+
20
+ exports.subtractHours = subtractHours;
@@ -0,0 +1,4 @@
1
+ import type { TheDate } from "../types";
2
+ import type { PositiveNumber } from "../../number/types";
3
+ export declare function subtractHours<GenericInput extends TheDate, GenericHour extends number>(hour: PositiveNumber<GenericHour>): (input: GenericInput) => TheDate;
4
+ export declare function subtractHours<GenericInput extends TheDate, GenericHour extends number>(input: GenericInput, hour: PositiveNumber<GenericHour>): TheDate;
@@ -0,0 +1,18 @@
1
+ import { millisecondInOneHour } from '../constants.mjs';
2
+ import { toNative } from '../toNative.mjs';
3
+
4
+ function subtractHours(...args) {
5
+ if (args.length === 1) {
6
+ const [hour] = args;
7
+ return (input) => subtractHours(input, hour);
8
+ }
9
+ const [input, hour] = args;
10
+ const date = toNative(input);
11
+ const absoluteHour = Math.abs(hour);
12
+ date.setTime(date.getTime() - (absoluteHour * millisecondInOneHour));
13
+ const timestamp = date.getTime();
14
+ const isNegative = timestamp < 0;
15
+ return `date${Math.abs(timestamp)}${isNegative ? "-" : "+"}`;
16
+ }
17
+
18
+ export { subtractHours };
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ var toNative = require('../toNative.cjs');
4
+
5
+ function subtractMilliseconds(...args) {
6
+ if (args.length === 1) {
7
+ const [millisecond] = args;
8
+ return (input) => subtractMilliseconds(input, millisecond);
9
+ }
10
+ const [input, millisecond] = args;
11
+ const date = toNative.toNative(input);
12
+ const absoluteMillisecond = Math.abs(millisecond);
13
+ date.setTime(date.getTime() - absoluteMillisecond);
14
+ const timestamp = date.getTime();
15
+ const isNegative = timestamp < 0;
16
+ return `date${Math.abs(timestamp)}${isNegative ? "-" : "+"}`;
17
+ }
18
+
19
+ exports.subtractMilliseconds = subtractMilliseconds;
@@ -0,0 +1,4 @@
1
+ import type { TheDate } from "../types";
2
+ import type { PositiveNumber } from "../../number/types";
3
+ export declare function subtractMilliseconds<GenericInput extends TheDate, GenericMillisecond extends number>(millisecond: PositiveNumber<GenericMillisecond>): (input: GenericInput) => TheDate;
4
+ export declare function subtractMilliseconds<GenericInput extends TheDate, GenericMillisecond extends number>(input: GenericInput, millisecond: PositiveNumber<GenericMillisecond>): TheDate;
@@ -0,0 +1,17 @@
1
+ import { toNative } from '../toNative.mjs';
2
+
3
+ function subtractMilliseconds(...args) {
4
+ if (args.length === 1) {
5
+ const [millisecond] = args;
6
+ return (input) => subtractMilliseconds(input, millisecond);
7
+ }
8
+ const [input, millisecond] = args;
9
+ const date = toNative(input);
10
+ const absoluteMillisecond = Math.abs(millisecond);
11
+ date.setTime(date.getTime() - absoluteMillisecond);
12
+ const timestamp = date.getTime();
13
+ const isNegative = timestamp < 0;
14
+ return `date${Math.abs(timestamp)}${isNegative ? "-" : "+"}`;
15
+ }
16
+
17
+ export { subtractMilliseconds };
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ var constants = require('../constants.cjs');
4
+ var toNative = require('../toNative.cjs');
5
+
6
+ function subtractMinutes(...args) {
7
+ if (args.length === 1) {
8
+ const [minute] = args;
9
+ return (input) => subtractMinutes(input, minute);
10
+ }
11
+ const [input, minute] = args;
12
+ const date = toNative.toNative(input);
13
+ const absoluteMinute = Math.abs(minute);
14
+ date.setTime(date.getTime() - (absoluteMinute * constants.millisecondInOneMinute));
15
+ const timestamp = date.getTime();
16
+ const isNegative = timestamp < 0;
17
+ return `date${Math.abs(timestamp)}${isNegative ? "-" : "+"}`;
18
+ }
19
+
20
+ exports.subtractMinutes = subtractMinutes;
@@ -0,0 +1,4 @@
1
+ import type { TheDate } from "../types";
2
+ import type { PositiveNumber } from "../../number/types";
3
+ export declare function subtractMinutes<GenericInput extends TheDate, GenericMinute extends number>(minute: PositiveNumber<GenericMinute>): (input: GenericInput) => TheDate;
4
+ export declare function subtractMinutes<GenericInput extends TheDate, GenericMinute extends number>(input: GenericInput, minute: PositiveNumber<GenericMinute>): TheDate;
@@ -0,0 +1,18 @@
1
+ import { millisecondInOneMinute } from '../constants.mjs';
2
+ import { toNative } from '../toNative.mjs';
3
+
4
+ function subtractMinutes(...args) {
5
+ if (args.length === 1) {
6
+ const [minute] = args;
7
+ return (input) => subtractMinutes(input, minute);
8
+ }
9
+ const [input, minute] = args;
10
+ const date = toNative(input);
11
+ const absoluteMinute = Math.abs(minute);
12
+ date.setTime(date.getTime() - (absoluteMinute * millisecondInOneMinute));
13
+ const timestamp = date.getTime();
14
+ const isNegative = timestamp < 0;
15
+ return `date${Math.abs(timestamp)}${isNegative ? "-" : "+"}`;
16
+ }
17
+
18
+ export { subtractMinutes };
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ var toNative = require('../toNative.cjs');
4
+
5
+ function subtractMonths(...args) {
6
+ if (args.length === 1) {
7
+ const [month] = args;
8
+ return (input) => subtractMonths(input, month);
9
+ }
10
+ const [input, month] = args;
11
+ const date = toNative.toNative(input);
12
+ const absoluteMonth = Math.abs(month);
13
+ date.setUTCMonth(date.getUTCMonth() - absoluteMonth);
14
+ const timestamp = date.getTime();
15
+ const isNegative = timestamp < 0;
16
+ return `date${Math.abs(timestamp)}${isNegative ? "-" : "+"}`;
17
+ }
18
+
19
+ exports.subtractMonths = subtractMonths;
@@ -0,0 +1,4 @@
1
+ import type { TheDate } from "../types";
2
+ import type { PositiveNumber } from "../../number/types";
3
+ export declare function subtractMonths<GenericInput extends TheDate, GenericMonth extends number>(month: PositiveNumber<GenericMonth>): (input: GenericInput) => TheDate;
4
+ export declare function subtractMonths<GenericInput extends TheDate, GenericMonth extends number>(input: GenericInput, month: PositiveNumber<GenericMonth>): TheDate;
@@ -0,0 +1,17 @@
1
+ import { toNative } from '../toNative.mjs';
2
+
3
+ function subtractMonths(...args) {
4
+ if (args.length === 1) {
5
+ const [month] = args;
6
+ return (input) => subtractMonths(input, month);
7
+ }
8
+ const [input, month] = args;
9
+ const date = toNative(input);
10
+ const absoluteMonth = Math.abs(month);
11
+ date.setUTCMonth(date.getUTCMonth() - absoluteMonth);
12
+ const timestamp = date.getTime();
13
+ const isNegative = timestamp < 0;
14
+ return `date${Math.abs(timestamp)}${isNegative ? "-" : "+"}`;
15
+ }
16
+
17
+ export { subtractMonths };
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ var constants = require('../constants.cjs');
4
+ var toNative = require('../toNative.cjs');
5
+
6
+ function subtractSeconds(...args) {
7
+ if (args.length === 1) {
8
+ const [second] = args;
9
+ return (input) => subtractSeconds(input, second);
10
+ }
11
+ const [input, second] = args;
12
+ const date = toNative.toNative(input);
13
+ const absoluteSecond = Math.abs(second);
14
+ date.setTime(date.getTime() - (absoluteSecond * constants.millisecondsInOneSecond));
15
+ const timestamp = date.getTime();
16
+ const isNegative = timestamp < 0;
17
+ return `date${Math.abs(timestamp)}${isNegative ? "-" : "+"}`;
18
+ }
19
+
20
+ exports.subtractSeconds = subtractSeconds;
@@ -0,0 +1,4 @@
1
+ import type { TheDate } from "../types";
2
+ import type { PositiveNumber } from "../../number/types";
3
+ export declare function subtractSeconds<GenericInput extends TheDate, GenericSecond extends number>(second: PositiveNumber<GenericSecond>): (input: GenericInput) => TheDate;
4
+ export declare function subtractSeconds<GenericInput extends TheDate, GenericSecond extends number>(input: GenericInput, second: PositiveNumber<GenericSecond>): TheDate;
@@ -0,0 +1,18 @@
1
+ import { millisecondsInOneSecond } from '../constants.mjs';
2
+ import { toNative } from '../toNative.mjs';
3
+
4
+ function subtractSeconds(...args) {
5
+ if (args.length === 1) {
6
+ const [second] = args;
7
+ return (input) => subtractSeconds(input, second);
8
+ }
9
+ const [input, second] = args;
10
+ const date = toNative(input);
11
+ const absoluteSecond = Math.abs(second);
12
+ date.setTime(date.getTime() - (absoluteSecond * millisecondsInOneSecond));
13
+ const timestamp = date.getTime();
14
+ const isNegative = timestamp < 0;
15
+ return `date${Math.abs(timestamp)}${isNegative ? "-" : "+"}`;
16
+ }
17
+
18
+ export { subtractSeconds };