ts-data-forge 6.4.0 → 6.6.0

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 (181) hide show
  1. package/README.md +5 -3
  2. package/dist/array/impl/array-utils-element-access.d.mts +5 -5
  3. package/dist/array/impl/array-utils-element-access.mjs +4 -4
  4. package/dist/array/impl/array-utils-iterators.d.mts +1 -1
  5. package/dist/array/impl/array-utils-iterators.mjs +1 -1
  6. package/dist/array/impl/array-utils-modification.d.mts +4 -4
  7. package/dist/array/impl/array-utils-reducing-value.d.mts +5 -5
  8. package/dist/array/impl/array-utils-reducing-value.d.mts.map +1 -1
  9. package/dist/array/impl/array-utils-reducing-value.mjs +1 -0
  10. package/dist/array/impl/array-utils-reducing-value.mjs.map +1 -1
  11. package/dist/array/impl/array-utils-search.d.mts +8 -8
  12. package/dist/array/impl/array-utils-set-op.d.mts.map +1 -1
  13. package/dist/array/impl/array-utils-set-op.mjs +3 -1
  14. package/dist/array/impl/array-utils-set-op.mjs.map +1 -1
  15. package/dist/array/impl/array-utils-size.d.mts +1 -1
  16. package/dist/array/impl/array-utils-size.mjs +1 -1
  17. package/dist/array/impl/array-utils-slice-clamped.d.mts +1 -1
  18. package/dist/array/impl/array-utils-slicing.d.mts +3 -3
  19. package/dist/array/impl/array-utils-transformation.d.mts.map +1 -1
  20. package/dist/array/impl/array-utils-validation.d.mts +7 -7
  21. package/dist/array/impl/array-utils-validation.d.mts.map +1 -1
  22. package/dist/array/impl/array-utils-validation.mjs +22 -12
  23. package/dist/array/impl/array-utils-validation.mjs.map +1 -1
  24. package/dist/collections/imap-mapped.d.mts +5 -12
  25. package/dist/collections/imap-mapped.d.mts.map +1 -1
  26. package/dist/collections/imap-mapped.mjs.map +1 -1
  27. package/dist/collections/imap.d.mts +24 -28
  28. package/dist/collections/imap.d.mts.map +1 -1
  29. package/dist/collections/imap.mjs +1 -1
  30. package/dist/collections/imap.mjs.map +1 -1
  31. package/dist/collections/iset-mapped.d.mts +8 -14
  32. package/dist/collections/iset-mapped.d.mts.map +1 -1
  33. package/dist/collections/iset-mapped.mjs.map +1 -1
  34. package/dist/collections/iset.d.mts +9 -23
  35. package/dist/collections/iset.d.mts.map +1 -1
  36. package/dist/collections/iset.mjs +1 -0
  37. package/dist/collections/iset.mjs.map +1 -1
  38. package/dist/entry-point.mjs +1 -0
  39. package/dist/entry-point.mjs.map +1 -1
  40. package/dist/functional/optional/impl/optional-is-optional.d.mts +1 -1
  41. package/dist/functional/optional/impl/optional-is-optional.d.mts.map +1 -1
  42. package/dist/functional/optional/impl/optional-is-optional.mjs +6 -5
  43. package/dist/functional/optional/impl/optional-is-optional.mjs.map +1 -1
  44. package/dist/functional/optional/impl/optional-some.d.mts.map +1 -1
  45. package/dist/functional/optional/impl/optional-some.mjs.map +1 -1
  46. package/dist/functional/optional/impl/optional-zip.d.mts +1 -1
  47. package/dist/functional/optional/impl/optional-zip.mjs +1 -1
  48. package/dist/functional/result/impl/result-err.d.mts.map +1 -1
  49. package/dist/functional/result/impl/result-err.mjs.map +1 -1
  50. package/dist/functional/result/impl/result-is-result.d.mts +1 -1
  51. package/dist/functional/result/impl/result-is-result.mjs +1 -1
  52. package/dist/functional/result/impl/result-ok.d.mts.map +1 -1
  53. package/dist/functional/result/impl/result-ok.mjs.map +1 -1
  54. package/dist/functional/result/impl/result-unwrap-err-throw.mjs +1 -0
  55. package/dist/functional/result/impl/result-unwrap-err-throw.mjs.map +1 -1
  56. package/dist/functional/result/impl/result-unwrap-throw.mjs +1 -0
  57. package/dist/functional/result/impl/result-unwrap-throw.mjs.map +1 -1
  58. package/dist/functional/ternary-result/impl/ternary-result-err.d.mts.map +1 -1
  59. package/dist/functional/ternary-result/impl/ternary-result-err.mjs.map +1 -1
  60. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.d.mts +1 -1
  61. package/dist/functional/ternary-result/impl/ternary-result-is-ternary-result.mjs +1 -1
  62. package/dist/functional/ternary-result/impl/ternary-result-ok.d.mts.map +1 -1
  63. package/dist/functional/ternary-result/impl/ternary-result-ok.mjs.map +1 -1
  64. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs +1 -0
  65. package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mjs.map +1 -1
  66. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs +1 -0
  67. package/dist/functional/ternary-result/impl/ternary-result-unwrap-throw.mjs.map +1 -1
  68. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs +1 -0
  69. package/dist/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mjs.map +1 -1
  70. package/dist/functional/ternary-result/impl/ternary-result-warn.d.mts.map +1 -1
  71. package/dist/functional/ternary-result/impl/ternary-result-warn.mjs.map +1 -1
  72. package/dist/guard/has-key.d.mts +3 -1
  73. package/dist/guard/has-key.d.mts.map +1 -1
  74. package/dist/guard/has-key.mjs +6 -2
  75. package/dist/guard/has-key.mjs.map +1 -1
  76. package/dist/guard/is-non-null-object.d.mts.map +1 -1
  77. package/dist/guard/is-non-null-object.mjs +3 -1
  78. package/dist/guard/is-non-null-object.mjs.map +1 -1
  79. package/dist/guard/is-record.d.mts +2 -2
  80. package/dist/guard/is-record.mjs +2 -2
  81. package/dist/guard/is-type.d.mts +15 -15
  82. package/dist/guard/is-type.mjs +15 -15
  83. package/dist/guard/key-is-in.d.mts.map +1 -1
  84. package/dist/guard/key-is-in.mjs +3 -1
  85. package/dist/guard/key-is-in.mjs.map +1 -1
  86. package/dist/index.mjs +1 -0
  87. package/dist/index.mjs.map +1 -1
  88. package/dist/json/json.d.mts +3 -3
  89. package/dist/json/json.mjs +4 -3
  90. package/dist/json/json.mjs.map +1 -1
  91. package/dist/number/branded-types/non-zero-safe-int.mjs +2 -2
  92. package/dist/number/branded-types/positive-safe-int.mjs +1 -1
  93. package/dist/number/branded-types/safe-int.mjs +2 -2
  94. package/dist/number/branded-types/safe-uint.mjs +1 -1
  95. package/dist/number/num.mjs +1 -1
  96. package/dist/object/object.d.mts +36 -8
  97. package/dist/object/object.d.mts.map +1 -1
  98. package/dist/object/object.mjs +28 -6
  99. package/dist/object/object.mjs.map +1 -1
  100. package/dist/others/fast-deep-equal.d.mts +8 -0
  101. package/dist/others/fast-deep-equal.d.mts.map +1 -0
  102. package/dist/others/fast-deep-equal.mjs +72 -0
  103. package/dist/others/fast-deep-equal.mjs.map +1 -0
  104. package/dist/others/index.d.mts +1 -0
  105. package/dist/others/index.d.mts.map +1 -1
  106. package/dist/others/index.mjs +1 -0
  107. package/dist/others/index.mjs.map +1 -1
  108. package/package.json +34 -29
  109. package/src/array/impl/array-utils-creation.test.mts +13 -10
  110. package/src/array/impl/array-utils-element-access.mts +5 -5
  111. package/src/array/impl/array-utils-element-access.test.mts +5 -5
  112. package/src/array/impl/array-utils-iterators.mts +1 -1
  113. package/src/array/impl/array-utils-iterators.test.mts +6 -6
  114. package/src/array/impl/array-utils-modification.mts +4 -4
  115. package/src/array/impl/array-utils-modification.test.mts +12 -12
  116. package/src/array/impl/array-utils-overload-type-error.test.mts +1 -1
  117. package/src/array/impl/array-utils-reducing-value.mts +6 -5
  118. package/src/array/impl/array-utils-reducing-value.test.mts +9 -9
  119. package/src/array/impl/array-utils-search.mts +8 -8
  120. package/src/array/impl/array-utils-search.test.mts +35 -35
  121. package/src/array/impl/array-utils-set-op.mts +1 -0
  122. package/src/array/impl/array-utils-set-op.test.mts +2 -2
  123. package/src/array/impl/array-utils-size.mts +1 -1
  124. package/src/array/impl/array-utils-size.test.mts +1 -1
  125. package/src/array/impl/array-utils-slice-clamped.mts +1 -1
  126. package/src/array/impl/array-utils-slice-clamped.test.mts +5 -5
  127. package/src/array/impl/array-utils-slicing.mts +3 -3
  128. package/src/array/impl/array-utils-slicing.test.mts +5 -5
  129. package/src/array/impl/array-utils-transformation.mts +1 -1
  130. package/src/array/impl/array-utils-transformation.test.mts +53 -53
  131. package/src/array/impl/array-utils-validation.mts +18 -10
  132. package/src/array/impl/array-utils-validation.test.mts +34 -29
  133. package/src/array/impl/array.test.mts +1 -1
  134. package/src/collections/imap-mapped.mts +4 -10
  135. package/src/collections/imap-mapped.test.mts +9 -9
  136. package/src/collections/imap.mts +24 -27
  137. package/src/collections/imap.test.mts +6 -6
  138. package/src/collections/iset-mapped.mts +12 -16
  139. package/src/collections/iset-mapped.test.mts +6 -6
  140. package/src/collections/iset.mts +14 -25
  141. package/src/collections/queue.test.mts +2 -1
  142. package/src/collections/stack.test.mts +3 -3
  143. package/src/functional/optional/impl/optional-is-optional.mts +6 -6
  144. package/src/functional/optional/impl/optional-some.mts +5 -4
  145. package/src/functional/optional/impl/optional-zip.mts +1 -1
  146. package/src/functional/result/impl/result-err.mts +5 -4
  147. package/src/functional/result/impl/result-is-result.mts +1 -1
  148. package/src/functional/result/impl/result-ok.mts +5 -4
  149. package/src/functional/result.test.mts +2 -2
  150. package/src/functional/ternary-result/impl/ternary-result-err.mts +5 -4
  151. package/src/functional/ternary-result/impl/ternary-result-is-ternary-result.mts +1 -1
  152. package/src/functional/ternary-result/impl/ternary-result-ok.mts +5 -4
  153. package/src/functional/ternary-result/impl/ternary-result-warn.mts +6 -5
  154. package/src/guard/has-key.mts +6 -2
  155. package/src/guard/is-error.test.mts +1 -1
  156. package/src/guard/is-non-empty-string.test.mts +1 -1
  157. package/src/guard/is-non-null-object.mts +1 -0
  158. package/src/guard/is-non-null-object.test.mts +4 -3
  159. package/src/guard/is-primitive.test.mts +1 -1
  160. package/src/guard/is-record.mts +2 -2
  161. package/src/guard/is-record.test.mts +2 -2
  162. package/src/guard/is-type.mts +15 -15
  163. package/src/guard/is-type.test.mts +2 -2
  164. package/src/guard/key-is-in.mts +3 -1
  165. package/src/json/json.mts +4 -3
  166. package/src/json/json.test.mts +20 -19
  167. package/src/number/branded-types/non-zero-safe-int.mts +2 -2
  168. package/src/number/branded-types/positive-safe-int.mts +1 -1
  169. package/src/number/branded-types/safe-int.mts +2 -2
  170. package/src/number/branded-types/safe-uint.mts +1 -1
  171. package/src/number/num.mts +1 -1
  172. package/src/object/object.mts +54 -8
  173. package/src/object/object.test.mts +70 -7
  174. package/src/others/cast-mutable.test.mts +3 -3
  175. package/src/others/cast-readonly.test.mts +10 -5
  176. package/src/others/fast-deep-equal.mts +98 -0
  177. package/src/others/fast-deep-equal.test.mts +771 -0
  178. package/src/others/index.mts +1 -0
  179. package/src/others/map-nullable.test.mts +8 -8
  180. package/src/others/memoize-function.test.mts +20 -8
  181. package/src/others/unknown-to-string.test.mts +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"result-err.d.mts","sourceRoot":"","sources":["../../../../src/functional/result/impl/result-err.mts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,GAAG,GAAI,KAAK,CAAC,CAAC,EAAG,OAAO,CAAC,KAAG,GAAG,CAAC,CAAC,CAG5C,CAAC"}
1
+ {"version":3,"file":"result-err.d.mts","sourceRoot":"","sources":["../../../../src/functional/result/impl/result-err.mts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,GAAG,GAAI,KAAK,CAAC,CAAC,EAAG,OAAO,CAAC,KAAG,GAAG,CAAC,CAAC,CAIjC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"result-err.mjs","sources":["../../../../src/functional/result/impl/result-err.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;MACU,GAAG,GAAG,CAAW,KAAQ,MAAc;AAClD,IAAA,KAAK,EAAE,cAAc;IACrB,KAAK;AACN,CAAA;;;;"}
1
+ {"version":3,"file":"result-err.mjs","sources":["../../../../src/functional/result/impl/result-err.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;MACU,GAAG,GAAG,CAAW,KAAQ,MACnC;AACC,IAAA,KAAK,EAAE,cAAc;IACrB,KAAK;AACN,CAAA;;;;"}
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * const errValue = Result.err(new Error('failure'));
10
10
  *
11
- * const notResult = { $$tag: 'ts-data-forge::Result.ok' };
11
+ * const notResult = { $$tag: 'ts-data-forge::Result.ok' } as const;
12
12
  *
13
13
  * assert.isTrue(Result.isResult(okValue));
14
14
  *
@@ -12,7 +12,7 @@ import { ErrTypeTagName, OkTypeTagName } from './tag.mjs';
12
12
  *
13
13
  * const errValue = Result.err(new Error('failure'));
14
14
  *
15
- * const notResult = { $$tag: 'ts-data-forge::Result.ok' };
15
+ * const notResult = { $$tag: 'ts-data-forge::Result.ok' } as const;
16
16
  *
17
17
  * assert.isTrue(Result.isResult(okValue));
18
18
  *
@@ -1 +1 @@
1
- {"version":3,"file":"result-ok.d.mts","sourceRoot":"","sources":["../../../../src/functional/result/impl/result-ok.mts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,EAAE,GAAI,KAAK,CAAC,CAAC,EAAG,OAAO,CAAC,KAAG,EAAE,CAAC,CAAC,CAG1C,CAAC"}
1
+ {"version":3,"file":"result-ok.d.mts","sourceRoot":"","sources":["../../../../src/functional/result/impl/result-ok.mts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,EAAE,GAAI,KAAK,CAAC,CAAC,EAAG,OAAO,CAAC,KAAG,EAAE,CAAC,CAAC,CAI/B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"result-ok.mjs","sources":["../../../../src/functional/result/impl/result-ok.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;MACU,EAAE,GAAG,CAAW,KAAQ,MAAa;AAChD,IAAA,KAAK,EAAE,aAAa;IACpB,KAAK;AACN,CAAA;;;;"}
1
+ {"version":3,"file":"result-ok.mjs","sources":["../../../../src/functional/result/impl/result-ok.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;MACU,EAAE,GAAG,CAAW,KAAQ,MAClC;AACC,IAAA,KAAK,EAAE,aAAa;IACpB,KAAK;AACN,CAAA;;;;"}
@@ -1,3 +1,4 @@
1
+ import '@sindresorhus/is';
1
2
  import { unknownToString } from '../../../others/unknown-to-string.mjs';
2
3
  import { match } from '../../match.mjs';
3
4
  import { isErr } from './result-is-err.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"result-unwrap-err-throw.mjs","sources":["../../../../src/functional/result/impl/result-unwrap-err-throw.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;AACI,MAAM,cAAc,GAAG,CAC5B,MAAS,EACT,KAAA,GAAoC,eAAe,KACnC;AAChB,IAAA,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE;;QAEjB,OAAO,MAAM,CAAC,KAAqB;IACrC;AAEA,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE;AAClC,QAAA,0BAA0B,EAAE,IAAI;AAChC,QAAA,2BAA2B,EAAE,KAAK;AACnC,KAAA,CAAC;AAEF,IAAA,MAAM,IAAI,KAAK,CACb,CAAA,qBAAA,EAAwB,OAAO,KAAK,KAAK;;AAEvC,IAAA,MAAM,CAAC,KAAoB,CAC5B,CAAA,CAAE,CACJ;AACH;;;;"}
1
+ {"version":3,"file":"result-unwrap-err-throw.mjs","sources":["../../../../src/functional/result/impl/result-unwrap-err-throw.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;AACI,MAAM,cAAc,GAAG,CAC5B,MAAS,EACT,KAAA,GAAoC,eAAe,KACnC;AAChB,IAAA,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE;;QAEjB,OAAO,MAAM,CAAC,KAAqB;IACrC;AAEA,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE;AAClC,QAAA,0BAA0B,EAAE,IAAI;AAChC,QAAA,2BAA2B,EAAE,KAAK;AACnC,KAAA,CAAC;AAEF,IAAA,MAAM,IAAI,KAAK,CACb,CAAA,qBAAA,EAAwB,OAAO,KAAK,KAAK;;AAEvC,IAAA,MAAM,CAAC,KAAoB,CAC5B,CAAA,CAAE,CACJ;AACH;;;;"}
@@ -1,3 +1,4 @@
1
+ import '@sindresorhus/is';
1
2
  import { unknownToString } from '../../../others/unknown-to-string.mjs';
2
3
  import { isErr } from './result-is-err.mjs';
3
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"result-unwrap-throw.mjs","sources":["../../../../src/functional/result/impl/result-unwrap-throw.mts"],"sourcesContent":[null],"names":[],"mappings":";;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;AACI,MAAM,WAAW,GAAG,CACzB,MAAS,EACT,KAAA,GAAqC,eAAe,KACrC;AACf,IAAA,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE;;QAEjB,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAqB,CAAC,CAAC;IACtD;;IAGA,OAAO,MAAM,CAAC,KAAoB;AACpC;;;;"}
1
+ {"version":3,"file":"result-unwrap-throw.mjs","sources":["../../../../src/functional/result/impl/result-unwrap-throw.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;AACI,MAAM,WAAW,GAAG,CACzB,MAAS,EACT,KAAA,GAAqC,eAAe,KACrC;AACf,IAAA,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE;;QAEjB,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAqB,CAAC,CAAC;IACtD;;IAGA,OAAO,MAAM,CAAC,KAAoB;AACpC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ternary-result-err.d.mts","sourceRoot":"","sources":["../../../../src/functional/ternary-result/impl/ternary-result-err.mts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,GAAG,GAAI,KAAK,CAAC,CAAC,EAAG,OAAO,CAAC,KAAG,UAAU,CAAC,CAAC,CAGnD,CAAC"}
1
+ {"version":3,"file":"ternary-result-err.d.mts","sourceRoot":"","sources":["../../../../src/functional/ternary-result/impl/ternary-result-err.mts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,GAAG,GAAI,KAAK,CAAC,CAAC,EAAG,OAAO,CAAC,KAAG,UAAU,CAAC,CAAC,CAIxC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ternary-result-err.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-err.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;;;;;;AAYG;MACU,GAAG,GAAG,CAAW,KAAQ,MAAqB;AACzD,IAAA,KAAK,EAAE,cAAc;IACrB,KAAK;AACN,CAAA;;;;"}
1
+ {"version":3,"file":"ternary-result-err.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-err.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;;;;;;AAYG;MACU,GAAG,GAAG,CAAW,KAAQ,MACnC;AACC,IAAA,KAAK,EAAE,cAAc;IACrB,KAAK;AACN,CAAA;;;;"}
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * const warnValue = TernaryResult.warn('done', 'retry later');
10
10
  *
11
- * const notResult = { $$tag: 'ts-data-forge::Result.ok' };
11
+ * const notResult = { $$tag: 'ts-data-forge::Result.ok' } as const;
12
12
  *
13
13
  * assert.isTrue(TernaryResult.isTernaryResult(okValue));
14
14
  *
@@ -12,7 +12,7 @@ import { WarnTypeTagName, OkTypeTagName, ErrTypeTagName } from './tag.mjs';
12
12
  *
13
13
  * const warnValue = TernaryResult.warn('done', 'retry later');
14
14
  *
15
- * const notResult = { $$tag: 'ts-data-forge::Result.ok' };
15
+ * const notResult = { $$tag: 'ts-data-forge::Result.ok' } as const;
16
16
  *
17
17
  * assert.isTrue(TernaryResult.isTernaryResult(okValue));
18
18
  *
@@ -1 +1 @@
1
- {"version":3,"file":"ternary-result-ok.d.mts","sourceRoot":"","sources":["../../../../src/functional/ternary-result/impl/ternary-result-ok.mts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,EAAE,GAAI,KAAK,CAAC,CAAC,EAAG,OAAO,CAAC,KAAG,SAAS,CAAC,CAAC,CAGjD,CAAC"}
1
+ {"version":3,"file":"ternary-result-ok.d.mts","sourceRoot":"","sources":["../../../../src/functional/ternary-result/impl/ternary-result-ok.mts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,EAAE,GAAI,KAAK,CAAC,CAAC,EAAG,OAAO,CAAC,KAAG,SAAS,CAAC,CAAC,CAItC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ternary-result-ok.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-ok.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;AAaG;MACU,EAAE,GAAG,CAAW,KAAQ,MAAoB;AACvD,IAAA,KAAK,EAAE,aAAa;IACpB,KAAK;AACN,CAAA;;;;"}
1
+ {"version":3,"file":"ternary-result-ok.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-ok.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;AAaG;MACU,EAAE,GAAG,CAAW,KAAQ,MAClC;AACC,IAAA,KAAK,EAAE,aAAa;IACpB,KAAK;AACN,CAAA;;;;"}
@@ -1,3 +1,4 @@
1
+ import '@sindresorhus/is';
1
2
  import { unknownToString } from '../../../others/unknown-to-string.mjs';
2
3
  import { isErr } from './ternary-result-is-err.mjs';
3
4
  import { isWarn } from './ternary-result-is-warn.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"ternary-result-unwrap-err-throw.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAMA;;;;;;;;;;;;;;;AAeG;AACI,MAAM,cAAc,GAAG,CAC5B,MAAS,EACT,KAAA,GAAwD,eAAe,KACvD;AAChB,IAAA,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE;;QAEjB,OAAO,MAAM,CAAC,KAAqB;IACrC;IAEA,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC;AAEzC,IAAA,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM;AAC3B;AACG,YAAA,MAAM,CAAC;AACV;YACG,MAAM,CAAC,KAAoD;AAEhE,IAAA,MAAM,IAAI,KAAK,CAAC,CAAA,qBAAA,EAAwB,OAAO,CAAA,EAAA,EAAK,KAAK,CAAC,OAAO,CAAC,CAAA,CAAE,CAAC;AACvE;;;;"}
1
+ {"version":3,"file":"ternary-result-unwrap-err-throw.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-unwrap-err-throw.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAMA;;;;;;;;;;;;;;;AAeG;AACI,MAAM,cAAc,GAAG,CAC5B,MAAS,EACT,KAAA,GAAwD,eAAe,KACvD;AAChB,IAAA,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE;;QAEjB,OAAO,MAAM,CAAC,KAAqB;IACrC;IAEA,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC;AAEzC,IAAA,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM;AAC3B;AACG,YAAA,MAAM,CAAC;AACV;YACG,MAAM,CAAC,KAAoD;AAEhE,IAAA,MAAM,IAAI,KAAK,CAAC,CAAA,qBAAA,EAAwB,OAAO,CAAA,EAAA,EAAK,KAAK,CAAC,OAAO,CAAC,CAAA,CAAE,CAAC;AACvE;;;;"}
@@ -1,3 +1,4 @@
1
+ import '@sindresorhus/is';
1
2
  import { unknownToString } from '../../../others/unknown-to-string.mjs';
2
3
  import { isErr } from './ternary-result-is-err.mjs';
3
4
  import { isWarn } from './ternary-result-is-warn.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"ternary-result-unwrap-throw.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-unwrap-throw.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAKA;;;;;;;;;;;;;;;;AAgBG;AACI,MAAM,WAAW,GAAG,CACzB,MAAS,EACT,KAAA,GAAyD,eAAe,KACzD;AACf,IAAA,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE;AACjB,QAAA,MAAM,IAAI,KAAK,CACb,CAAA,yBAAA,EAA4B,KAAK;;AAE/B,QAAA,MAAM,CAAC,KAAqB,CAC7B,CAAA,CAAE,CACJ;IACH;AAEA,IAAA,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE;AAClB,QAAA,MAAM,IAAI,KAAK,CACb,CAAA,0BAAA,EAA6B,KAAK;;AAEhC,QAAA,MAAM,CAAC,OAAwB,CAChC,CAAA,CAAE,CACJ;IACH;;IAGA,OAAO,MAAM,CAAC,KAAoB;AACpC;;;;"}
1
+ {"version":3,"file":"ternary-result-unwrap-throw.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-unwrap-throw.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAKA;;;;;;;;;;;;;;;;AAgBG;AACI,MAAM,WAAW,GAAG,CACzB,MAAS,EACT,KAAA,GAAyD,eAAe,KACzD;AACf,IAAA,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE;AACjB,QAAA,MAAM,IAAI,KAAK,CACb,CAAA,yBAAA,EAA4B,KAAK;;AAE/B,QAAA,MAAM,CAAC,KAAqB,CAC7B,CAAA,CAAE,CACJ;IACH;AAEA,IAAA,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE;AAClB,QAAA,MAAM,IAAI,KAAK,CACb,CAAA,0BAAA,EAA6B,KAAK;;AAEhC,QAAA,MAAM,CAAC,OAAwB,CAChC,CAAA,CAAE,CACJ;IACH;;IAGA,OAAO,MAAM,CAAC,KAAoB;AACpC;;;;"}
@@ -1,3 +1,4 @@
1
+ import '@sindresorhus/is';
1
2
  import { unknownToString } from '../../../others/unknown-to-string.mjs';
2
3
  import { isWarn } from './ternary-result-is-warn.mjs';
3
4
  import { variantName } from './variant-name.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"ternary-result-unwrap-warn-throw.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAKA;;;;;;;;;;;;;;;AAeG;AACI,MAAM,eAAe,GAAG,CAC7B,MAAS,EACT,KAAA,GAAuD,eAAe,KACrD;AACjB,IAAA,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE;;QAElB,OAAO,MAAM,CAAC,OAAwB;IACxC;IAEA,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC;AAEzC,IAAA,MAAM,IAAI,KAAK,CACb,CAAA,sBAAA,EAAyB,OAAO,KAAK,KAAK;;AAExC,IAAA,MAAM,CAAC,KAAmC,CAC3C,CAAA,CAAE,CACJ;AACH;;;;"}
1
+ {"version":3,"file":"ternary-result-unwrap-warn-throw.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-unwrap-warn-throw.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAKA;;;;;;;;;;;;;;;AAeG;AACI,MAAM,eAAe,GAAG,CAC7B,MAAS,EACT,KAAA,GAAuD,eAAe,KACrD;AACjB,IAAA,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE;;QAElB,OAAO,MAAM,CAAC,OAAwB;IACxC;IAEA,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC;AAEzC,IAAA,MAAM,IAAI,KAAK,CACb,CAAA,sBAAA,EAAyB,OAAO,KAAK,KAAK;;AAExC,IAAA,MAAM,CAAC,KAAmC,CAC3C,CAAA,CAAE,CACJ;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ternary-result-warn.d.mts","sourceRoot":"","sources":["../../../../src/functional/ternary-result/impl/ternary-result-warn.mts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,IAAI,GAAI,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EACnC,OAAO,CAAC,EACR,SAAS,CAAC,KACT,WAAW,CAAC,CAAC,EAAE,CAAC,CAIjB,CAAC"}
1
+ {"version":3,"file":"ternary-result-warn.d.mts","sourceRoot":"","sources":["../../../../src/functional/ternary-result/impl/ternary-result-warn.mts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,IAAI,GAAI,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EACnC,OAAO,CAAC,EACR,SAAS,CAAC,KACT,WAAW,CAAC,CAAC,EAAE,CAAC,CAKN,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ternary-result-warn.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-warn.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;;;AAeG;AACI,MAAM,IAAI,GAAG,CAClB,KAAQ,EACR,OAAU,MACa;AACvB,IAAA,KAAK,EAAE,eAAe;IACtB,KAAK;IACL,OAAO;AACR,CAAA;;;;"}
1
+ {"version":3,"file":"ternary-result-warn.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-warn.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;;;AAeG;AACI,MAAM,IAAI,GAAG,CAClB,KAAQ,EACR,OAAU,MAET;AACC,IAAA,KAAK,EAAE,eAAe;IACtB,KAAK;IACL,OAAO;AACR,CAAA;;;;"}
@@ -17,7 +17,9 @@
17
17
  * @example
18
18
  *
19
19
  * ```ts
20
- * const maybeUser: Readonly<{ id?: number; name?: string }> = { id: 42 };
20
+ * const maybeUser: Readonly<{ id?: number; name?: string }> = {
21
+ * id: 42,
22
+ * } as const;
21
23
  *
22
24
  * if (hasKey(maybeUser, 'id')) {
23
25
  * // `maybeUser` is now known to have an `id` property.
@@ -1 +1 @@
1
- {"version":3,"file":"has-key.d.mts","sourceRoot":"","sources":["../../src/guard/has-key.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,MAAM,GACjB,KAAK,CAAC,CAAC,SAAS,aAAa,EAC7B,KAAK,CAAC,CAAC,SAAS,WAAW,EAE3B,KAAK,CAAC,EACN,KAAK,CAAC,KACL,GAAG,IAAI,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAA4B,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,CAC1B,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,WAAW,IACnB,CAAC,SAAS,CAAC,GACX,CAAC,SAAS,MAAM,CAAC,GACf,MAAM,SAAS,MAAM,CAAC,GACpB,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GACjC,MAAM,SAAS,MAAM,CAAC,GACpB,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GACjC,MAAM,SAAS,MAAM,CAAC,GACpB,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GACjC,CAAC,GACP,KAAK,GACP,KAAK,CAAC"}
1
+ {"version":3,"file":"has-key.d.mts","sourceRoot":"","sources":["../../src/guard/has-key.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,MAAM,GACjB,KAAK,CAAC,CAAC,SAAS,aAAa,EAC7B,KAAK,CAAC,CAAC,SAAS,WAAW,EAE3B,KAAK,CAAC,EACN,KAAK,CAAC,KACL,GAAG,IAAI,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAEN,CAAC;AAE1B;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,CAC1B,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,WAAW,IACnB,CAAC,SAAS,CAAC,GACX,CAAC,SAAS,MAAM,CAAC,GACf,MAAM,SAAS,MAAM,CAAC,GACpB,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GACjC,MAAM,SAAS,MAAM,CAAC,GACpB,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GACjC,MAAM,SAAS,MAAM,CAAC,GACpB,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GACjC,CAAC,GACP,KAAK,GACP,KAAK,CAAC"}
@@ -17,7 +17,9 @@
17
17
  * @example
18
18
  *
19
19
  * ```ts
20
- * const maybeUser: Readonly<{ id?: number; name?: string }> = { id: 42 };
20
+ * const maybeUser: Readonly<{ id?: number; name?: string }> = {
21
+ * id: 42,
22
+ * } as const;
21
23
  *
22
24
  * if (hasKey(maybeUser, 'id')) {
23
25
  * // `maybeUser` is now known to have an `id` property.
@@ -37,7 +39,9 @@
37
39
  * guarantee the key exists.
38
40
  * @see {@link keyIsIn} - Similar function that narrows the key type instead of the object type
39
41
  */
40
- const hasKey = (obj, key) => Object.hasOwn(obj, key);
42
+ const hasKey = (obj, key) =>
43
+ // eslint-disable-next-line ts-data-forge/prefer-is-record-and-has-key
44
+ Object.hasOwn(obj, key);
41
45
 
42
46
  export { hasKey };
43
47
  //# sourceMappingURL=has-key.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"has-key.mjs","sources":["../../src/guard/has-key.mts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCG;AACI,MAAM,MAAM,GAAG,CAIpB,GAAM,EACN,GAAM,KAC4B,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG;;;;"}
1
+ {"version":3,"file":"has-key.mjs","sources":["../../src/guard/has-key.mts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCG;MACU,MAAM,GAAG,CAIpB,GAAM,EACN,GAAM;AAEN;AACA,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"is-non-null-object.d.mts","sourceRoot":"","sources":["../../src/guard/is-non-null-object.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,eAAO,MAAM,eAAe,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,MACb,CAAC"}
1
+ {"version":3,"file":"is-non-null-object.d.mts","sourceRoot":"","sources":["../../src/guard/is-non-null-object.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,eAAO,MAAM,eAAe,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,MAEb,CAAC"}
@@ -32,7 +32,9 @@
32
32
  * @see {@link isRecord} - For checking plain objects specifically (excludes arrays)
33
33
  */
34
34
  // eslint-disable-next-line @typescript-eslint/no-restricted-types
35
- const isNonNullObject = (u) => typeof u === 'object' && u !== null;
35
+ const isNonNullObject = (u) =>
36
+ // eslint-disable-next-line ts-data-forge/prefer-is-non-null-object
37
+ typeof u === 'object' && u !== null;
36
38
 
37
39
  export { isNonNullObject };
38
40
  //# sourceMappingURL=is-non-null-object.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-non-null-object.mjs","sources":["../../src/guard/is-non-null-object.mts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCG;AACH;AACO,MAAM,eAAe,GAAG,CAAC,CAAU,KACxC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK;;;;"}
1
+ {"version":3,"file":"is-non-null-object.mjs","sources":["../../src/guard/is-non-null-object.mts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCG;AACH;AACO,MAAM,eAAe,GAAG,CAAC,CAAU;AACxC;AACA,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK;;;;"}
@@ -23,7 +23,7 @@
23
23
  * @example
24
24
  *
25
25
  * ```ts
26
- * const entries: readonly unknown[] = [{ id: 1 }, 'str', 0, null];
26
+ * const entries: readonly unknown[] = [{ id: 1 }, 'str', 0, null] as const;
27
27
  *
28
28
  * const records = entries.filter(isRecord);
29
29
  *
@@ -55,7 +55,7 @@ export declare const isRecord: (u: unknown) => u is UnknownRecord;
55
55
  *
56
56
  * @example
57
57
  * ```ts
58
- * const obj: unknown = { foo: 1 };
58
+ * const obj: unknown = { foo: 1 } as const;
59
59
  *
60
60
  * if (isMutableRecord(obj)) {
61
61
  * obj['bar'] = 2; // Safe: obj is now known to be a mutable record
@@ -25,7 +25,7 @@ import { isNonNullObject } from './is-non-null-object.mjs';
25
25
  * @example
26
26
  *
27
27
  * ```ts
28
- * const entries: readonly unknown[] = [{ id: 1 }, 'str', 0, null];
28
+ * const entries: readonly unknown[] = [{ id: 1 }, 'str', 0, null] as const;
29
29
  *
30
30
  * const records = entries.filter(isRecord);
31
31
  *
@@ -57,7 +57,7 @@ const isRecord = (u) => isNonNullObject(u);
57
57
  *
58
58
  * @example
59
59
  * ```ts
60
- * const obj: unknown = { foo: 1 };
60
+ * const obj: unknown = { foo: 1 } as const;
61
61
  *
62
62
  * if (isMutableRecord(obj)) {
63
63
  * obj['bar'] = 2; // Safe: obj is now known to be a mutable record
@@ -9,7 +9,7 @@
9
9
  * @example
10
10
  *
11
11
  * ```ts
12
- * const values: readonly (number | undefined)[] = [1, undefined, 2];
12
+ * const values: readonly (number | undefined)[] = [1, undefined, 2] as const;
13
13
  *
14
14
  * const undefinedValues = values.filter(isUndefined);
15
15
  *
@@ -33,7 +33,7 @@ export declare const isUndefined: (u: unknown) => u is undefined;
33
33
  * @example
34
34
  *
35
35
  * ```ts
36
- * const values: readonly (number | undefined)[] = [1, undefined, 2];
36
+ * const values: readonly (number | undefined)[] = [1, undefined, 2] as const;
37
37
  *
38
38
  * const definedValues = values.filter(isNotUndefined);
39
39
  *
@@ -57,7 +57,7 @@ export declare const isNotUndefined: <T>(u: T) => u is RelaxedExclude<T, undefin
57
57
  * @example
58
58
  *
59
59
  * ```ts
60
- * const flags: readonly unknown[] = [true, 'no', false];
60
+ * const flags: readonly unknown[] = [true, 'no', false] as const;
61
61
  *
62
62
  * const booleans = flags.filter(isBoolean);
63
63
  *
@@ -80,7 +80,7 @@ export declare const isBoolean: (u: unknown) => u is boolean;
80
80
  * @example
81
81
  *
82
82
  * ```ts
83
- * const flags: readonly unknown[] = [true, 'no', false];
83
+ * const flags: readonly unknown[] = [true, 'no', false] as const;
84
84
  *
85
85
  * const nonBooleans = flags.filter(isNotBoolean);
86
86
  *
@@ -105,7 +105,7 @@ export declare const isNotBoolean: <T>(u: T) => u is RelaxedExclude<T, boolean>;
105
105
  * @example
106
106
  *
107
107
  * ```ts
108
- * const mixed: readonly unknown[] = [1, '2', 3];
108
+ * const mixed: readonly unknown[] = [1, '2', 3] as const;
109
109
  *
110
110
  * const numbers = mixed.filter(isNumber);
111
111
  *
@@ -128,7 +128,7 @@ export declare const isNumber: (u: unknown) => u is number;
128
128
  * @example
129
129
  *
130
130
  * ```ts
131
- * const mixed: readonly unknown[] = [1, '2', 3];
131
+ * const mixed: readonly unknown[] = [1, '2', 3] as const;
132
132
  *
133
133
  * const nonNumbers = mixed.filter(isNotNumber);
134
134
  *
@@ -152,7 +152,7 @@ export declare const isNotNumber: <T>(u: T) => u is RelaxedExclude<T, number>;
152
152
  * @example
153
153
  *
154
154
  * ```ts
155
- * const values: readonly unknown[] = [1n, 2, 3n];
155
+ * const values: readonly unknown[] = [1n, 2, 3n] as const;
156
156
  *
157
157
  * const bigints = values.filter(isBigint);
158
158
  *
@@ -175,7 +175,7 @@ export declare const isBigint: (u: unknown) => u is bigint;
175
175
  * @example
176
176
  *
177
177
  * ```ts
178
- * const values: readonly unknown[] = [1n, 2, 3n];
178
+ * const values: readonly unknown[] = [1n, 2, 3n] as const;
179
179
  *
180
180
  * const nonBigints = values.filter(isNotBigint);
181
181
  *
@@ -200,7 +200,7 @@ export declare const isNotBigint: <T>(u: T) => u is RelaxedExclude<T, bigint>;
200
200
  * @example
201
201
  *
202
202
  * ```ts
203
- * const values: readonly unknown[] = ['Ada', 42, 'Lovelace'];
203
+ * const values: readonly unknown[] = ['Ada', 42, 'Lovelace'] as const;
204
204
  *
205
205
  * const strings = values.filter(isString);
206
206
  *
@@ -223,7 +223,7 @@ export declare const isString: (u: unknown) => u is string;
223
223
  * @example
224
224
  *
225
225
  * ```ts
226
- * const values: readonly unknown[] = ['Ada', 42, 'Lovelace'];
226
+ * const values: readonly unknown[] = ['Ada', 42, 'Lovelace'] as const;
227
227
  *
228
228
  * const nonStrings = values.filter(isNotString);
229
229
  *
@@ -251,7 +251,7 @@ export declare const isNotString: <T>(u: T) => u is RelaxedExclude<T, string>;
251
251
  *
252
252
  * const shared = Symbol.for('shared');
253
253
  *
254
- * const tokens: readonly unknown[] = [id, 'shared', shared];
254
+ * const tokens: readonly unknown[] = [id, 'shared', shared] as const;
255
255
  *
256
256
  * const symbols = tokens.filter(isSymbol);
257
257
  *
@@ -276,7 +276,7 @@ export declare const isSymbol: (u: unknown) => u is symbol;
276
276
  * ```ts
277
277
  * const id = Symbol('id');
278
278
  *
279
- * const tokens: readonly unknown[] = [id, 'shared'];
279
+ * const tokens: readonly unknown[] = [id, 'shared'] as const;
280
280
  *
281
281
  * const nonSymbols = tokens.filter(isNotSymbol);
282
282
  *
@@ -324,7 +324,7 @@ export declare const isNull: (u: unknown) => u is null;
324
324
  * @example
325
325
  *
326
326
  * ```ts
327
- * const values: readonly (number | null)[] = [null, 5];
327
+ * const values: readonly (number | null)[] = [null, 5] as const;
328
328
  *
329
329
  * const nonNullValues = values.filter(isNotNull);
330
330
  *
@@ -356,7 +356,7 @@ export declare const isNotNull: <T>(u: T | null) => u is T;
356
356
  * 'Ada',
357
357
  * null,
358
358
  * undefined,
359
- * ];
359
+ * ] as const;
360
360
  *
361
361
  * const nullishValues = values.filter(isNullish);
362
362
  *
@@ -388,7 +388,7 @@ export declare const isNullish: (u: unknown) => u is null | undefined;
388
388
  * 'Ada',
389
389
  * null,
390
390
  * undefined,
391
- * ];
391
+ * ] as const;
392
392
  *
393
393
  * const definedValues = values.filter(isNonNullish);
394
394
  *
@@ -9,7 +9,7 @@
9
9
  * @example
10
10
  *
11
11
  * ```ts
12
- * const values: readonly (number | undefined)[] = [1, undefined, 2];
12
+ * const values: readonly (number | undefined)[] = [1, undefined, 2] as const;
13
13
  *
14
14
  * const undefinedValues = values.filter(isUndefined);
15
15
  *
@@ -33,7 +33,7 @@ const isUndefined = (u) => u === undefined;
33
33
  * @example
34
34
  *
35
35
  * ```ts
36
- * const values: readonly (number | undefined)[] = [1, undefined, 2];
36
+ * const values: readonly (number | undefined)[] = [1, undefined, 2] as const;
37
37
  *
38
38
  * const definedValues = values.filter(isNotUndefined);
39
39
  *
@@ -57,7 +57,7 @@ const isNotUndefined = (u) => u !== undefined;
57
57
  * @example
58
58
  *
59
59
  * ```ts
60
- * const flags: readonly unknown[] = [true, 'no', false];
60
+ * const flags: readonly unknown[] = [true, 'no', false] as const;
61
61
  *
62
62
  * const booleans = flags.filter(isBoolean);
63
63
  *
@@ -80,7 +80,7 @@ const isBoolean = (u) => typeof u === 'boolean';
80
80
  * @example
81
81
  *
82
82
  * ```ts
83
- * const flags: readonly unknown[] = [true, 'no', false];
83
+ * const flags: readonly unknown[] = [true, 'no', false] as const;
84
84
  *
85
85
  * const nonBooleans = flags.filter(isNotBoolean);
86
86
  *
@@ -105,7 +105,7 @@ const isNotBoolean = (u) => typeof u !== 'boolean';
105
105
  * @example
106
106
  *
107
107
  * ```ts
108
- * const mixed: readonly unknown[] = [1, '2', 3];
108
+ * const mixed: readonly unknown[] = [1, '2', 3] as const;
109
109
  *
110
110
  * const numbers = mixed.filter(isNumber);
111
111
  *
@@ -128,7 +128,7 @@ const isNumber = (u) => typeof u === 'number';
128
128
  * @example
129
129
  *
130
130
  * ```ts
131
- * const mixed: readonly unknown[] = [1, '2', 3];
131
+ * const mixed: readonly unknown[] = [1, '2', 3] as const;
132
132
  *
133
133
  * const nonNumbers = mixed.filter(isNotNumber);
134
134
  *
@@ -152,7 +152,7 @@ const isNotNumber = (u) => typeof u !== 'number';
152
152
  * @example
153
153
  *
154
154
  * ```ts
155
- * const values: readonly unknown[] = [1n, 2, 3n];
155
+ * const values: readonly unknown[] = [1n, 2, 3n] as const;
156
156
  *
157
157
  * const bigints = values.filter(isBigint);
158
158
  *
@@ -175,7 +175,7 @@ const isBigint = (u) => typeof u === 'bigint';
175
175
  * @example
176
176
  *
177
177
  * ```ts
178
- * const values: readonly unknown[] = [1n, 2, 3n];
178
+ * const values: readonly unknown[] = [1n, 2, 3n] as const;
179
179
  *
180
180
  * const nonBigints = values.filter(isNotBigint);
181
181
  *
@@ -200,7 +200,7 @@ const isNotBigint = (u) => typeof u !== 'bigint';
200
200
  * @example
201
201
  *
202
202
  * ```ts
203
- * const values: readonly unknown[] = ['Ada', 42, 'Lovelace'];
203
+ * const values: readonly unknown[] = ['Ada', 42, 'Lovelace'] as const;
204
204
  *
205
205
  * const strings = values.filter(isString);
206
206
  *
@@ -223,7 +223,7 @@ const isString = (u) => typeof u === 'string';
223
223
  * @example
224
224
  *
225
225
  * ```ts
226
- * const values: readonly unknown[] = ['Ada', 42, 'Lovelace'];
226
+ * const values: readonly unknown[] = ['Ada', 42, 'Lovelace'] as const;
227
227
  *
228
228
  * const nonStrings = values.filter(isNotString);
229
229
  *
@@ -251,7 +251,7 @@ const isNotString = (u) => typeof u !== 'string';
251
251
  *
252
252
  * const shared = Symbol.for('shared');
253
253
  *
254
- * const tokens: readonly unknown[] = [id, 'shared', shared];
254
+ * const tokens: readonly unknown[] = [id, 'shared', shared] as const;
255
255
  *
256
256
  * const symbols = tokens.filter(isSymbol);
257
257
  *
@@ -276,7 +276,7 @@ const isSymbol = (u) => typeof u === 'symbol';
276
276
  * ```ts
277
277
  * const id = Symbol('id');
278
278
  *
279
- * const tokens: readonly unknown[] = [id, 'shared'];
279
+ * const tokens: readonly unknown[] = [id, 'shared'] as const;
280
280
  *
281
281
  * const nonSymbols = tokens.filter(isNotSymbol);
282
282
  *
@@ -324,7 +324,7 @@ const isNull = (u) => u === null;
324
324
  * @example
325
325
  *
326
326
  * ```ts
327
- * const values: readonly (number | null)[] = [null, 5];
327
+ * const values: readonly (number | null)[] = [null, 5] as const;
328
328
  *
329
329
  * const nonNullValues = values.filter(isNotNull);
330
330
  *
@@ -356,7 +356,7 @@ const isNotNull = (u) => u !== null;
356
356
  * 'Ada',
357
357
  * null,
358
358
  * undefined,
359
- * ];
359
+ * ] as const;
360
360
  *
361
361
  * const nullishValues = values.filter(isNullish);
362
362
  *
@@ -388,7 +388,7 @@ const isNullish = (u) => u == null;
388
388
  * 'Ada',
389
389
  * null,
390
390
  * undefined,
391
- * ];
391
+ * ] as const;
392
392
  *
393
393
  * const definedValues = values.filter(isNonNullish);
394
394
  *
@@ -1 +1 @@
1
- {"version":3,"file":"key-is-in.d.mts","sourceRoot":"","sources":["../../src/guard/key-is-in.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,OAAO,GAClB,KAAK,CAAC,CAAC,SAAS,WAAW,EAC3B,KAAK,CAAC,CAAC,SAAS,aAAa,EAE7B,KAAK,CAAC,EACN,KAAK,CAAC,KACL,GAAG,IAAI,CAAC,GAAG,MAAM,OAAO,GAA8B,CAAC"}
1
+ {"version":3,"file":"key-is-in.d.mts","sourceRoot":"","sources":["../../src/guard/key-is-in.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,OAAO,GAClB,KAAK,CAAC,CAAC,SAAS,WAAW,EAC3B,KAAK,CAAC,CAAC,SAAS,aAAa,EAE7B,KAAK,CAAC,EACN,KAAK,CAAC,KACL,GAAG,IAAI,CAAC,GAAG,MAAM,OAAO,GAEF,CAAC"}
@@ -38,7 +38,9 @@
38
38
  * `true`, TypeScript narrows the key type to be a valid key of the object.
39
39
  * @see {@link hasKey} - Similar function that narrows the object type instead of the key type
40
40
  */
41
- const keyIsIn = (key, obj) => Object.hasOwn(obj, key);
41
+ const keyIsIn = (key, obj) =>
42
+ // eslint-disable-next-line ts-data-forge/prefer-is-record-and-has-key
43
+ Object.hasOwn(obj, key);
42
44
 
43
45
  export { keyIsIn };
44
46
  //# sourceMappingURL=key-is-in.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"key-is-in.mjs","sources":["../../src/guard/key-is-in.mts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;AACI,MAAM,OAAO,GAAG,CAIrB,GAAM,EACN,GAAM,KAC0B,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG;;;;"}
1
+ {"version":3,"file":"key-is-in.mjs","sources":["../../src/guard/key-is-in.mts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;MACU,OAAO,GAAG,CAIrB,GAAM,EACN,GAAM;AAEN;AACA,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG;;;;"}
package/dist/index.mjs CHANGED
@@ -48,6 +48,7 @@ export { Obj } from './object/object.mjs';
48
48
  export { castDeepMutable, castMutable } from './others/cast-mutable.mjs';
49
49
  export { castDeepReadonly, castReadonly } from './others/cast-readonly.mjs';
50
50
  export { debounce } from './others/debounce-function.mjs';
51
+ export { fastDeepEqual } from './others/fast-deep-equal.mjs';
51
52
  export { ifThen } from './others/if-then.mjs';
52
53
  export { mapNullable } from './others/map-nullable.mjs';
53
54
  export { memoizeFunction } from './others/memoize-function.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -70,7 +70,7 @@ export declare namespace Json {
70
70
  * @example
71
71
  *
72
72
  * ```ts
73
- * const data = { name: 'Bob', age: 25, active: true };
73
+ * const data = { name: 'Bob', age: 25, active: true } as const;
74
74
  *
75
75
  * // Basic stringify
76
76
  * const basic = Json.stringify(data);
@@ -141,7 +141,7 @@ export declare namespace Json {
141
141
  * email: 'charlie@example.com',
142
142
  * password: 'secret123',
143
143
  * role: 'admin',
144
- * };
144
+ * } as const;
145
145
  *
146
146
  * // Select only safe properties to serialize
147
147
  * const safeJson = Json.stringifySelected(user, ['id', 'name', 'role']);
@@ -211,7 +211,7 @@ export declare namespace Json {
211
211
  * alpha: 'a',
212
212
  * beta: 'b',
213
213
  * },
214
- * };
214
+ * } as const;
215
215
  *
216
216
  * // Keys will be sorted alphabetically at all levels
217
217
  * const sorted = Json.stringifySortedKey(unorderedData);
@@ -124,7 +124,7 @@ var Json;
124
124
  * @example
125
125
  *
126
126
  * ```ts
127
- * const data = { name: 'Bob', age: 25, active: true };
127
+ * const data = { name: 'Bob', age: 25, active: true } as const;
128
128
  *
129
129
  * // Basic stringify
130
130
  * const basic = Json.stringify(data);
@@ -203,7 +203,7 @@ var Json;
203
203
  * email: 'charlie@example.com',
204
204
  * password: 'secret123',
205
205
  * role: 'admin',
206
- * };
206
+ * } as const;
207
207
  *
208
208
  * // Select only safe properties to serialize
209
209
  * const safeJson = Json.stringifySelected(user, ['id', 'name', 'role']);
@@ -281,7 +281,7 @@ var Json;
281
281
  * alpha: 'a',
282
282
  * beta: 'b',
283
283
  * },
284
- * };
284
+ * } as const;
285
285
  *
286
286
  * // Keys will be sorted alphabetically at all levels
287
287
  * const sorted = Json.stringifySortedKey(unorderedData);
@@ -363,6 +363,7 @@ mut_keys) => {
363
363
  if (isRecord(o)) {
364
364
  keysDeepImpl(o, mut_keys);
365
365
  }
366
+ // eslint-disable-next-line ts-data-forge/prefer-arr-is-array
366
367
  if (Array.isArray(o)) {
367
368
  for (const li of o) {
368
369
  if (isRecord(li)) {