@fgv/ts-utils 5.1.0-3 → 5.1.0-31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/README.md +21 -0
  2. package/dist/index.js.map +1 -0
  3. package/dist/packlets/base/brand.js.map +1 -0
  4. package/dist/packlets/base/index.js +2 -0
  5. package/dist/packlets/base/index.js.map +1 -0
  6. package/dist/packlets/base/mapResults.js.map +1 -0
  7. package/dist/packlets/base/messageAggregator.js.map +1 -0
  8. package/dist/packlets/base/normalize.js +54 -1
  9. package/dist/packlets/base/normalize.js.map +1 -0
  10. package/dist/packlets/base/result.js +299 -2
  11. package/dist/packlets/base/result.js.map +1 -0
  12. package/dist/packlets/base/shouldNotFail.js +123 -0
  13. package/dist/packlets/base/shouldNotFail.js.map +1 -0
  14. package/dist/packlets/base/utils.js.map +1 -0
  15. package/dist/packlets/base/uuid.js +55 -0
  16. package/dist/packlets/base/uuid.js.map +1 -0
  17. package/dist/packlets/collections/aggregatedResultMap.js.map +1 -0
  18. package/dist/packlets/collections/collectible.js.map +1 -0
  19. package/dist/packlets/collections/collector.js +23 -9
  20. package/dist/packlets/collections/collector.js.map +1 -0
  21. package/dist/packlets/collections/collectorValidator.js +6 -1
  22. package/dist/packlets/collections/collectorValidator.js.map +1 -0
  23. package/dist/packlets/collections/common.js.map +1 -0
  24. package/dist/packlets/collections/converters.js.map +1 -0
  25. package/dist/packlets/collections/convertingCollector.js.map +1 -0
  26. package/dist/packlets/collections/convertingCollectorValidator.js.map +1 -0
  27. package/dist/packlets/collections/convertingResultMap.js.map +1 -0
  28. package/dist/packlets/collections/index.js.map +1 -0
  29. package/dist/packlets/collections/keyValueConverters.js.map +1 -0
  30. package/dist/packlets/collections/readOnlyConvertingResultMap.js.map +1 -0
  31. package/dist/packlets/collections/readonlyResultMap.js.map +1 -0
  32. package/dist/packlets/collections/resultMap.js.map +1 -0
  33. package/dist/packlets/collections/resultMapValidator.js.map +1 -0
  34. package/dist/packlets/collections/utils.js.map +1 -0
  35. package/dist/packlets/collections/validatingCollector.js.map +1 -0
  36. package/dist/packlets/collections/validatingConvertingCollector.js.map +1 -0
  37. package/dist/packlets/collections/validatingConvertingResultMap.js.map +1 -0
  38. package/dist/packlets/collections/validatingResultMap.js.map +1 -0
  39. package/dist/packlets/conversion/advancedConverters.js.map +1 -0
  40. package/dist/packlets/conversion/baseConverter.js +102 -16
  41. package/dist/packlets/conversion/baseConverter.js.map +1 -0
  42. package/dist/packlets/conversion/basicConverters.js.map +1 -0
  43. package/dist/packlets/conversion/converter.js.map +1 -0
  44. package/dist/packlets/conversion/converters.js.map +1 -0
  45. package/dist/packlets/conversion/defaultingConverter.js.map +1 -0
  46. package/dist/packlets/conversion/index.js.map +1 -0
  47. package/dist/packlets/conversion/objectConverter.js.map +1 -0
  48. package/dist/packlets/conversion/stringConverter.js.map +1 -0
  49. package/dist/packlets/hash/crcNormalizer.js.map +1 -0
  50. package/dist/packlets/hash/hashingNormalizer.js.map +1 -0
  51. package/dist/packlets/hash/index.js.map +1 -0
  52. package/dist/packlets/logging/bootLogger.js.map +1 -0
  53. package/dist/packlets/logging/index.js +2 -0
  54. package/dist/packlets/logging/index.js.map +1 -0
  55. package/dist/packlets/logging/logReporter.js.map +1 -0
  56. package/dist/packlets/logging/logger.js +49 -8
  57. package/dist/packlets/logging/logger.js.map +1 -0
  58. package/dist/packlets/logging/multiLogger.js +104 -0
  59. package/dist/packlets/logging/multiLogger.js.map +1 -0
  60. package/dist/packlets/logging/retainingLogger.js +161 -0
  61. package/dist/packlets/logging/retainingLogger.js.map +1 -0
  62. package/dist/packlets/validation/array.js.map +1 -0
  63. package/dist/packlets/validation/boolean.js.map +1 -0
  64. package/dist/packlets/validation/classes.js.map +1 -0
  65. package/dist/packlets/validation/common.js.map +1 -0
  66. package/dist/packlets/validation/compositeId.js.map +1 -0
  67. package/dist/packlets/validation/field.js.map +1 -0
  68. package/dist/packlets/validation/genericValidator.js.map +1 -0
  69. package/dist/packlets/validation/index.js.map +1 -0
  70. package/dist/packlets/validation/number.js.map +1 -0
  71. package/dist/packlets/validation/object.js.map +1 -0
  72. package/dist/packlets/validation/oneOf.js.map +1 -0
  73. package/dist/packlets/validation/string.js.map +1 -0
  74. package/dist/packlets/validation/traits.js.map +1 -0
  75. package/dist/packlets/validation/typeGuard.js.map +1 -0
  76. package/dist/packlets/validation/validator.js.map +1 -0
  77. package/dist/packlets/validation/validatorBase.js.map +1 -0
  78. package/dist/packlets/validation/validators.js.map +1 -0
  79. package/dist/ts-utils.d.ts +861 -57
  80. package/dist/tsdoc-metadata.json +1 -1
  81. package/lib/index.d.ts.map +1 -0
  82. package/lib/index.js.map +1 -0
  83. package/lib/packlets/base/brand.d.ts.map +1 -0
  84. package/lib/packlets/base/brand.js.map +1 -0
  85. package/lib/packlets/base/index.d.ts +2 -0
  86. package/lib/packlets/base/index.d.ts.map +1 -0
  87. package/lib/packlets/base/index.js +2 -0
  88. package/lib/packlets/base/index.js.map +1 -0
  89. package/lib/packlets/base/mapResults.d.ts.map +1 -0
  90. package/lib/packlets/base/mapResults.js.map +1 -0
  91. package/lib/packlets/base/messageAggregator.d.ts.map +1 -0
  92. package/lib/packlets/base/messageAggregator.js.map +1 -0
  93. package/lib/packlets/base/normalize.d.ts +24 -0
  94. package/lib/packlets/base/normalize.d.ts.map +1 -0
  95. package/lib/packlets/base/normalize.js +53 -0
  96. package/lib/packlets/base/normalize.js.map +1 -0
  97. package/lib/packlets/base/result.d.ts +263 -1
  98. package/lib/packlets/base/result.d.ts.map +1 -0
  99. package/lib/packlets/base/result.js +303 -3
  100. package/lib/packlets/base/result.js.map +1 -0
  101. package/lib/packlets/base/shouldNotFail.d.ts +53 -0
  102. package/lib/packlets/base/shouldNotFail.d.ts.map +1 -0
  103. package/lib/packlets/base/shouldNotFail.js +129 -0
  104. package/lib/packlets/base/shouldNotFail.js.map +1 -0
  105. package/lib/packlets/base/utils.d.ts +12 -0
  106. package/lib/packlets/base/utils.d.ts.map +1 -0
  107. package/lib/packlets/base/utils.js.map +1 -0
  108. package/lib/packlets/base/uuid.d.ts +27 -0
  109. package/lib/packlets/base/uuid.d.ts.map +1 -0
  110. package/lib/packlets/base/uuid.js +59 -0
  111. package/lib/packlets/base/uuid.js.map +1 -0
  112. package/lib/packlets/collections/aggregatedResultMap.d.ts.map +1 -0
  113. package/lib/packlets/collections/aggregatedResultMap.js.map +1 -0
  114. package/lib/packlets/collections/collectible.d.ts.map +1 -0
  115. package/lib/packlets/collections/collectible.js.map +1 -0
  116. package/lib/packlets/collections/collector.d.ts +23 -9
  117. package/lib/packlets/collections/collector.d.ts.map +1 -0
  118. package/lib/packlets/collections/collector.js +23 -9
  119. package/lib/packlets/collections/collector.js.map +1 -0
  120. package/lib/packlets/collections/collectorValidator.d.ts +29 -5
  121. package/lib/packlets/collections/collectorValidator.d.ts.map +1 -0
  122. package/lib/packlets/collections/collectorValidator.js +6 -1
  123. package/lib/packlets/collections/collectorValidator.js.map +1 -0
  124. package/lib/packlets/collections/common.d.ts.map +1 -0
  125. package/lib/packlets/collections/common.js.map +1 -0
  126. package/lib/packlets/collections/converters.d.ts.map +1 -0
  127. package/lib/packlets/collections/converters.js.map +1 -0
  128. package/lib/packlets/collections/convertingCollector.d.ts +21 -3
  129. package/lib/packlets/collections/convertingCollector.d.ts.map +1 -0
  130. package/lib/packlets/collections/convertingCollector.js.map +1 -0
  131. package/lib/packlets/collections/convertingCollectorValidator.d.ts +22 -3
  132. package/lib/packlets/collections/convertingCollectorValidator.d.ts.map +1 -0
  133. package/lib/packlets/collections/convertingCollectorValidator.js.map +1 -0
  134. package/lib/packlets/collections/convertingResultMap.d.ts.map +1 -0
  135. package/lib/packlets/collections/convertingResultMap.js.map +1 -0
  136. package/lib/packlets/collections/index.d.ts.map +1 -0
  137. package/lib/packlets/collections/index.js.map +1 -0
  138. package/lib/packlets/collections/keyValueConverters.d.ts.map +1 -0
  139. package/lib/packlets/collections/keyValueConverters.js.map +1 -0
  140. package/lib/packlets/collections/readOnlyConvertingResultMap.d.ts.map +1 -0
  141. package/lib/packlets/collections/readOnlyConvertingResultMap.js.map +1 -0
  142. package/lib/packlets/collections/readonlyResultMap.d.ts +18 -7
  143. package/lib/packlets/collections/readonlyResultMap.d.ts.map +1 -0
  144. package/lib/packlets/collections/readonlyResultMap.js.map +1 -0
  145. package/lib/packlets/collections/resultMap.d.ts.map +1 -0
  146. package/lib/packlets/collections/resultMap.js.map +1 -0
  147. package/lib/packlets/collections/resultMapValidator.d.ts.map +1 -0
  148. package/lib/packlets/collections/resultMapValidator.js.map +1 -0
  149. package/lib/packlets/collections/utils.d.ts.map +1 -0
  150. package/lib/packlets/collections/utils.js.map +1 -0
  151. package/lib/packlets/collections/validatingCollector.d.ts +7 -3
  152. package/lib/packlets/collections/validatingCollector.d.ts.map +1 -0
  153. package/lib/packlets/collections/validatingCollector.js.map +1 -0
  154. package/lib/packlets/collections/validatingConvertingCollector.d.ts.map +1 -0
  155. package/lib/packlets/collections/validatingConvertingCollector.js.map +1 -0
  156. package/lib/packlets/collections/validatingConvertingResultMap.d.ts.map +1 -0
  157. package/lib/packlets/collections/validatingConvertingResultMap.js.map +1 -0
  158. package/lib/packlets/collections/validatingResultMap.d.ts +2 -1
  159. package/lib/packlets/collections/validatingResultMap.d.ts.map +1 -0
  160. package/lib/packlets/collections/validatingResultMap.js.map +1 -0
  161. package/lib/packlets/conversion/advancedConverters.d.ts.map +1 -0
  162. package/lib/packlets/conversion/advancedConverters.js.map +1 -0
  163. package/lib/packlets/conversion/baseConverter.d.ts +102 -16
  164. package/lib/packlets/conversion/baseConverter.d.ts.map +1 -0
  165. package/lib/packlets/conversion/baseConverter.js +102 -16
  166. package/lib/packlets/conversion/baseConverter.js.map +1 -0
  167. package/lib/packlets/conversion/basicConverters.d.ts.map +1 -0
  168. package/lib/packlets/conversion/basicConverters.js.map +1 -0
  169. package/lib/packlets/conversion/converter.d.ts.map +1 -0
  170. package/lib/packlets/conversion/converter.js.map +1 -0
  171. package/lib/packlets/conversion/converters.d.ts.map +1 -0
  172. package/lib/packlets/conversion/converters.js.map +1 -0
  173. package/lib/packlets/conversion/defaultingConverter.d.ts.map +1 -0
  174. package/lib/packlets/conversion/defaultingConverter.js.map +1 -0
  175. package/lib/packlets/conversion/index.d.ts.map +1 -0
  176. package/lib/packlets/conversion/index.js.map +1 -0
  177. package/lib/packlets/conversion/objectConverter.d.ts.map +1 -0
  178. package/lib/packlets/conversion/objectConverter.js.map +1 -0
  179. package/lib/packlets/conversion/stringConverter.d.ts.map +1 -0
  180. package/lib/packlets/conversion/stringConverter.js.map +1 -0
  181. package/lib/packlets/hash/crcNormalizer.d.ts.map +1 -0
  182. package/lib/packlets/hash/crcNormalizer.js.map +1 -0
  183. package/lib/packlets/hash/hashingNormalizer.d.ts.map +1 -0
  184. package/lib/packlets/hash/hashingNormalizer.js.map +1 -0
  185. package/lib/packlets/hash/index.d.ts.map +1 -0
  186. package/lib/packlets/hash/index.js.map +1 -0
  187. package/lib/packlets/logging/bootLogger.d.ts.map +1 -0
  188. package/lib/packlets/logging/bootLogger.js.map +1 -0
  189. package/lib/packlets/logging/index.d.ts +2 -0
  190. package/lib/packlets/logging/index.d.ts.map +1 -0
  191. package/lib/packlets/logging/index.js +2 -0
  192. package/lib/packlets/logging/index.js.map +1 -0
  193. package/lib/packlets/logging/logReporter.d.ts.map +1 -0
  194. package/lib/packlets/logging/logReporter.js.map +1 -0
  195. package/lib/packlets/logging/logger.d.ts +46 -8
  196. package/lib/packlets/logging/logger.d.ts.map +1 -0
  197. package/lib/packlets/logging/logger.js +49 -8
  198. package/lib/packlets/logging/logger.js.map +1 -0
  199. package/lib/packlets/logging/multiLogger.d.ts +54 -0
  200. package/lib/packlets/logging/multiLogger.d.ts.map +1 -0
  201. package/lib/packlets/logging/multiLogger.js +108 -0
  202. package/lib/packlets/logging/multiLogger.js.map +1 -0
  203. package/lib/packlets/logging/retainingLogger.d.ts +143 -0
  204. package/lib/packlets/logging/retainingLogger.d.ts.map +1 -0
  205. package/lib/packlets/logging/retainingLogger.js +165 -0
  206. package/lib/packlets/logging/retainingLogger.js.map +1 -0
  207. package/lib/packlets/validation/array.d.ts.map +1 -0
  208. package/lib/packlets/validation/array.js.map +1 -0
  209. package/lib/packlets/validation/boolean.d.ts.map +1 -0
  210. package/lib/packlets/validation/boolean.js.map +1 -0
  211. package/lib/packlets/validation/classes.d.ts.map +1 -0
  212. package/lib/packlets/validation/classes.js.map +1 -0
  213. package/lib/packlets/validation/common.d.ts.map +1 -0
  214. package/lib/packlets/validation/common.js.map +1 -0
  215. package/lib/packlets/validation/compositeId.d.ts.map +1 -0
  216. package/lib/packlets/validation/compositeId.js.map +1 -0
  217. package/lib/packlets/validation/field.d.ts.map +1 -0
  218. package/lib/packlets/validation/field.js.map +1 -0
  219. package/lib/packlets/validation/genericValidator.d.ts.map +1 -0
  220. package/lib/packlets/validation/genericValidator.js.map +1 -0
  221. package/lib/packlets/validation/index.d.ts.map +1 -0
  222. package/lib/packlets/validation/index.js.map +1 -0
  223. package/lib/packlets/validation/number.d.ts.map +1 -0
  224. package/lib/packlets/validation/number.js.map +1 -0
  225. package/lib/packlets/validation/object.d.ts.map +1 -0
  226. package/lib/packlets/validation/object.js.map +1 -0
  227. package/lib/packlets/validation/oneOf.d.ts.map +1 -0
  228. package/lib/packlets/validation/oneOf.js.map +1 -0
  229. package/lib/packlets/validation/string.d.ts.map +1 -0
  230. package/lib/packlets/validation/string.js.map +1 -0
  231. package/lib/packlets/validation/traits.d.ts.map +1 -0
  232. package/lib/packlets/validation/traits.js.map +1 -0
  233. package/lib/packlets/validation/typeGuard.d.ts.map +1 -0
  234. package/lib/packlets/validation/typeGuard.js.map +1 -0
  235. package/lib/packlets/validation/validator.d.ts.map +1 -0
  236. package/lib/packlets/validation/validator.js.map +1 -0
  237. package/lib/packlets/validation/validatorBase.d.ts +2 -1
  238. package/lib/packlets/validation/validatorBase.d.ts.map +1 -0
  239. package/lib/packlets/validation/validatorBase.js.map +1 -0
  240. package/lib/packlets/validation/validators.d.ts.map +1 -0
  241. package/lib/packlets/validation/validators.js.map +1 -0
  242. package/package.json +6 -4
  243. package/dist/test/helpers/jest/helpers/fsHelpers.js +0 -139
  244. package/dist/test/helpers/jest/helpers/index.js +0 -2
  245. package/dist/test/helpers/jest/index.js +0 -17
  246. package/dist/test/helpers/jest/matchers/index.js +0 -14
  247. package/dist/test/helpers/jest/matchers/toFail/index.js +0 -23
  248. package/dist/test/helpers/jest/matchers/toFail/predicate.js +0 -5
  249. package/dist/test/helpers/jest/matchers/toFailTest/index.js +0 -28
  250. package/dist/test/helpers/jest/matchers/toFailTest/predicate.js +0 -8
  251. package/dist/test/helpers/jest/matchers/toFailTestAndMatchSnapshot/index.js +0 -24
  252. package/dist/test/helpers/jest/matchers/toFailTestAndMatchSnapshot/predicate.js +0 -11
  253. package/dist/test/helpers/jest/matchers/toFailTestWith/index.js +0 -29
  254. package/dist/test/helpers/jest/matchers/toFailTestWith/predicate.js +0 -26
  255. package/dist/test/helpers/jest/matchers/toFailWith/index.js +0 -27
  256. package/dist/test/helpers/jest/matchers/toFailWith/predicate.js +0 -16
  257. package/dist/test/helpers/jest/matchers/toFailWithDetail/index.js +0 -27
  258. package/dist/test/helpers/jest/matchers/toFailWithDetail/predicate.js +0 -22
  259. package/dist/test/helpers/jest/matchers/toSucceed/index.js +0 -23
  260. package/dist/test/helpers/jest/matchers/toSucceed/predicate.js +0 -5
  261. package/dist/test/helpers/jest/matchers/toSucceedAndMatchInlineSnapshot/index.js +0 -24
  262. package/dist/test/helpers/jest/matchers/toSucceedAndMatchSnapshot/index.js +0 -24
  263. package/dist/test/helpers/jest/matchers/toSucceedAndSatisfy/index.js +0 -53
  264. package/dist/test/helpers/jest/matchers/toSucceedAndSatisfy/predicate.js +0 -17
  265. package/dist/test/helpers/jest/matchers/toSucceedWith/index.js +0 -27
  266. package/dist/test/helpers/jest/matchers/toSucceedWith/predicate.js +0 -12
  267. package/dist/test/helpers/jest/matchers/toSucceedWithDetail/index.js +0 -27
  268. package/dist/test/helpers/jest/matchers/toSucceedWithDetail/predicate.js +0 -17
  269. package/dist/test/helpers/jest/resolvers/cli.js +0 -10
  270. package/dist/test/helpers/jest/resolvers/ide.js +0 -10
  271. package/dist/test/helpers/jest/ts-utils.js +0 -2
  272. package/dist/test/helpers/jest/types/index.js +0 -3
  273. package/dist/test/helpers/jest/utils/matcherHelpers.js +0 -47
  274. package/dist/test/helpers/jest/utils/snapshotResolver.js +0 -11
  275. package/dist/test/unit/collections/helpers.js +0 -106
  276. package/dist/test/unit/hashTextEncodeCompat.js +0 -23
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.57.6"
8
+ "packageVersion": "7.58.7"
9
9
  }
10
10
  ]
11
11
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,WAAW,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EACL,mBAAmB,EACnB,SAAS,EACT,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,SAAS,EACT,mBAAmB,EACnB,6BAA6B,EAC7B,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE9D,cAAc,iBAAiB,CAAC;AAChC,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,UAAU,EACV,IAAI,EACJ,YAAY,EACZ,kBAAkB,EAClB,OAAO,EACP,eAAe,EACf,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,6BAA6B,EAC7B,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,UAAU,EACX,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,oEAAsD;AAuBpD,kCAAW;AAtBb,kEAAoD;AAyBlD,gCAAU;AAxBZ,sDAAwC;AA2BtC,oBAAI;AA1BN,4DAA8C;AA6B5C,0BAAO;AA5BT,kEAAoD;AAmClD,gCAAU;AAjCZ,wDAUgC;AAM9B,oGAfA,iCAAmB,OAeA;AAEnB,0FAhBA,uBAAS,OAgBA;AACT,oGAfA,iCAAmB,OAeA;AASnB,0FAtBA,uBAAS,OAsBA;AAET,oGAvBA,iCAAmB,OAuBA;AACnB,8GAvBA,2CAA6B,OAuBA;AAC7B,oGAvBA,iCAAmB,OAuBA;AArBrB,sDAAgG;AAW9F,2FAXkB,uBAAU,OAWlB;AAKV,gGAhB8B,4BAAe,OAgB9B;AAEf,gGAlB+C,4BAAe,OAkB/C;AAjBjB,sDAA8D;AAuB5D,2FAvBkB,uBAAU,OAuBlB;AArBZ,kDAAgC","sourcesContent":["/*\n * Copyright (c) 2020 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Collections from './packlets/collections';\nimport * as Conversion from './packlets/conversion';\nimport * as Hash from './packlets/hash';\nimport * as Logging from './packlets/logging';\nimport * as Validation from './packlets/validation';\n\nimport {\n AggregatedResultMap,\n Collector,\n ICollectible,\n ConvertingCollector,\n IReadOnlyResultMap,\n ResultMap,\n ValidatingCollector,\n ValidatingConvertingCollector,\n ValidatingResultMap\n} from './packlets/collections';\nimport { Converter, Converters, ObjectConverter, StringConverter } from './packlets/conversion';\nimport { Validator, Validators } from './packlets/validation';\n\nexport * from './packlets/base';\nexport {\n AggregatedResultMap,\n Collections,\n Collector,\n ConvertingCollector,\n Conversion,\n Converter,\n Converters,\n Hash,\n ICollectible,\n IReadOnlyResultMap,\n Logging,\n ObjectConverter,\n ResultMap,\n StringConverter,\n ValidatingCollector,\n ValidatingConvertingCollector,\n ValidatingResultMap,\n Validation,\n Validator,\n Validators\n};\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brand.d.ts","sourceRoot":"","sources":["../../../src/packlets/base/brand.ts"],"names":[],"mappings":"AAsBA;;;GAGG;AAEH,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,OAAO,EAAE,CAAC,CAAA;CAAE,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brand.js","sourceRoot":"","sources":["../../../src/packlets/base/brand.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2021 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * Helper type to brand a simple type to prevent inappropriate use\n * @public\n */\n\nexport type Brand<T, B> = T & { __brand: B };\n"]}
@@ -3,5 +3,7 @@ export * from './mapResults';
3
3
  export * from './messageAggregator';
4
4
  export { Normalizer } from './normalize';
5
5
  export * from './result';
6
+ export * from './shouldNotFail';
6
7
  export * from './utils';
8
+ export * from './uuid';
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/base/index.ts"],"names":[],"mappings":"AAsBA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
@@ -42,5 +42,7 @@ __exportStar(require("./messageAggregator"), exports);
42
42
  var normalize_1 = require("./normalize");
43
43
  Object.defineProperty(exports, "Normalizer", { enumerable: true, get: function () { return normalize_1.Normalizer; } });
44
44
  __exportStar(require("./result"), exports);
45
+ __exportStar(require("./shouldNotFail"), exports);
45
46
  __exportStar(require("./utils"), exports);
47
+ __exportStar(require("./uuid"), exports);
46
48
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/base/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,+CAA6B;AAC7B,sDAAoC;AACpC,yCAAyC;AAAhC,uGAAA,UAAU,OAAA;AACnB,2CAAyB;AACzB,kDAAgC;AAChC,0CAAwB;AACxB,yCAAuB","sourcesContent":["/*\n * Copyright (c) 2020 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nexport * from './brand';\nexport * from './mapResults';\nexport * from './messageAggregator';\nexport { Normalizer } from './normalize';\nexport * from './result';\nexport * from './shouldNotFail';\nexport * from './utils';\nexport * from './uuid';\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapResults.d.ts","sourceRoot":"","sources":["../../../src/packlets/base/mapResults.ts"],"names":[],"mappings":"AAuBA,OAAO,EACL,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,MAAM,EAIP,MAAM,UAAU,CAAC;AAElB;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAC1B,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAC5B,gBAAgB,CAAC,EAAE,kBAAkB,GACpC,MAAM,CAAC,CAAC,EAAE,CAAC,CAiBb;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,EAAE,EACtC,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EACxC,MAAM,EAAE,EAAE,EAAE,EACZ,gBAAgB,CAAC,EAAE,kBAAkB,GACpC,MAAM,CAAC,CAAC,EAAE,CAAC,CAiBb;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAC1B,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAC5B,gBAAgB,CAAC,EAAE,kBAAkB,GACpC,MAAM,CAAC,CAAC,EAAE,CAAC,CAiBb;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAC5B,gBAAgB,CAAC,EAAE,kBAAkB,GACpC,MAAM,EAAE,CASV;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAC1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AAG,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;YACxC,IAAI,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC;gBACvB,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;oBAC/B,IACE,OAAO,CAAC,iBAAiB,KAAK,IAAI;wBAClC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,OAAO,CAAC,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EACrF,CAAC;wBACD,SAAS;oBACX,CAAC;gBACH,CAAC;gBACD,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC;YAC5B,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,IAAI,CAAC,uBAAuB,MAAM,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;QACtF,CAAC;IACH,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QACtC,OAAO,IAAA,aAAI,EAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,IAAA,gBAAO,EAAC,KAAU,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["/*\n * Copyright (c) 2020 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { MessageAggregator } from './messageAggregator';\nimport {\n DeferredResult,\n DetailedResult,\n IMessageAggregator,\n Result,\n fail,\n isDeferredResult,\n succeed\n} from './result';\n\n/**\n * Aggregates successful result values from a collection of {@link Result | Result<T>}.\n * @param results - The collection of {@link Result | Result<T>} to be mapped.\n * @param aggregatedErrors - Optional string array to which any error messages will be\n * appended. Each error is appended as an individual string.\n * @returns If all {@link Result | results} are successful, returns {@link Success} with an\n * array containing all returned values. If any {@link Result | results} failed, returns\n * {@link Failure} with a concatenated summary of all error messages.\n * @public\n */\nexport function mapResults<T>(\n results: Iterable<Result<T>>,\n aggregatedErrors?: IMessageAggregator\n): Result<T[]> {\n const errors: string[] = [];\n const elements: T[] = [];\n\n for (const result of results) {\n if (result.isSuccess()) {\n elements.push(result.value);\n } else {\n errors.push(result.message);\n }\n }\n\n if (errors.length > 0) {\n aggregatedErrors?.addMessages(errors);\n return fail(errors.join('\\n'));\n }\n return succeed(elements);\n}\n\n/**\n * Aggregates successful results from a collection of {@link DetailedResult | DetailedResult<T, TD>},\n * optionally ignoring certain error details.\n * @param results - The collection of {@link DetailedResult | DetailedResult<T, TD>} to be mapped.\n * @param ignore - An array of error detail values (of type `<TD>`) that should be ignored.\n * @param aggregatedErrors - Optional string array to which any non-ignorable error messages will be\n * appended. Each error is appended as an individual string.\n * @returns {@link Success} with an array containing all successful results if all results either\n * succeeded or returned error details listed in `ignore`. If any results failed with details\n * that cannot be ignored, returns {@link Failure} with an concatenated summary of all non-ignorable\n * error messages.\n * @public\n */\nexport function mapDetailedResults<T, TD>(\n results: Iterable<DetailedResult<T, TD>>,\n ignore: TD[],\n aggregatedErrors?: IMessageAggregator\n): Result<T[]> {\n const errors: string[] = [];\n const elements: T[] = [];\n\n for (const result of results) {\n if (result.isSuccess()) {\n elements.push(result.value);\n } else if (result.detail && !ignore.includes(result.detail)) {\n errors.push(result.message);\n }\n }\n\n if (errors.length > 0) {\n aggregatedErrors?.addMessages(errors);\n return fail(errors.join('\\n'));\n }\n return succeed(elements);\n}\n\n/**\n * Aggregates successful results from a a collection of {@link Result | Result<T>}.\n * @param results - An `Iterable` of {@link Result | Result<T>} from which success\n * results are to be aggregated.\n * @param aggregatedErrors - Optional string array to which any returned error messages will be\n * appended. Each error is appended as an individual string.\n * @returns {@link Success} with an array of `<T>` if any results were successful. If\n * all {@link Result | results} failed, returns {@link Failure} with a concatenated\n * summary of all error messages.\n * @public\n */\nexport function mapSuccess<T>(\n results: Iterable<Result<T>>,\n aggregatedErrors?: IMessageAggregator\n): Result<T[]> {\n const errors: string[] = [];\n const elements: T[] = [];\n\n for (const result of results) {\n if (result.isSuccess()) {\n elements.push(result.value);\n } else {\n errors.push(result.message);\n }\n }\n\n if (elements.length === 0 && errors.length > 0) {\n aggregatedErrors?.addMessages(errors);\n return fail(errors.join('\\n'));\n }\n return succeed(elements);\n}\n\n/**\n * Aggregates error messages from a collection of {@link Result | Result<T>}.\n * @param results - An iterable collection of {@link Result | Result<T>} for which\n * error messages are aggregated.\n * @param aggregatedErrors - Optional string array to which any returned error messages will be\n * appended. Each error is appended as an individual string.\n * @returns An array of strings consisting of all error messages returned by\n * {@link Result | results} in the source collection. Ignores {@link Success}\n * results and returns an empty array if there were no errors.\n * @public\n */\nexport function mapFailures<T>(\n results: Iterable<Result<T>>,\n aggregatedErrors?: IMessageAggregator\n): string[] {\n const errors: string[] = [];\n for (const result of results) {\n if (result.isFailure()) {\n errors.push(result.message);\n aggregatedErrors?.addMessage(result.message);\n }\n }\n return errors;\n}\n\n/**\n * Determines if an iterable collection of {@link Result | Result<T>} were all successful.\n * @param results - The collection of {@link Result | Result<T>} to be tested.\n * @param successValue - The value to be returned if results are successful.\n * @param aggregatedErrors - Optional string array to which any returned error messages will be\n * appended. Each error is appended as an individual string.\n * @returns Returns {@link Success} with `successValue` if all {@link Result | results} are successful.\n * If any are unsuccessful, returns {@link Failure} with a concatenated summary of the error\n * messages from all failed elements.\n * @public\n */\nexport function allSucceed<T>(\n results: Iterable<Result<unknown>>,\n successValue: T,\n aggregatedErrors?: IMessageAggregator\n): Result<T> {\n const errors: string[] = [];\n\n if (results !== undefined) {\n for (const result of results) {\n if (result.isFailure()) {\n errors.push(result.message);\n }\n }\n }\n\n if (errors.length > 0) {\n aggregatedErrors?.addMessages(errors);\n return fail(errors.join('\\n'));\n }\n return succeed(successValue);\n}\n\n/**\n * Returns the first successful result from a collection of {@link Result | Result<T>} or {@link DeferredResult | DeferredResult<T>}.\n * @param results - The collection of {@link Result | Result<T>} or {@link DeferredResult | DeferredResult<T>} to be tested.\n * @returns The first successful result, or {@link Failure} with a concatenated summary of all error messages.\n * @public\n */\nexport function firstSuccess<T>(results: Iterable<Result<T> | DeferredResult<T>>): Result<T> {\n const errors: MessageAggregator = new MessageAggregator();\n for (const r of results) {\n const result = isDeferredResult(r) ? r() : r;\n if (result.isSuccess()) {\n return result;\n }\n errors.addMessage(result.message);\n }\n return errors.returnOrReport(fail('no results found'));\n}\n\n/**\n * String-keyed record of initialization functions to be passed to {@link populateObject}\n * or {@link populateObject}.\n * @public\n */\nexport type FieldInitializers<T> = { [key in keyof T]: (state: Partial<T>) => Result<T[key]> };\n\n/**\n * Options for the {@link populateObject} function.\n * @public\n */\n\nexport interface PopulateObjectOptions<T> {\n /**\n * If present, specifies the order in which property values should\n * be evaluated. Any keys not listed are evaluated after all listed\n * keys in indeterminate order. If 'order' is not present, keys\n * are evaluated in indeterminate order.\n */\n order?: (keyof T)[];\n\n /**\n * Specify handling of `undefined` values. By default, successful\n * `undefined` results are written to the result object. If this value\n * is `true` then `undefined` results are suppressed for all properties.\n * If this value is an array of property keys then `undefined` results\n * are suppressed for those properties only.\n */\n suppressUndefined?: boolean | (keyof T)[];\n}\n\n/**\n * Populates an an object based on a prototype full of field initializers that return {@link Result | Result<T[key]>}.\n * Returns {@link Success} with the populated object if all initializers succeed, or {@link Failure} with a\n * concatenated list of all error messages.\n * @param initializers - An object with the shape of the target but with initializer functions for\n * each property.\n * @param options - An optional {@link PopulateObjectOptions | set of options} which\n * modify the behavior of this call.\n * @param aggregatedErrors - Optional string array to which any returned error messages will be\n * appended. Each error is appended as an individual string.\n * {@label WITH_OPTIONS}\n * @public\n */\nexport function populateObject<T>(\n initializers: FieldInitializers<T>,\n options?: PopulateObjectOptions<T>,\n aggregatedErrors?: IMessageAggregator\n): Result<T>;\n\n/**\n * Populates an an object based on a prototype full of field initializers that return {@link Result | Result<T[key]>}.\n * Returns {@link Success} with the populated object if all initializers succeed, or {@link Failure} with a\n * concatenated list of all error messages.\n * @param initializers - An object with the shape of the target but with initializer functions for\n * each property.\n * @param order - Optional order in which keys should be written.\n * @param aggregatedErrors - Optional string array to which any returned error messages will be\n * appended. Each error is appended as an individual string.\n * @public\n * {@label WITH_ORDER}\n * @deprecated Pass {@link PopulateObjectOptions} instead.\n */\nexport function populateObject<T>(\n initializers: FieldInitializers<T>,\n order: (keyof T)[] | undefined,\n aggregatedErrors?: IMessageAggregator\n): Result<T>;\n\nexport function populateObject<T>(\n initializers: FieldInitializers<T>,\n optionsOrOrder?: PopulateObjectOptions<T> | (keyof T)[],\n aggregatedErrors?: IMessageAggregator\n): Result<T> {\n const options: PopulateObjectOptions<T> = optionsOrOrder\n ? Array.isArray(optionsOrOrder)\n ? { order: optionsOrOrder }\n : optionsOrOrder\n : {};\n const state = {} as { [key in keyof T]: T[key] };\n const errors: string[] = [];\n const keys: (keyof T)[] = Array.from(options.order ?? []);\n const foundKeys = new Set<keyof T>(options.order);\n\n // start with the supplied order then append anything else we find\n for (const key in initializers) {\n if (!foundKeys.has(key)) {\n keys.push(key);\n foundKeys.add(key);\n }\n }\n\n for (const key of keys) {\n if (initializers[key]) {\n const result = initializers[key](state);\n if (result.isSuccess()) {\n if (result.value === undefined) {\n if (\n options.suppressUndefined === true ||\n (Array.isArray(options.suppressUndefined) && options.suppressUndefined.includes(key))\n ) {\n continue;\n }\n }\n state[key] = result.value;\n } else {\n errors.push(result.message);\n }\n } else {\n errors.push(`populateObject: Key ${String(key)} is present but has no initializer`);\n }\n }\n\n if (errors.length > 0) {\n aggregatedErrors?.addMessages(errors);\n return fail(errors.join('\\n'));\n }\n return succeed(state as T);\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messageAggregator.d.ts","sourceRoot":"","sources":["../../../src/packlets/base/messageAggregator.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAQ,MAAM,UAAU,CAAC;AAE5D;;;;GAIG;AACH,qBAAa,iBAAkB,YAAW,kBAAkB;IAC1D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAW;IAErC;;;;;OAKG;gBACgB,MAAM,CAAC,EAAE,MAAM,EAAE;IAIpC;;OAEG;IACH,IAAW,WAAW,IAAI,OAAO,CAEhC;IAED;;OAEG;IACH,IAAW,WAAW,IAAI,MAAM,CAE/B;IAED;;OAEG;IACH,IAAW,QAAQ,IAAI,MAAM,EAAE,CAE9B;IAED;;OAEG;IACI,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAOpD;;OAEG;IACI,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,IAAI;IAOxD;;OAEG;IACI,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM;IAI3C;;;;;;;;;;;;;;;;;OAiBG;IACI,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC;CAW3E"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messageAggregator.js","sourceRoot":"","sources":["../../../src/packlets/base/messageAggregator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,qCAA4D;AAE5D;;;;GAIG;AACH,MAAa,iBAAiB;IAG5B;;;;;OAKG;IACH,YAAmB,MAAiB;QAClC,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACpD,CAAC;IAED;;OAEG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,UAAU,CAAC,OAA2B;QAC3C,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACI,WAAW,CAAC,QAA8B;QAC/C,IAAI,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;QACnC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACI,QAAQ,CAAC,SAAkB;QAChC,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,IAAI,CAAC,CAAC;IAChD,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACI,cAAc,CAAI,MAAiB,EAAE,SAAkB;QAC5D,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;gBACtD,OAAO,IAAA,aAAI,EAAC,CAAC,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,IAAI,CAAC,CAAC,CAAC;YAC3E,CAAC;QACH,CAAC;QACD,OAAO,IAAA,aAAI,EAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IACxC,CAAC;CACF;AA1FD,8CA0FC","sourcesContent":["/*\n * Copyright (c) 2024 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { IMessageAggregator, Result, fail } from './result';\n\n/**\n * A simple error aggregator to simplify collecting and reporting all errors in\n * a flow.\n * @public\n */\nexport class MessageAggregator implements IMessageAggregator {\n private readonly _messages: string[];\n\n /**\n * Constructs a new {@link MessageAggregator | ErrorAggregator} with an\n * optionally specified initial set of error messages.\n * @param errors - optional array of errors to be included\n * in the aggregation.\n */\n public constructor(errors?: string[]) {\n this._messages = errors ? Array.from(errors) : [];\n }\n\n /**\n * {@inheritDoc IMessageAggregator.hasMessages}\n */\n public get hasMessages(): boolean {\n return this._messages.length > 0;\n }\n\n /**\n * {@inheritDoc IMessageAggregator.numMessages}\n */\n public get numMessages(): number {\n return this._messages.length;\n }\n\n /**\n * {@inheritDoc IMessageAggregator.messages}\n */\n public get messages(): string[] {\n return this._messages;\n }\n\n /**\n * {@inheritDoc IMessageAggregator.addMessage}\n */\n public addMessage(message: string | undefined): this {\n if (message) {\n this._messages.push(message);\n }\n return this;\n }\n\n /**\n * {@inheritDoc IMessageAggregator.addMessages}\n */\n public addMessages(messages: string[] | undefined): this {\n if (messages && messages.length > 0) {\n this._messages.push(...messages);\n }\n return this;\n }\n\n /**\n * {@inheritDoc IMessageAggregator.toString}\n */\n public toString(separator?: string): string {\n return this._messages.join(separator ?? '\\n');\n }\n\n /**\n * If any error messages have been aggregated, returns\n * {@link Failure | Failure<T>} with the aggregated\n * messages concatenated using the optionally-supplied\n * separator, or newline. If the supplied {@link Result | Result<T>}\n * contains an error message that has not already been aggregated,\n * it will be included in the aggregated messages.\n *\n * If no error messages have been aggregated, returns\n * the supplied {@link Result | Result<T>}.\n * @param result - The {@link Result | Result<T>} to be returned\n * if no messages have been aggregated.\n * @param separator - Optional string separator used to construct\n * the error message.\n * @returns {@link Failure | Failure<T>} with an aggregated message\n * if any error messages were collected, the supplied\n * {@link Result | Result<T>} otherwise.\n */\n public returnOrReport<T>(result: Result<T>, separator?: string): Result<T> {\n if (!this.hasMessages) {\n return result;\n }\n if (!result.success) {\n if (!this._messages.find((s) => s === result.message)) {\n return fail([...this._messages, result.message].join(separator ?? '\\n'));\n }\n }\n return fail(this.toString(separator));\n }\n}\n"]}
@@ -19,6 +19,30 @@ export declare class Normalizer {
19
19
  * @returns A normalized version of the value
20
20
  */
21
21
  normalize<T>(from: T): Result<T>;
22
+ /**
23
+ * Produces a stable, byte-identical JSON string following RFC 8785
24
+ * (JSON Canonicalization Scheme) key-ordering rules.
25
+ *
26
+ * Builds the output string directly rather than constructing an intermediate
27
+ * JS object, so integer-string keys (`"10"`, `"2"`) retain lexicographic
28
+ * order instead of being reordered numerically by the JS engine during
29
+ * `JSON.stringify`.
30
+ *
31
+ * @param from - Any JSON-compatible value (string, number, boolean, null,
32
+ * plain object, or array). Fails for non-JSON types (Map, Set, Date,
33
+ * RegExp, function, symbol, bigint, undefined).
34
+ * @returns `Result<string>` — the canonical JSON string, or a failure if
35
+ * `from` contains non-serializable types.
36
+ * @public
37
+ */
38
+ canonicalize(from: unknown): Result<string>;
39
+ /**
40
+ * Recursively builds a byte-identical RFC 8785 JSON string.
41
+ * @throws For non-JSON-serializable types (non-finite numbers, Date, RegExp,
42
+ * Map, Set, class instances, function, symbol, bigint, undefined).
43
+ * Callers must wrap in captureResult.
44
+ */
45
+ protected _canonicalizeRfc8785(value: unknown): string;
22
46
  /**
23
47
  * Compares two property names from some object being normalized.
24
48
  * @param k1 - First key to be compared.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../src/packlets/base/normalize.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,MAAM,EAAgC,MAAM,UAAU,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAEnE;;;GAGG;AACH,qBAAa,UAAU;IACrB;;;;;OAKG;IACI,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;IA4BvC;;;;;;;;;;;;;;;OAeG;IACI,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;IAIlD;;;;;OAKG;IACH,SAAS,CAAC,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM;IA4BtD;;;;;;;OAOG;IACH,SAAS,CAAC,YAAY,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,GAAG,MAAM;IAaxD;;;;;;OAMG;IACI,gBAAgB,CAAC,CAAC,GAAG,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE;IAQ7E,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;IAI7D;;;;OAIG;IACI,gBAAgB,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;CAwB/C"}
@@ -65,6 +65,59 @@ class Normalizer {
65
65
  }
66
66
  return (0, result_1.fail)(`normalize: Unexpected type - cannot normalize '${typeof from}'`);
67
67
  }
68
+ /**
69
+ * Produces a stable, byte-identical JSON string following RFC 8785
70
+ * (JSON Canonicalization Scheme) key-ordering rules.
71
+ *
72
+ * Builds the output string directly rather than constructing an intermediate
73
+ * JS object, so integer-string keys (`"10"`, `"2"`) retain lexicographic
74
+ * order instead of being reordered numerically by the JS engine during
75
+ * `JSON.stringify`.
76
+ *
77
+ * @param from - Any JSON-compatible value (string, number, boolean, null,
78
+ * plain object, or array). Fails for non-JSON types (Map, Set, Date,
79
+ * RegExp, function, symbol, bigint, undefined).
80
+ * @returns `Result<string>` — the canonical JSON string, or a failure if
81
+ * `from` contains non-serializable types.
82
+ * @public
83
+ */
84
+ canonicalize(from) {
85
+ return (0, result_1.captureResult)(() => this._canonicalizeRfc8785(from));
86
+ }
87
+ /**
88
+ * Recursively builds a byte-identical RFC 8785 JSON string.
89
+ * @throws For non-JSON-serializable types (non-finite numbers, Date, RegExp,
90
+ * Map, Set, class instances, function, symbol, bigint, undefined).
91
+ * Callers must wrap in captureResult.
92
+ */
93
+ _canonicalizeRfc8785(value) {
94
+ if (value === null)
95
+ return 'null';
96
+ if (typeof value === 'boolean')
97
+ return value ? 'true' : 'false';
98
+ if (typeof value === 'number') {
99
+ if (!Number.isFinite(value)) {
100
+ throw new Error(`canonicalize: non-finite number (${value}) is not representable in JSON`);
101
+ }
102
+ return JSON.stringify(value);
103
+ }
104
+ if (typeof value === 'string')
105
+ return JSON.stringify(value);
106
+ if (Array.isArray(value)) {
107
+ return '[' + value.map((item) => this._canonicalizeRfc8785(item)).join(',') + ']';
108
+ }
109
+ if (typeof value === 'object') {
110
+ const proto = Object.getPrototypeOf(value);
111
+ if (proto !== Object.prototype && proto !== null) {
112
+ throw new Error(`canonicalize: cannot serialize non-plain object (${Object.prototype.toString.call(value)})`);
113
+ }
114
+ const obj = value;
115
+ const sortedKeys = Object.keys(obj).sort((k1, k2) => this._compareKeys(k1, k2));
116
+ const pairs = sortedKeys.map((k) => JSON.stringify(k) + ':' + this._canonicalizeRfc8785(obj[k]));
117
+ return '{' + pairs.join(',') + '}';
118
+ }
119
+ throw new Error(`canonicalize: cannot serialize value of type '${typeof value}'`);
120
+ }
68
121
  /**
69
122
  * Compares two property names from some object being normalized.
70
123
  * @param k1 - First key to be compared.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize.js","sourceRo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AI,EAAE,CAAC;YAClB,OAAO,IAAA,gBAAO,EAAC,IAAI,CAAC,CAAC;QACvB,CAAC;QACD,IAAI,IAAI,YAAY,IAAI,EAAE,CAAC;YACzB,OAAO,IAAA,gBAAO,EAAC,IAAI,CAAC,CAAC;QACvB,CAAC;QACD,IAAI,IAAI,YAAY,MAAM,EAAE,CAAC;YAC3B,OAAO,IAAA,gBAAO,EAAC,IAAI,CAAC,CAAC;QACvB,CAAC;QACD,sBAAsB;QACtB,OAAO,IAAA,aAAI,EAAC,oBAAoB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1D,CAAC;CACF;AA9JD,gCA8JC","sourcesContent":["/*\n * Copyright (c) 2021 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { mapResults } from './mapResults';\nimport { Result, captureResult, fail, succeed } from './result';\n\n/**\n * @internal\n */\nexport type Entry<T> = [string | number | symbol, T];\n\n/**\n * @internal\n */\nexport type ResultEntry<T> = [string | number | symbol, Result<T>];\n\n/**\n * Normalizes an arbitrary JSON object\n * @public\n */\nexport class Normalizer {\n /**\n * Normalizes the supplied value\n *\n * @param from - The value to be normalized\n * @returns A normalized version of the value\n */\n public normalize<T>(from: T): Result<T> {\n switch (typeof from) {\n case 'string':\n case 'bigint':\n case 'boolean':\n case 'number':\n case 'symbol':\n case 'undefined':\n return this.normalizeLiteral(from);\n case 'object':\n if (from === null || from instanceof Date || from instanceof RegExp) {\n return this.normalizeLiteral(from);\n } else if (Array.isArray(from)) {\n return this._normalizeArray(from) as unknown as Result<T>;\n } else if (from instanceof Map) {\n return succeed(new Map(this.normalizeEntries(from.entries())) as unknown as T);\n } else if (from instanceof Set) {\n return succeed(new Set(this.normalizeEntries(from.entries())) as unknown as T);\n }\n const obj: { [key in number | string | symbol]: unknown } = {};\n for (const e of this.normalizeEntries(Object.entries(from as unknown as object))) {\n obj[e[0]] = e[1];\n }\n return succeed(obj as T);\n }\n return fail(`normalize: Unexpected type - cannot normalize '${typeof from}'`);\n }\n\n /**\n * Produces a stable, byte-identical JSON string following RFC 8785\n * (JSON Canonicalization Scheme) key-ordering rules.\n *\n * Builds the output string directly rather than constructing an intermediate\n * JS object, so integer-string keys (`\"10\"`, `\"2\"`) retain lexicographic\n * order instead of being reordered numerically by the JS engine during\n * `JSON.stringify`.\n *\n * @param from - Any JSON-compatible value (string, number, boolean, null,\n * plain object, or array). Fails for non-JSON types (Map, Set, Date,\n * RegExp, function, symbol, bigint, undefined).\n * @returns `Result<string>` — the canonical JSON string, or a failure if\n * `from` contains non-serializable types.\n * @public\n */\n public canonicalize(from: unknown): Result<string> {\n return captureResult(() => this._canonicalizeRfc8785(from));\n }\n\n /**\n * Recursively builds a byte-identical RFC 8785 JSON string.\n * @throws For non-JSON-serializable types (non-finite numbers, Date, RegExp,\n * Map, Set, class instances, function, symbol, bigint, undefined).\n * Callers must wrap in captureResult.\n */\n protected _canonicalizeRfc8785(value: unknown): string {\n if (value === null) return 'null';\n if (typeof value === 'boolean') return value ? 'true' : 'false';\n if (typeof value === 'number') {\n if (!Number.isFinite(value)) {\n throw new Error(`canonicalize: non-finite number (${value}) is not representable in JSON`);\n }\n return JSON.stringify(value);\n }\n if (typeof value === 'string') return JSON.stringify(value);\n if (Array.isArray(value)) {\n return '[' + value.map((item) => this._canonicalizeRfc8785(item)).join(',') + ']';\n }\n if (typeof value === 'object') {\n const proto = Object.getPrototypeOf(value as object) as unknown;\n if (proto !== Object.prototype && proto !== null) {\n throw new Error(\n `canonicalize: cannot serialize non-plain object (${Object.prototype.toString.call(value)})`\n );\n }\n const obj = value as Record<string, unknown>;\n const sortedKeys = Object.keys(obj).sort((k1, k2) => this._compareKeys(k1, k2));\n const pairs = sortedKeys.map((k) => JSON.stringify(k) + ':' + this._canonicalizeRfc8785(obj[k]));\n return '{' + pairs.join(',') + '}';\n }\n throw new Error(`canonicalize: cannot serialize value of type '${typeof value}'`);\n }\n\n /**\n * Compares two property names from some object being normalized.\n * @param k1 - First key to be compared.\n * @param k2 - Second key to be compared.\n * @returns `1` if `k1` is greater, `-1` if `k2` is greater and\n * `0` if they are equal.\n * @internal\n */\n protected _compareKeys(k1: unknown, k2: unknown): number {\n const cs1 = String(k1);\n const cs2 = String(k2);\n if (cs1 > cs2) {\n return 1;\n }\n if (cs2 > cs1) {\n return -1;\n }\n /* c8 ignore next 2 */\n return 0;\n }\n\n /**\n * Normalizes an array of object property entries (e.g. as returned by `Object.entries()`).\n * @remarks\n * Converts property names (entry key) to string and then sorts as string.\n * @param entries - The entries to be normalized.\n * @returns A normalized sorted array of entries.\n */\n public normalizeEntries<T = unknown>(entries: Iterable<Entry<T>>): Entry<T>[] {\n return Array.from(entries)\n .sort((e1, e2) => this._compareKeys(e1[0], e2[0]))\n .map((e) => [e[0], this.normalize(e[1])] as ResultEntry<T>)\n .filter((e) => e[1].isSuccess())\n .map((e) => [e[0], e[1].orThrow()]);\n }\n\n protected _normalizeArray(from: unknown[]): Result<unknown[]> {\n return mapResults(from.map((v) => this.normalize(v)));\n }\n\n /**\n * Normalizes the supplied literal value\n * @param from - The literal value to be normalized.\n * @returns A normalized value for the literal.\n */\n public normalizeLiteral<T>(from: T): Result<T> {\n // TODO: Apply configurable normalization rules\n switch (typeof from) {\n case 'string':\n return succeed(from);\n case 'bigint':\n case 'boolean':\n case 'number':\n case 'symbol':\n case 'undefined':\n return succeed(from);\n }\n if (from === null) {\n return succeed(from);\n }\n if (from instanceof Date) {\n return succeed(from);\n }\n if (from instanceof RegExp) {\n return succeed(from);\n }\n /* c8 ignore next 2 */\n return fail(`cannot normalize ${JSON.stringify(from)}`);\n }\n}\n"]}
@@ -224,6 +224,47 @@ export interface IResult<T> {
224
224
  * {@label formatter}
225
225
  */
226
226
  orThrow(cb: ErrorFormatter): T;
227
+ /**
228
+ * Asserts at the call site that this {@link IResult | result} MUST be a success.
229
+ * Returns the value on success; on failure, throws an `Error` whose message
230
+ * is composed from the original failure message and the captured call-site
231
+ * location (file, line, and where useful function name).
232
+ *
233
+ * @remarks
234
+ * Use for declaration-time / setup-time invariants — module-level `const`
235
+ * initializers, static class properties, static initialization blocks, and
236
+ * test fixtures — where a failure indicates a coding bug that should
237
+ * surface at the call site rather than propagate as a `Result`. For chains
238
+ * where the throw is intentional control flow, prefer `orThrow`.
239
+ *
240
+ * On V8 (Node + Chromium) `Error.captureStackTrace` is used to elide
241
+ * `shouldNotFail` itself from the captured stack so the parsed frame is
242
+ * the user's call site directly. On WebKit (where `captureStackTrace` is
243
+ * unavailable) the stack is parsed manually and frames whose **parsed
244
+ * function name** contains `shouldNotFail` are filtered out — the raw
245
+ * stack-line text (including the file path) is deliberately NOT inspected,
246
+ * so consumer files named after `shouldNotFail` are not collateral damage.
247
+ * Function names and exact line numbers depend on source-map availability
248
+ * in the runtime. When no caller frame is recoverable (e.g. `frameDepth`
249
+ * out of range, or `frameDepth: 0`) the message falls back to the
250
+ * label-only form (or the bare original message when no label is given).
251
+ *
252
+ * Error message format (depending on whether a label and a usable function
253
+ * name are available):
254
+ * - both: `<label> (at <fn> in <file>:<line>): <original>`
255
+ * - label only: `<label> (at <file>:<line>): <original>`
256
+ * - fn only: `<fn> at <file>:<line>: <original>`
257
+ * - neither: `<file>:<line>: <original>`
258
+ *
259
+ * @param label - Optional human-meaningful identifier (e.g. the constant
260
+ * name) prefixed to the error message.
261
+ * @param frameDepth - Optional 1-indexed depth into the caller stack.
262
+ * Default `1` (immediate caller). Library authors wrapping `shouldNotFail`
263
+ * inside their own helper pass `2` to attribute to their caller.
264
+ * @returns The result value, if the operation was successful.
265
+ * @throws `Error` if the result was a failure.
266
+ */
267
+ shouldNotFail(label?: string, frameDepth?: number): T;
227
268
  /**
228
269
  * Gets the value associated with a successful {@link IResult | result},
229
270
  * or a default value if the corresponding operation failed.
@@ -266,6 +307,30 @@ export interface IResult<T> {
266
307
  * was successful, propagates the result value from the successful event.
267
308
  */
268
309
  onFailure(cb: FailureContinuation<T>): Result<T>;
310
+ /**
311
+ * Calls a supplied {@link AsyncSuccessContinuation | async success continuation} if
312
+ * the operation was a success, bridging into an {@link AsyncResult} chain.
313
+ * @remarks
314
+ * If the async callback rejects, the rejection is caught and converted
315
+ * to a {@link Failure}.
316
+ * @param cb - The {@link AsyncSuccessContinuation | async success continuation} to
317
+ * be called in the event of success.
318
+ * @returns An {@link AsyncResult} wrapping the async continuation result, or
319
+ * propagating the error message from this failure.
320
+ */
321
+ thenOnSuccess<TN>(cb: AsyncSuccessContinuation<T, TN>): AsyncResult<TN>;
322
+ /**
323
+ * Calls a supplied {@link AsyncFailureContinuation | async failure continuation} if
324
+ * the operation failed, bridging into an {@link AsyncResult} chain.
325
+ * @remarks
326
+ * If the async callback rejects, the rejection is caught and converted
327
+ * to a {@link Failure}.
328
+ * @param cb - The {@link AsyncFailureContinuation | async failure continuation} to
329
+ * be called in the event of failure.
330
+ * @returns An {@link AsyncResult} wrapping the async continuation result, or
331
+ * propagating the success value from this result.
332
+ */
333
+ thenOnFailure(cb: AsyncFailureContinuation<T>): AsyncResult<T>;
269
334
  /**
270
335
  * Calls a supplied {@link ErrorFormatter | error formatter} if
271
336
  * the operation failed.
@@ -354,6 +419,10 @@ export declare class Success<out T> implements IResult<T> {
354
419
  * {@inheritDoc IResult.orThrow}
355
420
  */
356
421
  orThrow(cb: ErrorFormatter): T;
422
+ /**
423
+ * {@inheritDoc IResult.shouldNotFail}
424
+ */
425
+ shouldNotFail(__label?: string, __frameDepth?: number): T;
357
426
  /**
358
427
  * {@inheritDoc IResult.orDefault}
359
428
  */
@@ -380,6 +449,14 @@ export declare class Success<out T> implements IResult<T> {
380
449
  * {@inheritDoc IResult.onFailure}
381
450
  */
382
451
  onFailure(__: FailureContinuation<T>): Result<T>;
452
+ /**
453
+ * {@inheritDoc IResult.thenOnSuccess}
454
+ */
455
+ thenOnSuccess<TN>(cb: AsyncSuccessContinuation<T, TN>): AsyncResult<TN>;
456
+ /**
457
+ * {@inheritDoc IResult.thenOnFailure}
458
+ */
459
+ thenOnFailure(__: AsyncFailureContinuation<T>): AsyncResult<T>;
383
460
  /**
384
461
  * {@inheritDoc IResult.withErrorFormat}
385
462
  */
@@ -450,6 +527,10 @@ export declare class Failure<out T> implements IResult<T> {
450
527
  * {@inheritDoc IResult.orThrow}
451
528
  */
452
529
  orThrow(cb: ErrorFormatter): never;
530
+ /**
531
+ * {@inheritDoc IResult.shouldNotFail}
532
+ */
533
+ shouldNotFail(label?: string, frameDepth?: number): never;
453
534
  /**
454
535
  * {@inheritDoc IResult.orDefault}
455
536
  */
@@ -476,6 +557,14 @@ export declare class Failure<out T> implements IResult<T> {
476
557
  * {@inheritDoc IResult.onFailure}
477
558
  */
478
559
  onFailure(cb: FailureContinuation<T>): Result<T>;
560
+ /**
561
+ * {@inheritDoc IResult.thenOnSuccess}
562
+ */
563
+ thenOnSuccess<TN>(__: AsyncSuccessContinuation<T, TN>): AsyncResult<TN>;
564
+ /**
565
+ * {@inheritDoc IResult.thenOnFailure}
566
+ */
567
+ thenOnFailure(cb: AsyncFailureContinuation<T>): AsyncResult<T>;
479
568
  /**
480
569
  * {@inheritDoc IResult.withErrorFormat}
481
570
  */
@@ -496,6 +585,41 @@ export declare class Failure<out T> implements IResult<T> {
496
585
  * {@inheritDoc IResult.report}
497
586
  */
498
587
  report(reporter?: IResultReporter<T>, options?: IResultReportOptions<unknown>): Failure<T>;
588
+ /**
589
+ * Re-types this {@link Failure | Failure<T>} as {@link Failure | Failure<U>} for
590
+ * propagation under a different success type.
591
+ * @remarks
592
+ * Supports the canonical Result early-return-after-`isFailure()` pattern when the
593
+ * outer function's success type differs from the inner Result's success type:
594
+ *
595
+ * ```ts
596
+ * const storeResult = await PromptStoreFixture.build(seed);
597
+ * if (storeResult.isFailure()) {
598
+ * return storeResult.withType<PromptLibrary>();
599
+ * }
600
+ * return PromptLibrary.create({ store: storeResult.value, ... });
601
+ * ```
602
+ *
603
+ * Without this helper, TypeScript rejects `return storeResult` because
604
+ * `Failure<IPromptStore>` is invariant in `T` and not assignable to
605
+ * `Result<PromptLibrary>`. The workaround `return fail<U>(r.message)` is
606
+ * semantically equivalent but allocates a new {@link Failure} instance;
607
+ * `withType` returns `this` and only retypes statically.
608
+ *
609
+ * This method is sound because a {@link Failure} variant carries no `T`-shaped
610
+ * data — only an error message — so re-typing it as `Failure<U>` cannot
611
+ * misrepresent any value. The same operation is NOT exposed on {@link Success}
612
+ * because `Success<T>` carries `T`-shaped data and re-typing would be a lie.
613
+ *
614
+ * For `DetailedResult` propagation that preserves a typed `detail`, consider
615
+ * propagating the {@link DetailedFailure} directly through `onSuccess` (which
616
+ * already re-types the success arm) rather than reaching for `withType`.
617
+ *
618
+ * @returns This same {@link Failure} instance, statically retyped as
619
+ * {@link Failure | Failure<U>}.
620
+ * @public
621
+ */
622
+ withType<U>(): Failure<U>;
499
623
  /**
500
624
  * Get a 'friendly' string representation of this object.
501
625
  * @remarks
@@ -772,14 +896,152 @@ export declare function failsWithDetail<T, TD>(message: string, detail?: TD): De
772
896
  * @public
773
897
  */
774
898
  export declare function propagateWithDetail<T, TD>(result: Result<T>, detail: TD, successDetail?: TD): DetailedResult<T, TD>;
899
+ /**
900
+ * Extracts a message string from an unknown thrown/rejected value.
901
+ * @param err - The caught error value.
902
+ * @returns The error message string.
903
+ * @internal
904
+ */
905
+ export declare function _errorMessage(err: unknown): string;
775
906
  /**
776
907
  * Wraps a function which might throw to convert exception results
777
908
  * to {@link Failure}.
778
909
  * @param func - The function to be captured.
779
910
  * @returns Returns {@link Success} with a value of type `<T>` on
780
911
  * success , or {@link Failure} with the thrown error message if
781
- * `func` throws an `Error`.
912
+ * `func` throws an `Error` or string.
782
913
  * @public
783
914
  */
784
915
  export declare function captureResult<T>(func: () => T): Result<T>;
916
+ /**
917
+ * Async continuation callback to be called in the event that a
918
+ * {@link Result} is successful, returning a `Promise` of a new {@link Result}.
919
+ * @public
920
+ */
921
+ export type AsyncSuccessContinuation<T, TN> = (value: T) => Promise<Result<TN>>;
922
+ /**
923
+ * Async continuation callback to be called in the event that a
924
+ * {@link Result} fails, returning a `Promise` of a new {@link Result}.
925
+ * @public
926
+ */
927
+ export type AsyncFailureContinuation<T> = (message: string) => Promise<Result<T>>;
928
+ /**
929
+ * Wraps a `Promise` of a {@link Result} to enable fluent chaining of both
930
+ * synchronous and asynchronous operations.
931
+ *
932
+ * @remarks
933
+ * `AsyncResult<T>` implements `PromiseLike` so it can be directly `await`ed.
934
+ * Use the `thenOnSuccess` and `thenOnFailure` methods on {@link Result} to bridge
935
+ * from synchronous to asynchronous result chains.
936
+ *
937
+ * @example
938
+ * ```typescript
939
+ * const result: Result<Final> = await parseInput(input)
940
+ * .thenOnSuccess(async (parsed) => fetchData(parsed))
941
+ * .onSuccess((data) => transform(data))
942
+ * .thenOnSuccess(async (transformed) => saveData(transformed))
943
+ * .withErrorFormat((msg) => `pipeline failed: ${msg}`);
944
+ * ```
945
+ *
946
+ * @public
947
+ */
948
+ export declare class AsyncResult<T> implements PromiseLike<Result<T>> {
949
+ private readonly _promise;
950
+ /**
951
+ * Constructs an {@link AsyncResult} wrapping the supplied promise.
952
+ * @remarks
953
+ * If the supplied promise rejects, the rejection is caught and converted
954
+ * to a {@link Failure}, ensuring that awaiting an {@link AsyncResult} always
955
+ * yields a {@link Result}.
956
+ * @param promise - A `Promise` that resolves to a {@link Result}.
957
+ */
958
+ constructor(promise: Promise<Result<T>>);
959
+ /**
960
+ * Calls a supplied {@link SuccessContinuation | success continuation} if
961
+ * the wrapped result is successful.
962
+ * @param cb - The synchronous {@link SuccessContinuation | success continuation}
963
+ * to be called in the event of success.
964
+ * @returns A new {@link AsyncResult} wrapping the continuation result.
965
+ */
966
+ onSuccess<TN>(cb: SuccessContinuation<T, TN>): AsyncResult<TN>;
967
+ /**
968
+ * Calls a supplied {@link AsyncSuccessContinuation | async success continuation} if
969
+ * the wrapped result is successful.
970
+ * @remarks
971
+ * Both synchronous throws and async rejections from the callback are caught
972
+ * and converted to a {@link Failure}.
973
+ * @param cb - The {@link AsyncSuccessContinuation | async success continuation}
974
+ * to be called in the event of success.
975
+ * @returns A new {@link AsyncResult} wrapping the async continuation result.
976
+ */
977
+ thenOnSuccess<TN>(cb: AsyncSuccessContinuation<T, TN>): AsyncResult<TN>;
978
+ /**
979
+ * Calls a supplied {@link FailureContinuation | failure continuation} if
980
+ * the wrapped result is a failure.
981
+ * @param cb - The synchronous {@link FailureContinuation | failure continuation}
982
+ * to be called in the event of failure.
983
+ * @returns A new {@link AsyncResult} wrapping the continuation result.
984
+ */
985
+ onFailure(cb: FailureContinuation<T>): AsyncResult<T>;
986
+ /**
987
+ * Calls a supplied {@link AsyncFailureContinuation | async failure continuation} if
988
+ * the wrapped result is a failure.
989
+ * @remarks
990
+ * Both synchronous throws and async rejections from the callback are caught
991
+ * and converted to a {@link Failure}.
992
+ * @param cb - The {@link AsyncFailureContinuation | async failure continuation}
993
+ * to be called in the event of failure.
994
+ * @returns A new {@link AsyncResult} wrapping the async continuation result.
995
+ */
996
+ thenOnFailure(cb: AsyncFailureContinuation<T>): AsyncResult<T>;
997
+ /**
998
+ * Calls a supplied {@link ErrorFormatter | error formatter} if
999
+ * the wrapped result is a failure.
1000
+ * @param cb - The {@link ErrorFormatter | error formatter} to
1001
+ * be called in the event of failure.
1002
+ * @returns A new {@link AsyncResult} with the formatted error message,
1003
+ * or the original success result.
1004
+ */
1005
+ withErrorFormat(cb: ErrorFormatter): AsyncResult<T>;
1006
+ /**
1007
+ * Propagates the wrapped result, appending any error message to the
1008
+ * supplied errors aggregator.
1009
+ * @param errors - {@link IMessageAggregator | Error aggregator} in which
1010
+ * errors will be aggregated.
1011
+ * @param formatter - An optional {@link ErrorFormatter | error formatter}
1012
+ * to be used to format the error message.
1013
+ * @returns A new {@link AsyncResult} wrapping the result after aggregation.
1014
+ */
1015
+ aggregateError(errors: IMessageAggregator, formatter?: ErrorFormatter): AsyncResult<T>;
1016
+ /**
1017
+ * Reports the wrapped result to the supplied reporter.
1018
+ * @param reporter - The {@link IResultReporter | reporter} to which the result
1019
+ * will be reported.
1020
+ * @param options - The {@link IResultReportOptions | options} for reporting the result.
1021
+ * @returns A new {@link AsyncResult} wrapping the result after reporting.
1022
+ */
1023
+ report(reporter?: IResultReporter<T>, options?: IResultReportOptions<unknown>): AsyncResult<T>;
1024
+ /**
1025
+ * Implementation of `PromiseLike.then` enabling `await` on {@link AsyncResult}.
1026
+ * @param onfulfilled - Callback invoked when the promise resolves.
1027
+ * @param onrejected - Callback invoked when the promise rejects.
1028
+ * @returns A `Promise` resolving to the callback result.
1029
+ */
1030
+ then<TResult1 = Result<T>, TResult2 = never>(onfulfilled?: ((value: Result<T>) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
1031
+ /**
1032
+ * Creates an {@link AsyncResult} from a {@link Result}.
1033
+ * @param result - The {@link Result} to wrap.
1034
+ * @returns A new {@link AsyncResult} wrapping the supplied result.
1035
+ */
1036
+ static from<T>(result: Result<T>): AsyncResult<T>;
1037
+ }
1038
+ /**
1039
+ * Wraps an async function which might throw to convert exception results
1040
+ * to {@link Failure}.
1041
+ * @param func - The async function to be captured.
1042
+ * @returns Returns a `Promise` of {@link Success} with a value of type `<T>` on
1043
+ * success, or {@link Failure} with the thrown error message if `func` throws or rejects.
1044
+ * @public
1045
+ */
1046
+ export declare function captureAsyncResult<T>(func: () => Promise<T>): Promise<Result<T>>;
785
1047
  //# sourceMappingURL=result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../../src/packlets/base/result.ts"],"names":[],"mappings":"AAwBA;;;;;;GAMG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,MAAM,MAAM,CAAC,CAAC,CAAC,CAAC;AAEhD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC,CAEtG;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,CAAC,EAAE,CAAC,CAAC;AAElE;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC;AAEpE;;;GAGG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC;AAEzE;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,MAAM,EAAE,C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