@ariestools/sdk 7.0.3

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 (409) hide show
  1. package/LICENSE +165 -0
  2. package/README.md +45 -0
  3. package/dist/_pkg/api/neutral/ApiClient.d.ts +10 -0
  4. package/dist/_pkg/api/neutral/ApiConfig.d.ts +9 -0
  5. package/dist/_pkg/api/neutral/ApiEndpoint.d.ts +19 -0
  6. package/dist/_pkg/api/neutral/ApiStage.d.ts +11 -0
  7. package/dist/_pkg/api/neutral/getApiStage.d.ts +8 -0
  8. package/dist/_pkg/api/neutral/index.d.ts +6 -0
  9. package/dist/_pkg/api/neutral/index.mjs +78 -0
  10. package/dist/_pkg/api/neutral/model.d.ts +3 -0
  11. package/dist/_pkg/api/neutral/model.mjs +1 -0
  12. package/dist/_pkg/array/neutral/containsAll.d.ts +8 -0
  13. package/dist/_pkg/array/neutral/distinct.d.ts +6 -0
  14. package/dist/_pkg/array/neutral/filterAs.d.ts +8 -0
  15. package/dist/_pkg/array/neutral/filterAsync.d.ts +9 -0
  16. package/dist/_pkg/array/neutral/findAs.d.ts +15 -0
  17. package/dist/_pkg/array/neutral/flatten.d.ts +8 -0
  18. package/dist/_pkg/array/neutral/index.d.ts +8 -0
  19. package/dist/_pkg/array/neutral/index.mjs +80 -0
  20. package/dist/_pkg/array/neutral/uniq.d.ts +14 -0
  21. package/dist/_pkg/arraybuffer/neutral/equalArrayBuffers.d.ts +8 -0
  22. package/dist/_pkg/arraybuffer/neutral/index.d.ts +5 -0
  23. package/dist/_pkg/arraybuffer/neutral/index.mjs +74 -0
  24. package/dist/_pkg/arraybuffer/neutral/isArrayBuffer.d.ts +7 -0
  25. package/dist/_pkg/arraybuffer/neutral/toArrayBuffer.d.ts +11 -0
  26. package/dist/_pkg/arraybuffer/neutral/toUint8Array.d.ts +11 -0
  27. package/dist/_pkg/assert/neutral/assertDefinedEx.d.ts +41 -0
  28. package/dist/_pkg/assert/neutral/assertEx.d.ts +41 -0
  29. package/dist/_pkg/assert/neutral/index.d.ts +4 -0
  30. package/dist/_pkg/assert/neutral/index.mjs +30 -0
  31. package/dist/_pkg/assert/neutral/model.d.ts +2 -0
  32. package/dist/_pkg/assert/neutral/model.mjs +1 -0
  33. package/dist/_pkg/assert/neutral/types.d.ts +36 -0
  34. package/dist/_pkg/base/neutral/Base.d.ts +53 -0
  35. package/dist/_pkg/base/neutral/UniqueBase.d.ts +10 -0
  36. package/dist/_pkg/base/neutral/globallyUnique.d.ts +21 -0
  37. package/dist/_pkg/base/neutral/index.d.ts +4 -0
  38. package/dist/_pkg/base/neutral/index.mjs +164 -0
  39. package/dist/_pkg/base/neutral/model.d.ts +2 -0
  40. package/dist/_pkg/base/neutral/model.mjs +1 -0
  41. package/dist/_pkg/creatable/neutral/AbstractCreatable.d.ts +123 -0
  42. package/dist/_pkg/creatable/neutral/Creatable.d.ts +49 -0
  43. package/dist/_pkg/creatable/neutral/Factory.d.ts +28 -0
  44. package/dist/_pkg/creatable/neutral/index.d.ts +5 -0
  45. package/dist/_pkg/creatable/neutral/index.mjs +396 -0
  46. package/dist/_pkg/creatable/neutral/lib/getFunctionName.d.ts +7 -0
  47. package/dist/_pkg/creatable/neutral/lib/getRootFunction.d.ts +8 -0
  48. package/dist/_pkg/creatable/neutral/lib/index.d.ts +3 -0
  49. package/dist/_pkg/creatable/neutral/model/CreatableInstance.d.ts +16 -0
  50. package/dist/_pkg/creatable/neutral/model/CreatableParams.d.ts +16 -0
  51. package/dist/_pkg/creatable/neutral/model/CreatableStatusReporter.d.ts +15 -0
  52. package/dist/_pkg/creatable/neutral/model/Labels.d.ts +24 -0
  53. package/dist/_pkg/creatable/neutral/model/index.d.ts +5 -0
  54. package/dist/_pkg/creatable/neutral/model.d.ts +3 -0
  55. package/dist/_pkg/creatable/neutral/model.mjs +1 -0
  56. package/dist/_pkg/decimal-precision/neutral/fromFixedPoint.d.ts +8 -0
  57. package/dist/_pkg/decimal-precision/neutral/index.d.ts +4 -0
  58. package/dist/_pkg/decimal-precision/neutral/index.mjs +39 -0
  59. package/dist/_pkg/decimal-precision/neutral/toDecimalPrecision.d.ts +8 -0
  60. package/dist/_pkg/decimal-precision/neutral/toFixedPoint.d.ts +8 -0
  61. package/dist/_pkg/delay/neutral/delay.d.ts +7 -0
  62. package/dist/_pkg/delay/neutral/index.d.ts +2 -0
  63. package/dist/_pkg/delay/neutral/index.mjs +9 -0
  64. package/dist/_pkg/ellipsize/neutral/index.d.ts +8 -0
  65. package/dist/_pkg/ellipsize/neutral/index.mjs +10 -0
  66. package/dist/_pkg/enum/neutral/Enum.d.ts +88 -0
  67. package/dist/_pkg/enum/neutral/index.d.ts +2 -0
  68. package/dist/_pkg/enum/neutral/index.mjs +8 -0
  69. package/dist/_pkg/enum/neutral/model.d.ts +2 -0
  70. package/dist/_pkg/enum/neutral/model.mjs +1 -0
  71. package/dist/_pkg/error/neutral/assert.d.ts +12 -0
  72. package/dist/_pkg/error/neutral/handleError.d.ts +15 -0
  73. package/dist/_pkg/error/neutral/index.d.ts +3 -0
  74. package/dist/_pkg/error/neutral/index.mjs +32 -0
  75. package/dist/_pkg/error/neutral/model.d.ts +2 -0
  76. package/dist/_pkg/error/neutral/model.mjs +1 -0
  77. package/dist/_pkg/events/neutral/BaseEmitter.d.ts +74 -0
  78. package/dist/_pkg/events/neutral/Events/Events.d.ts +132 -0
  79. package/dist/_pkg/events/neutral/Events/index.d.ts +2 -0
  80. package/dist/_pkg/events/neutral/index.d.ts +4 -0
  81. package/dist/_pkg/events/neutral/index.mjs +415 -0
  82. package/dist/_pkg/events/neutral/model/Event.d.ts +21 -0
  83. package/dist/_pkg/events/neutral/model/EventEmitter.d.ts +25 -0
  84. package/dist/_pkg/events/neutral/model/index.d.ts +3 -0
  85. package/dist/_pkg/events/neutral/model.d.ts +3 -0
  86. package/dist/_pkg/events/neutral/model.mjs +1 -0
  87. package/dist/_pkg/exists/neutral/index.d.ts +10 -0
  88. package/dist/_pkg/exists/neutral/index.mjs +8 -0
  89. package/dist/_pkg/fetch/neutral/FetchClient.d.ts +46 -0
  90. package/dist/_pkg/fetch/neutral/FetchError.d.ts +80 -0
  91. package/dist/_pkg/fetch/neutral/FetchJsonClient.d.ts +19 -0
  92. package/dist/_pkg/fetch/neutral/fetchCompress.d.ts +12 -0
  93. package/dist/_pkg/fetch/neutral/fetchJson.d.ts +7 -0
  94. package/dist/_pkg/fetch/neutral/index.d.ts +11 -0
  95. package/dist/_pkg/fetch/neutral/index.mjs +365 -0
  96. package/dist/_pkg/fetch/neutral/methods.d.ts +12 -0
  97. package/dist/_pkg/fetch/neutral/model.d.ts +5 -0
  98. package/dist/_pkg/fetch/neutral/model.mjs +1 -0
  99. package/dist/_pkg/fetch/neutral/parseJson.d.ts +16 -0
  100. package/dist/_pkg/fetch/neutral/types.d.ts +12 -0
  101. package/dist/_pkg/forget/neutral/ForgetConfig.d.ts +21 -0
  102. package/dist/_pkg/forget/neutral/ForgetNodeConfig.d.ts +13 -0
  103. package/dist/_pkg/forget/neutral/ForgetPromise.d.ts +49 -0
  104. package/dist/_pkg/forget/neutral/ForgetPromiseNode.d.ts +15 -0
  105. package/dist/_pkg/forget/neutral/forget.d.ts +10 -0
  106. package/dist/_pkg/forget/neutral/forgetNode.d.ts +9 -0
  107. package/dist/_pkg/forget/neutral/index.d.ts +2 -0
  108. package/dist/_pkg/forget/neutral/index.mjs +162 -0
  109. package/dist/_pkg/forget/neutral/model.d.ts +3 -0
  110. package/dist/_pkg/forget/neutral/model.mjs +1 -0
  111. package/dist/_pkg/forget/neutral/neutral/index.d.ts +4 -0
  112. package/dist/_pkg/forget/neutral/node/index.d.ts +4 -0
  113. package/dist/_pkg/function-name/neutral/functionName.d.ts +7 -0
  114. package/dist/_pkg/function-name/neutral/index.d.ts +2 -0
  115. package/dist/_pkg/function-name/neutral/index.mjs +27 -0
  116. package/dist/_pkg/hex/neutral/HexRegEx.d.ts +19 -0
  117. package/dist/_pkg/hex/neutral/address/AddressTransformZod.d.ts +10 -0
  118. package/dist/_pkg/hex/neutral/address/AddressValidationZod.d.ts +10 -0
  119. package/dist/_pkg/hex/neutral/address/address.d.ts +18 -0
  120. package/dist/_pkg/hex/neutral/address/as.d.ts +13 -0
  121. package/dist/_pkg/hex/neutral/address/index.d.ts +7 -0
  122. package/dist/_pkg/hex/neutral/address/is.d.ts +12 -0
  123. package/dist/_pkg/hex/neutral/address/to.d.ts +12 -0
  124. package/dist/_pkg/hex/neutral/ethAddress.d.ts +45 -0
  125. package/dist/_pkg/hex/neutral/hash/as.d.ts +11 -0
  126. package/dist/_pkg/hex/neutral/hash/hash.d.ts +28 -0
  127. package/dist/_pkg/hex/neutral/hash/index.d.ts +5 -0
  128. package/dist/_pkg/hex/neutral/hash/is.d.ts +9 -0
  129. package/dist/_pkg/hex/neutral/hash/zod.d.ts +6 -0
  130. package/dist/_pkg/hex/neutral/hex/as.d.ts +11 -0
  131. package/dist/_pkg/hex/neutral/hex/from/from.d.ts +8 -0
  132. package/dist/_pkg/hex/neutral/hex/from/fromArrayBuffer.d.ts +8 -0
  133. package/dist/_pkg/hex/neutral/hex/from/fromBigInt.d.ts +8 -0
  134. package/dist/_pkg/hex/neutral/hex/from/fromHexString.d.ts +9 -0
  135. package/dist/_pkg/hex/neutral/hex/from/fromNumber.d.ts +9 -0
  136. package/dist/_pkg/hex/neutral/hex/from/index.d.ts +6 -0
  137. package/dist/_pkg/hex/neutral/hex/hex.d.ts +17 -0
  138. package/dist/_pkg/hex/neutral/hex/index.d.ts +9 -0
  139. package/dist/_pkg/hex/neutral/hex/is.d.ts +9 -0
  140. package/dist/_pkg/hex/neutral/hex/isHexZero.d.ts +7 -0
  141. package/dist/_pkg/hex/neutral/hex/legacy.d.ts +7 -0
  142. package/dist/_pkg/hex/neutral/hex/nibble.d.ts +13 -0
  143. package/dist/_pkg/hex/neutral/hex/to.d.ts +8 -0
  144. package/dist/_pkg/hex/neutral/hexToBigInt.d.ts +8 -0
  145. package/dist/_pkg/hex/neutral/index.d.ts +8 -0
  146. package/dist/_pkg/hex/neutral/index.mjs +381 -0
  147. package/dist/_pkg/hex/neutral/model.d.ts +3 -0
  148. package/dist/_pkg/hex/neutral/model.mjs +1 -0
  149. package/dist/_pkg/hex/neutral/zod.d.ts +6 -0
  150. package/dist/_pkg/logger/neutral/ConsoleLogger.d.ts +7 -0
  151. package/dist/_pkg/logger/neutral/IdLogger.d.ts +19 -0
  152. package/dist/_pkg/logger/neutral/LevelLogger.d.ts +47 -0
  153. package/dist/_pkg/logger/neutral/NoOpLogFunction.d.ts +3 -0
  154. package/dist/_pkg/logger/neutral/SilentLogger.d.ts +17 -0
  155. package/dist/_pkg/logger/neutral/getFunctionName.d.ts +7 -0
  156. package/dist/_pkg/logger/neutral/index.d.ts +7 -0
  157. package/dist/_pkg/logger/neutral/index.mjs +126 -0
  158. package/dist/_pkg/object/neutral/AsObjectFactory.d.ts +8 -0
  159. package/dist/_pkg/object/neutral/AsTypeFactory.d.ts +11 -0
  160. package/dist/_pkg/object/neutral/EmptyObject.d.ts +2 -0
  161. package/dist/_pkg/object/neutral/IsObjectFactory.d.ts +16 -0
  162. package/dist/_pkg/object/neutral/JsonObject.d.ts +49 -0
  163. package/dist/_pkg/object/neutral/ObjectWrapper.d.ts +9 -0
  164. package/dist/_pkg/object/neutral/OmitStartsWith.d.ts +18 -0
  165. package/dist/_pkg/object/neutral/Optional.d.ts +3 -0
  166. package/dist/_pkg/object/neutral/Override.d.ts +4 -0
  167. package/dist/_pkg/object/neutral/PartialRecord.d.ts +3 -0
  168. package/dist/_pkg/object/neutral/PickStartsWith.d.ts +9 -0
  169. package/dist/_pkg/object/neutral/Simplify.d.ts +5 -0
  170. package/dist/_pkg/object/neutral/StringKeyObject.d.ts +3 -0
  171. package/dist/_pkg/object/neutral/Validator.d.ts +13 -0
  172. package/dist/_pkg/object/neutral/WithAdditional.d.ts +4 -0
  173. package/dist/_pkg/object/neutral/asObject.d.ts +4 -0
  174. package/dist/_pkg/object/neutral/deepMerge.d.ts +49 -0
  175. package/dist/_pkg/object/neutral/index-deprecated.d.ts +2 -0
  176. package/dist/_pkg/object/neutral/index-un-deprecated.d.ts +22 -0
  177. package/dist/_pkg/object/neutral/index-un-deprecated.mjs +320 -0
  178. package/dist/_pkg/object/neutral/index.d.ts +3 -0
  179. package/dist/_pkg/object/neutral/index.mjs +435 -0
  180. package/dist/_pkg/object/neutral/isType.d.ts +4 -0
  181. package/dist/_pkg/object/neutral/model.d.ts +14 -0
  182. package/dist/_pkg/object/neutral/model.mjs +1 -0
  183. package/dist/_pkg/object/neutral/omitBy.d.ts +21 -0
  184. package/dist/_pkg/object/neutral/pickBy.d.ts +21 -0
  185. package/dist/_pkg/object/neutral/removeFields.d.ts +9 -0
  186. package/dist/_pkg/object/neutral/toSafeJson.d.ts +41 -0
  187. package/dist/_pkg/object-model/neutral/AnyObject.d.ts +8 -0
  188. package/dist/_pkg/object-model/neutral/AsTypeFactory.d.ts +12 -0
  189. package/dist/_pkg/object-model/neutral/AsTypeFunction.d.ts +14 -0
  190. package/dist/_pkg/object-model/neutral/Compare.d.ts +3 -0
  191. package/dist/_pkg/object-model/neutral/EmptyObject.d.ts +8 -0
  192. package/dist/_pkg/object-model/neutral/index.d.ts +6 -0
  193. package/dist/_pkg/object-model/neutral/index.mjs +1 -0
  194. package/dist/_pkg/object-model/neutral/model.d.ts +6 -0
  195. package/dist/_pkg/object-model/neutral/model.mjs +1 -0
  196. package/dist/_pkg/object-model/neutral/types.d.ts +25 -0
  197. package/dist/_pkg/platform/browser/browser/index.d.ts +9 -0
  198. package/dist/_pkg/platform/browser/index-browser.d.ts +2 -0
  199. package/dist/_pkg/platform/browser/index-browser.mjs +18 -0
  200. package/dist/_pkg/platform/browser/index-node.d.ts +2 -0
  201. package/dist/_pkg/platform/browser/node/index.d.ts +9 -0
  202. package/dist/_pkg/platform/node/browser/index.d.ts +9 -0
  203. package/dist/_pkg/platform/node/index-browser.d.ts +2 -0
  204. package/dist/_pkg/platform/node/index-node.d.ts +2 -0
  205. package/dist/_pkg/platform/node/index-node.mjs +18 -0
  206. package/dist/_pkg/platform/node/node/index.d.ts +9 -0
  207. package/dist/_pkg/profile/neutral/index.d.ts +2 -0
  208. package/dist/_pkg/profile/neutral/index.mjs +37 -0
  209. package/dist/_pkg/profile/neutral/model.d.ts +2 -0
  210. package/dist/_pkg/profile/neutral/model.mjs +1 -0
  211. package/dist/_pkg/profile/neutral/profiler.d.ts +17 -0
  212. package/dist/_pkg/promise/neutral/PromiseEx.d.ts +24 -0
  213. package/dist/_pkg/promise/neutral/fulfilled.d.ts +7 -0
  214. package/dist/_pkg/promise/neutral/fulfilledValues.d.ts +20 -0
  215. package/dist/_pkg/promise/neutral/index.d.ts +7 -0
  216. package/dist/_pkg/promise/neutral/index.mjs +57 -0
  217. package/dist/_pkg/promise/neutral/model.d.ts +3 -0
  218. package/dist/_pkg/promise/neutral/model.mjs +1 -0
  219. package/dist/_pkg/promise/neutral/rejected.d.ts +7 -0
  220. package/dist/_pkg/promise/neutral/toPromise.d.ts +8 -0
  221. package/dist/_pkg/promise/neutral/types.d.ts +23 -0
  222. package/dist/_pkg/retry/neutral/index.d.ts +2 -0
  223. package/dist/_pkg/retry/neutral/index.mjs +28 -0
  224. package/dist/_pkg/retry/neutral/model.d.ts +2 -0
  225. package/dist/_pkg/retry/neutral/model.mjs +1 -0
  226. package/dist/_pkg/retry/neutral/retry.d.ts +23 -0
  227. package/dist/_pkg/set/neutral/index.d.ts +2 -0
  228. package/dist/_pkg/set/neutral/index.mjs +20 -0
  229. package/dist/_pkg/set/neutral/lib/difference.d.ts +8 -0
  230. package/dist/_pkg/set/neutral/lib/index.d.ts +4 -0
  231. package/dist/_pkg/set/neutral/lib/intersection.d.ts +8 -0
  232. package/dist/_pkg/set/neutral/lib/union.d.ts +8 -0
  233. package/dist/_pkg/static-implements/neutral/index.d.ts +2 -0
  234. package/dist/_pkg/static-implements/neutral/index.mjs +10 -0
  235. package/dist/_pkg/static-implements/neutral/staticImplements.d.ts +7 -0
  236. package/dist/_pkg/storage/neutral/KeyValueStore.d.ts +34 -0
  237. package/dist/_pkg/storage/neutral/index.d.ts +2 -0
  238. package/dist/_pkg/storage/neutral/index.mjs +1 -0
  239. package/dist/_pkg/storage/neutral/model.d.ts +2 -0
  240. package/dist/_pkg/storage/neutral/model.mjs +1 -0
  241. package/dist/_pkg/telemetry/neutral/index.d.ts +3 -0
  242. package/dist/_pkg/telemetry/neutral/index.mjs +152 -0
  243. package/dist/_pkg/telemetry/neutral/model.d.ts +2 -0
  244. package/dist/_pkg/telemetry/neutral/model.mjs +1 -0
  245. package/dist/_pkg/telemetry/neutral/span.d.ts +51 -0
  246. package/dist/_pkg/telemetry/neutral/timeBudget.d.ts +12 -0
  247. package/dist/_pkg/telemetry-exporter/neutral/XyConsoleSpanExporter.d.ts +40 -0
  248. package/dist/_pkg/telemetry-exporter/neutral/index.d.ts +2 -0
  249. package/dist/_pkg/telemetry-exporter/neutral/index.mjs +88 -0
  250. package/dist/_pkg/timer/neutral/index.d.ts +2 -0
  251. package/dist/_pkg/timer/neutral/index.mjs +75 -0
  252. package/dist/_pkg/timer/neutral/setTimeoutEx.d.ts +37 -0
  253. package/dist/_pkg/typeof/neutral/Brand.d.ts +5 -0
  254. package/dist/_pkg/typeof/neutral/IdentityFunction.d.ts +3 -0
  255. package/dist/_pkg/typeof/neutral/ObjectTypeShape.d.ts +5 -0
  256. package/dist/_pkg/typeof/neutral/TypeOfTypes.d.ts +3 -0
  257. package/dist/_pkg/typeof/neutral/Typed.d.ts +41 -0
  258. package/dist/_pkg/typeof/neutral/ifDefined.d.ts +8 -0
  259. package/dist/_pkg/typeof/neutral/ifTypeOf.d.ts +11 -0
  260. package/dist/_pkg/typeof/neutral/index.d.ts +12 -0
  261. package/dist/_pkg/typeof/neutral/index.mjs +255 -0
  262. package/dist/_pkg/typeof/neutral/is.d.ts +116 -0
  263. package/dist/_pkg/typeof/neutral/isType.d.ts +9 -0
  264. package/dist/_pkg/typeof/neutral/model.d.ts +7 -0
  265. package/dist/_pkg/typeof/neutral/model.mjs +1 -0
  266. package/dist/_pkg/typeof/neutral/typeOf.d.ts +8 -0
  267. package/dist/_pkg/typeof/neutral/validateType.d.ts +10 -0
  268. package/dist/_pkg/url/browser/index-browser.d.ts +12 -0
  269. package/dist/_pkg/url/browser/index-browser.mjs +12 -0
  270. package/dist/_pkg/url/browser/index-neutral.d.ts +12 -0
  271. package/dist/_pkg/url/browser/index-node.d.ts +13 -0
  272. package/dist/_pkg/url/browser/lib/index.d.ts +2 -0
  273. package/dist/_pkg/url/browser/lib/isLocalhost.d.ts +7 -0
  274. package/dist/_pkg/url/neutral/index-browser.d.ts +12 -0
  275. package/dist/_pkg/url/neutral/index-neutral.d.ts +12 -0
  276. package/dist/_pkg/url/neutral/index-neutral.mjs +12 -0
  277. package/dist/_pkg/url/neutral/index-node.d.ts +13 -0
  278. package/dist/_pkg/url/neutral/lib/index.d.ts +2 -0
  279. package/dist/_pkg/url/neutral/lib/isLocalhost.d.ts +7 -0
  280. package/dist/_pkg/url/node/index-browser.d.ts +12 -0
  281. package/dist/_pkg/url/node/index-neutral.d.ts +12 -0
  282. package/dist/_pkg/url/node/index-node.d.ts +13 -0
  283. package/dist/_pkg/url/node/index-node.mjs +15 -0
  284. package/dist/_pkg/url/node/lib/index.d.ts +2 -0
  285. package/dist/_pkg/url/node/lib/isLocalhost.d.ts +7 -0
  286. package/dist/_pkg/zod/neutral/Config.d.ts +8 -0
  287. package/dist/_pkg/zod/neutral/index.d.ts +8 -0
  288. package/dist/_pkg/zod/neutral/index.mjs +127 -0
  289. package/dist/_pkg/zod/neutral/model.d.ts +2 -0
  290. package/dist/_pkg/zod/neutral/model.mjs +1 -0
  291. package/dist/_pkg/zod/neutral/zodAllFactory.d.ts +20 -0
  292. package/dist/_pkg/zod/neutral/zodAsAsyncFactory.d.ts +14 -0
  293. package/dist/_pkg/zod/neutral/zodAsFactory.d.ts +14 -0
  294. package/dist/_pkg/zod/neutral/zodIsFactory.d.ts +8 -0
  295. package/dist/_pkg/zod/neutral/zodToAsyncFactory.d.ts +14 -0
  296. package/dist/_pkg/zod/neutral/zodToFactory.d.ts +14 -0
  297. package/dist/browser/index.d.ts +32 -0
  298. package/dist/browser/index.mjs +32 -0
  299. package/dist/browser/platform.d.ts +1 -0
  300. package/dist/browser/platform.mjs +1 -0
  301. package/dist/browser/url.d.ts +1 -0
  302. package/dist/browser/url.mjs +1 -0
  303. package/dist/neutral/api.d.ts +1 -0
  304. package/dist/neutral/api.mjs +1 -0
  305. package/dist/neutral/api.model.d.ts +1 -0
  306. package/dist/neutral/api.model.mjs +1 -0
  307. package/dist/neutral/array.d.ts +1 -0
  308. package/dist/neutral/array.mjs +1 -0
  309. package/dist/neutral/arraybuffer.d.ts +1 -0
  310. package/dist/neutral/arraybuffer.mjs +1 -0
  311. package/dist/neutral/assert.d.ts +1 -0
  312. package/dist/neutral/assert.mjs +1 -0
  313. package/dist/neutral/assert.model.d.ts +1 -0
  314. package/dist/neutral/assert.model.mjs +1 -0
  315. package/dist/neutral/base.d.ts +1 -0
  316. package/dist/neutral/base.mjs +1 -0
  317. package/dist/neutral/base.model.d.ts +1 -0
  318. package/dist/neutral/base.model.mjs +1 -0
  319. package/dist/neutral/creatable.d.ts +1 -0
  320. package/dist/neutral/creatable.mjs +1 -0
  321. package/dist/neutral/creatable.model.d.ts +1 -0
  322. package/dist/neutral/creatable.model.mjs +1 -0
  323. package/dist/neutral/decimal-precision.d.ts +1 -0
  324. package/dist/neutral/decimal-precision.mjs +1 -0
  325. package/dist/neutral/delay.d.ts +1 -0
  326. package/dist/neutral/delay.mjs +1 -0
  327. package/dist/neutral/ellipsize.d.ts +1 -0
  328. package/dist/neutral/ellipsize.mjs +1 -0
  329. package/dist/neutral/enum.d.ts +1 -0
  330. package/dist/neutral/enum.mjs +1 -0
  331. package/dist/neutral/enum.model.d.ts +1 -0
  332. package/dist/neutral/enum.model.mjs +1 -0
  333. package/dist/neutral/error.d.ts +1 -0
  334. package/dist/neutral/error.mjs +1 -0
  335. package/dist/neutral/error.model.d.ts +1 -0
  336. package/dist/neutral/error.model.mjs +1 -0
  337. package/dist/neutral/events.d.ts +1 -0
  338. package/dist/neutral/events.mjs +1 -0
  339. package/dist/neutral/events.model.d.ts +1 -0
  340. package/dist/neutral/events.model.mjs +1 -0
  341. package/dist/neutral/exists.d.ts +1 -0
  342. package/dist/neutral/exists.mjs +1 -0
  343. package/dist/neutral/fetch.d.ts +1 -0
  344. package/dist/neutral/fetch.mjs +1 -0
  345. package/dist/neutral/fetch.model.d.ts +1 -0
  346. package/dist/neutral/fetch.model.mjs +1 -0
  347. package/dist/neutral/forget.d.ts +1 -0
  348. package/dist/neutral/forget.mjs +1 -0
  349. package/dist/neutral/forget.model.d.ts +1 -0
  350. package/dist/neutral/forget.model.mjs +1 -0
  351. package/dist/neutral/function-name.d.ts +1 -0
  352. package/dist/neutral/function-name.mjs +1 -0
  353. package/dist/neutral/hex.d.ts +1 -0
  354. package/dist/neutral/hex.mjs +1 -0
  355. package/dist/neutral/hex.model.d.ts +1 -0
  356. package/dist/neutral/hex.model.mjs +1 -0
  357. package/dist/neutral/logger.d.ts +1 -0
  358. package/dist/neutral/logger.mjs +1 -0
  359. package/dist/neutral/model.d.ts +18 -0
  360. package/dist/neutral/model.mjs +18 -0
  361. package/dist/neutral/object.d.ts +1 -0
  362. package/dist/neutral/object.mjs +1 -0
  363. package/dist/neutral/object.model.d.ts +1 -0
  364. package/dist/neutral/object.model.mjs +1 -0
  365. package/dist/neutral/profile.d.ts +1 -0
  366. package/dist/neutral/profile.mjs +1 -0
  367. package/dist/neutral/profile.model.d.ts +1 -0
  368. package/dist/neutral/profile.model.mjs +1 -0
  369. package/dist/neutral/promise.d.ts +1 -0
  370. package/dist/neutral/promise.mjs +1 -0
  371. package/dist/neutral/promise.model.d.ts +1 -0
  372. package/dist/neutral/promise.model.mjs +1 -0
  373. package/dist/neutral/retry.d.ts +1 -0
  374. package/dist/neutral/retry.mjs +1 -0
  375. package/dist/neutral/retry.model.d.ts +1 -0
  376. package/dist/neutral/retry.model.mjs +1 -0
  377. package/dist/neutral/set.d.ts +1 -0
  378. package/dist/neutral/set.mjs +1 -0
  379. package/dist/neutral/static-implements.d.ts +1 -0
  380. package/dist/neutral/static-implements.mjs +1 -0
  381. package/dist/neutral/storage.d.ts +1 -0
  382. package/dist/neutral/storage.mjs +1 -0
  383. package/dist/neutral/storage.model.d.ts +1 -0
  384. package/dist/neutral/storage.model.mjs +1 -0
  385. package/dist/neutral/telemetry-exporter.d.ts +1 -0
  386. package/dist/neutral/telemetry-exporter.mjs +1 -0
  387. package/dist/neutral/telemetry.d.ts +1 -0
  388. package/dist/neutral/telemetry.mjs +1 -0
  389. package/dist/neutral/telemetry.model.d.ts +1 -0
  390. package/dist/neutral/telemetry.model.mjs +1 -0
  391. package/dist/neutral/timer.d.ts +1 -0
  392. package/dist/neutral/timer.mjs +1 -0
  393. package/dist/neutral/typeof.d.ts +1 -0
  394. package/dist/neutral/typeof.mjs +1 -0
  395. package/dist/neutral/typeof.model.d.ts +1 -0
  396. package/dist/neutral/typeof.model.mjs +1 -0
  397. package/dist/neutral/url.d.ts +1 -0
  398. package/dist/neutral/url.mjs +1 -0
  399. package/dist/neutral/zod.d.ts +1 -0
  400. package/dist/neutral/zod.mjs +1 -0
  401. package/dist/neutral/zod.model.d.ts +1 -0
  402. package/dist/neutral/zod.model.mjs +1 -0
  403. package/dist/node/index.d.ts +32 -0
  404. package/dist/node/index.mjs +32 -0
  405. package/dist/node/platform.d.ts +1 -0
  406. package/dist/node/platform.mjs +1 -0
  407. package/dist/node/url.d.ts +1 -0
  408. package/dist/node/url.mjs +1 -0
  409. package/package.json +339 -0
@@ -0,0 +1,49 @@
1
+ import * as z from 'zod/mini';
2
+ declare const JsonArrayZod: z.ZodMiniArray<z.ZodMiniLazy<z.ZodMiniType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
3
+ declare const JsonValueZod: z.ZodMiniType<unknown>;
4
+ /** Zod schema for a JSON object with string keys and recursive JSON values. */
5
+ export declare const JsonObjectZod: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
6
+ /** A recursive JSON value: string, number, boolean, null, array, or object. */
7
+ export type JsonValue = z.infer<typeof JsonValueZod>;
8
+ /** A JSON object with string keys and JSON values. */
9
+ export type JsonObject = z.infer<typeof JsonObjectZod>;
10
+ /** A JSON array containing JSON values. */
11
+ export type JsonArray = z.infer<typeof JsonArrayZod>;
12
+ /** Type guard that checks if a value is a valid JSON value. */
13
+ export declare const isJsonValue: <T>(value: T) => value is T;
14
+ /** Casts a value to JsonValue or returns undefined if it does not conform. */
15
+ export declare const asJsonValue: {
16
+ <T>(value: T): T | undefined;
17
+ <T>(value: T, assert: import("../../zod/neutral/index.ts").ZodFactoryConfig): T;
18
+ };
19
+ /** Parses a value into a JsonValue, throwing if it does not conform. */
20
+ export declare const toJsonValue: {
21
+ <T>(value: T): T | undefined;
22
+ <T>(value: T, assert: import("../../zod/neutral/index.ts").ZodFactoryConfig): T;
23
+ };
24
+ /** Type guard that checks if a value is a valid JSON array. */
25
+ export declare const isJsonArray: <T>(value: T) => value is T & unknown[];
26
+ /** Casts a value to JsonArray or returns undefined if it does not conform. */
27
+ export declare const asJsonArray: {
28
+ <T>(value: T): (T & unknown[]) | undefined;
29
+ <T>(value: T, assert: import("../../zod/neutral/index.ts").ZodFactoryConfig): T & unknown[];
30
+ };
31
+ /** Parses a value into a JsonArray, throwing if it does not conform. */
32
+ export declare const toJsonArray: {
33
+ <T>(value: T): (T & unknown[]) | undefined;
34
+ <T>(value: T, assert: import("../../zod/neutral/index.ts").ZodFactoryConfig): T & unknown[];
35
+ };
36
+ /** Type guard that checks if a value is a valid JSON object. */
37
+ export declare const isJsonObject: <T>(value: T) => value is T & Record<string, unknown>;
38
+ /** Casts a value to JsonObject or returns undefined if it does not conform. */
39
+ export declare const asJsonObject: {
40
+ <T>(value: T): (T & Record<string, unknown>) | undefined;
41
+ <T>(value: T, assert: import("../../zod/neutral/index.ts").ZodFactoryConfig): T & Record<string, unknown>;
42
+ };
43
+ /** Parses a value into a JsonObject, throwing if it does not conform. */
44
+ export declare const toJsonObject: {
45
+ <T>(value: T): (T & Record<string, unknown>) | undefined;
46
+ <T>(value: T, assert: import("../../zod/neutral/index.ts").ZodFactoryConfig): T & Record<string, unknown>;
47
+ };
48
+ export {};
49
+ //# sourceMappingURL=JsonObject.d.ts.map
@@ -0,0 +1,9 @@
1
+ import type { EmptyObject } from './EmptyObject.ts';
2
+ import type { StringKeyObject } from './StringKeyObject.ts';
3
+ /** Abstract base class that wraps an object and provides typed access to it. */
4
+ export declare abstract class ObjectWrapper<T extends EmptyObject = EmptyObject> {
5
+ readonly obj: T;
6
+ constructor(obj: T);
7
+ protected get stringKeyObj(): StringKeyObject;
8
+ }
9
+ //# sourceMappingURL=ObjectWrapper.d.ts.map
@@ -0,0 +1,18 @@
1
+ import type { JsonValue } from './JsonObject.ts';
2
+ /** Omits the keys of T that start with the given prefix. */
3
+ export type OmitStartsWith<T, Prefix extends string> = {
4
+ [K in keyof T as K extends `${Prefix}${string}` ? never : K]: T[K];
5
+ };
6
+ /** Recursively omits keys that start with the given prefix, including in nested objects and arrays. */
7
+ export type DeepOmitStartsWith<T, Prefix extends string> = T extends (infer U)[] ? DeepOmitStartsWith<U, Prefix>[] : T extends object ? {
8
+ [K in keyof T as K extends string ? K extends `${Prefix}${string}` ? never : K : K]: DeepOmitStartsWith<T[K], Prefix>;
9
+ } : T;
10
+ /** Recursively removes all non-string keys from an object type, including in nested objects and arrays. */
11
+ export type DeepRestrictToStringKeys<T> = {
12
+ [K in keyof T as K extends string ? K : never]: T[K] extends (infer U)[] ? DeepRestrictToStringKeys<U>[] : T[K] extends object ? DeepRestrictToStringKeys<T[K]> : T[K];
13
+ };
14
+ /** Recursively restricts an object type to only JSON-compatible values, excluding non-serializable types. */
15
+ export type DeepRestrictToJson<T> = {
16
+ [K in keyof T as K extends string ? K : never]: T[K] extends (infer U)[] ? DeepRestrictToJson<U>[] : T[K] extends object ? DeepRestrictToJson<T[K]> : T[K] extends JsonValue ? T[K] : never;
17
+ };
18
+ //# sourceMappingURL=OmitStartsWith.d.ts.map
@@ -0,0 +1,3 @@
1
+ /** Makes the specified fields of T optional while keeping the rest required. */
2
+ export type Optional<T extends object, F extends keyof T> = Omit<T, F> & Partial<Pick<T, F>>;
3
+ //# sourceMappingURL=Optional.d.ts.map
@@ -0,0 +1,4 @@
1
+ /** Overrides properties of T1 with those from T2. */
2
+ type Override<T1, T2> = Omit<T1, keyof T2> & T2;
3
+ export type { Override };
4
+ //# sourceMappingURL=Override.d.ts.map
@@ -0,0 +1,3 @@
1
+ /** @deprecated use Partial<Record<>> instead */
2
+ export type PartialRecord<K extends keyof any, T> = Partial<Record<K, T>>;
3
+ //# sourceMappingURL=PartialRecord.d.ts.map
@@ -0,0 +1,9 @@
1
+ /** Picks only the keys of T that start with the given prefix. */
2
+ export type PickStartsWith<T, Prefix extends string> = {
3
+ [K in keyof T as K extends `${Prefix}${string}` ? K : never]: T[K];
4
+ };
5
+ /** Recursively picks only the keys that start with the given prefix, including in nested objects and arrays. */
6
+ export type DeepPickStartsWith<T, Prefix extends string> = T extends (infer U)[] ? DeepPickStartsWith<U, Prefix>[] : T extends object ? {
7
+ [K in keyof T as K extends string ? K extends `${Prefix}${string}` ? K : never : K]: DeepPickStartsWith<T[K], Prefix>;
8
+ } : T;
9
+ //# sourceMappingURL=PickStartsWith.d.ts.map
@@ -0,0 +1,5 @@
1
+ /** Flattens an intersection or complex mapped type into a single object type for better readability. */
2
+ export type Simplify<T> = {
3
+ [K in keyof T]: T[K];
4
+ } & {};
5
+ //# sourceMappingURL=Simplify.d.ts.map
@@ -0,0 +1,3 @@
1
+ /** An object type with string keys and values of type T. */
2
+ export type StringKeyObject<T = unknown> = Record<string, T>;
3
+ //# sourceMappingURL=StringKeyObject.d.ts.map
@@ -0,0 +1,13 @@
1
+ import type { AnyObject } from '../../object-model/neutral/index.ts';
2
+ import type { Promisable } from '../../promise/neutral/index.ts';
3
+ import type { EmptyObject } from './EmptyObject.ts';
4
+ import { ObjectWrapper } from './ObjectWrapper.ts';
5
+ /** Interface for validating objects and returning any errors found. */
6
+ export interface Validator<T extends EmptyObject = AnyObject> {
7
+ validate(payload: T): Promisable<Error[]>;
8
+ }
9
+ /** Abstract base class for validators that wraps a partial object and provides a validation method. */
10
+ export declare abstract class ValidatorBase<T extends EmptyObject = AnyObject> extends ObjectWrapper<Partial<T>> implements Validator<T> {
11
+ abstract validate(payload: T): Promisable<Error[]>;
12
+ }
13
+ //# sourceMappingURL=Validator.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { EmptyObject } from './EmptyObject.ts';
2
+ /** Intersects T with TAdditional if TAdditional is an object, otherwise returns T unchanged. */
3
+ export type WithAdditional<T extends EmptyObject | void, TAdditional extends EmptyObject | void = void> = TAdditional extends EmptyObject ? T & TAdditional : T;
4
+ //# sourceMappingURL=WithAdditional.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { AnyObject } from '../../object-model/neutral/index.ts';
2
+ /** Type-narrowing function that casts a value to AnyObject if it is a plain object, or returns undefined. */
3
+ export declare const asAnyObject: import("../../object-model/neutral/index.ts").AsTypeFunction<AnyObject>;
4
+ //# sourceMappingURL=asObject.d.ts.map
@@ -0,0 +1,49 @@
1
+ import type { AnyObject } from '../../object-model/neutral/index.ts';
2
+ /**
3
+ * Deeply merges two types into a new type.
4
+ */
5
+ type DeepMerge<A, B> = {
6
+ [K in keyof A | keyof B]: K extends keyof B ? K extends keyof A ? A[K] extends object ? B[K] extends object ? DeepMerge<A[K], B[K]> : B[K] : B[K] : B[K] : K extends keyof A ? A[K] : never;
7
+ };
8
+ /**
9
+ * Merges multiple types into a new type.
10
+ */
11
+ type MergeAll<T extends object[], R = {}> = T extends [infer First extends object, ...infer Rest extends object[]] ? MergeAll<Rest, DeepMerge<R, First>> : R;
12
+ /**
13
+ * Options for merging objects in the deep merge function.
14
+ */
15
+ interface MergeOptions {
16
+ /**
17
+ * Strategy for merging arrays.
18
+ * - 'overwrite': Overwrites the array with the last object's value.
19
+ * - 'concat': Concatenates arrays from all objects.
20
+ * @default 'overwrite'
21
+ */
22
+ arrayStrategy?: 'overwrite' | 'concat';
23
+ /**
24
+ * Mutate the first object in the list instead of creating a new one.
25
+ * @default false
26
+ */
27
+ mutate?: boolean;
28
+ }
29
+ /**
30
+ * Creates a deep merge function with the specified options.
31
+ * @param options Options for merging.
32
+ * @returns A deep merge function configured for the specified options.
33
+ */
34
+ export declare function createDeepMerge(options: MergeOptions): <T extends AnyObject[]>(...objects: T) => MergeAll<T>;
35
+ /**
36
+ * Deeply merges multiple objects into a new object.
37
+ * @param objects Multiple objects to merge deeply.
38
+ * The function merges properties from all objects into a new object.
39
+ * If a property exists in multiple objects, the last object's value will be used.
40
+ * If a property is an object, it will be merged recursively.
41
+ * If a property is an array, it will be overwritten by the last object's value.
42
+ * If a property is a primitive value, it will be overwritten by the last object's value.
43
+ * If a property is undefined in the source, it will be skipped.
44
+ * If a property is a symbol, it will be merged as well.
45
+ * @returns A new object with the merged properties.
46
+ */
47
+ export declare const deepMerge: <T extends AnyObject[]>(...objects: T) => MergeAll<T>;
48
+ export {};
49
+ //# sourceMappingURL=deepMerge.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './isType.ts';
2
+ //# sourceMappingURL=index-deprecated.d.ts.map
@@ -0,0 +1,22 @@
1
+ export * from './asObject.ts';
2
+ export * from './AsObjectFactory.ts';
3
+ export * from './AsTypeFactory.ts';
4
+ export * from './deepMerge.ts';
5
+ export * from './IsObjectFactory.ts';
6
+ export * from './JsonObject.ts';
7
+ export * from './ObjectWrapper.ts';
8
+ export * from './omitBy.ts';
9
+ export * from './OmitStartsWith.ts';
10
+ export * from './Optional.ts';
11
+ export * from './Override.ts';
12
+ export * from './PartialRecord.ts';
13
+ export * from './pickBy.ts';
14
+ export * from './PickStartsWith.ts';
15
+ export * from './removeFields.ts';
16
+ export * from './Simplify.ts';
17
+ export * from './StringKeyObject.ts';
18
+ export * from './toSafeJson.ts';
19
+ export * from './Validator.ts';
20
+ export * from './WithAdditional.ts';
21
+ export * from '../../object-model/neutral/index.ts';
22
+ //# sourceMappingURL=index-un-deprecated.d.ts.map
@@ -0,0 +1,320 @@
1
+ // src/asObject.ts
2
+ import { isObject } from "../../typeof/neutral/index.mjs";
3
+
4
+ // src/AsTypeFactory.ts
5
+ import { assertDefinedEx } from "../../assert/neutral/index.mjs";
6
+ import { isPromise, isTruthy } from "../../typeof/neutral/index.mjs";
7
+ var AsTypeFactory = {
8
+ create: (typeCheck) => {
9
+ const func = (value, assertOrConfig, config) => {
10
+ const isPredicate = typeof assertOrConfig === "number";
11
+ const resolvedAssert = isPredicate || typeof assertOrConfig === "object" ? void 0 : assertOrConfig;
12
+ const resolvedConfig = isPredicate ? void 0 : typeof assertOrConfig === "object" ? assertOrConfig : config;
13
+ const isRequired = isTruthy(resolvedConfig?.required);
14
+ if (!isRequired && (value === void 0 || value === null)) {
15
+ return void 0;
16
+ }
17
+ if (isPromise(value)) {
18
+ throw new TypeError('un-awaited promises may not be sent to "as" functions');
19
+ }
20
+ const result = typeCheck(value, resolvedConfig) ? value : void 0;
21
+ if (resolvedAssert !== void 0) {
22
+ const message = typeof resolvedAssert === "function" ? resolvedAssert : () => resolvedAssert;
23
+ return assertDefinedEx(result, message);
24
+ }
25
+ return result;
26
+ };
27
+ return func;
28
+ },
29
+ createOptional: (typeCheck) => {
30
+ const func = (value) => {
31
+ if (value === void 0 || value === null) return void 0;
32
+ if (isPromise(value)) {
33
+ throw new TypeError('un-awaited promises may not be sent to "as" functions');
34
+ }
35
+ return typeCheck(value) ? value : void 0;
36
+ };
37
+ return func;
38
+ }
39
+ };
40
+
41
+ // src/AsObjectFactory.ts
42
+ var AsObjectFactory = {
43
+ create: (typeCheck) => {
44
+ return AsTypeFactory.create(typeCheck);
45
+ },
46
+ createOptional: (typeCheck) => {
47
+ return AsTypeFactory.createOptional(typeCheck);
48
+ }
49
+ };
50
+
51
+ // src/asObject.ts
52
+ var asAnyObject = (() => AsObjectFactory.create((obj) => isObject(obj)))();
53
+
54
+ // src/deepMerge.ts
55
+ var isUnsafeKey = (key) => typeof key === "string" && ["__proto__", "constructor", "prototype"].includes(key);
56
+ var isPlainObject = (value) => {
57
+ const prototype = Object.getPrototypeOf(value);
58
+ return prototype === Object.prototype || prototype === null;
59
+ };
60
+ function merge(target, source, options) {
61
+ if (!source || typeof source !== "object") return target;
62
+ for (const key of Reflect.ownKeys(source)) {
63
+ if (isUnsafeKey(key)) {
64
+ continue;
65
+ }
66
+ const value = source[key];
67
+ if (Array.isArray(value)) {
68
+ const targetValue = target[key];
69
+ target[key] = options?.arrayStrategy === "concat" && Array.isArray(targetValue) ? [...targetValue, ...value] : value;
70
+ } else if (value !== null && typeof value === "object" && isPlainObject(value)) {
71
+ const targetValue = target[key];
72
+ if (targetValue === void 0 || targetValue === null || typeof targetValue !== "object" || !isPlainObject(targetValue)) {
73
+ target[key] = {};
74
+ }
75
+ merge(target[key], value, options);
76
+ } else {
77
+ target[key] = value;
78
+ }
79
+ }
80
+ return target;
81
+ }
82
+ function createDeepMerge(options) {
83
+ return function deepMerge2(...objects) {
84
+ const result = options.mutate === true ? objects[0] ?? {} : {};
85
+ for (const obj of objects) {
86
+ merge(result, obj, options);
87
+ }
88
+ return result;
89
+ };
90
+ }
91
+ var deepMerge = createDeepMerge({ arrayStrategy: "overwrite", mutate: false });
92
+
93
+ // src/IsObjectFactory.ts
94
+ import {
95
+ isObject as isObject2,
96
+ isTruthy as isTruthy2
97
+ } from "../../typeof/neutral/index.mjs";
98
+ import { isType } from "../../typeof/neutral/index.mjs";
99
+ var IsObjectFactory = class {
100
+ /**
101
+ * Creates a type-guard function that validates an object matches the given shape and passes additional checks.
102
+ * @param shape - An optional map of property names to expected types.
103
+ * @param additionalChecks - Optional extra type-check functions to run after shape validation.
104
+ * @returns A type-guard function for type T.
105
+ */
106
+ create(shape, additionalChecks) {
107
+ return (obj, config) => {
108
+ if (!isObject2(obj)) {
109
+ return false;
110
+ }
111
+ const log = typeof config === "object" ? config.log : void 0;
112
+ return (
113
+ // do primary check
114
+ Object.entries(shape ?? {}).filter(([key, type]) => {
115
+ const isResult = isType(obj[key], type);
116
+ if (!isResult && isTruthy2(log)) {
117
+ const logger = typeof log === "object" ? log : console;
118
+ logger.warn(`isType Failed: ${key}: ${type}`);
119
+ }
120
+ return !isResult;
121
+ }).length === 0 && (additionalChecks?.reduce((prev, check) => prev && check(obj, { log }), true) ?? true)
122
+ );
123
+ };
124
+ }
125
+ };
126
+
127
+ // src/JsonObject.ts
128
+ import {
129
+ zodAsFactory,
130
+ zodIsFactory,
131
+ zodToFactory
132
+ } from "../../zod/neutral/index.mjs";
133
+ import * as z from "zod/mini";
134
+ var JsonArrayZod = z.array(z.lazy(() => JsonValueZod));
135
+ var JsonValueZod = z.lazy(() => z.union([
136
+ z.string(),
137
+ z.number(),
138
+ z.boolean(),
139
+ z.null(),
140
+ z.array(JsonValueZod),
141
+ z.record(z.string(), JsonValueZod)
142
+ // object with string keys and JSON values
143
+ ]));
144
+ var JsonObjectZod = z.record(z.string(), JsonValueZod);
145
+ var isJsonValue = zodIsFactory(JsonValueZod);
146
+ var asJsonValue = zodAsFactory(JsonValueZod, "asJsonValue");
147
+ var toJsonValue = zodToFactory(JsonValueZod, "toJsonValue");
148
+ var isJsonArray = zodIsFactory(JsonArrayZod);
149
+ var asJsonArray = zodAsFactory(JsonArrayZod, "asJsonArray");
150
+ var toJsonArray = zodToFactory(JsonArrayZod, "toJsonArray");
151
+ var isJsonObject = zodIsFactory(JsonObjectZod);
152
+ var asJsonObject = zodAsFactory(JsonObjectZod, "asJsonObject");
153
+ var toJsonObject = zodToFactory(JsonObjectZod, "toJsonObject");
154
+
155
+ // src/ObjectWrapper.ts
156
+ var ObjectWrapper = class {
157
+ obj;
158
+ constructor(obj) {
159
+ this.obj = obj;
160
+ }
161
+ get stringKeyObj() {
162
+ return this.obj;
163
+ }
164
+ };
165
+
166
+ // src/omitBy.ts
167
+ import { assertEx } from "../../assert/neutral/index.mjs";
168
+ var omitByArray = (obj, predicate, maxDepth) => {
169
+ return obj.map((value) => {
170
+ return value !== null && typeof value === "object" ? omitBy(value, predicate, maxDepth) : value;
171
+ });
172
+ };
173
+ var omitByObject = (obj, predicate, maxDepth) => {
174
+ const result = {};
175
+ for (const key of Object.keys(obj)) {
176
+ const value = obj[key];
177
+ if (!predicate(value, key)) {
178
+ result[key] = value !== null && typeof value === "object" ? omitBy(value, predicate, maxDepth - 1) : value;
179
+ }
180
+ }
181
+ return result;
182
+ };
183
+ var omitBy = (obj, predicate, maxDepth = 1) => {
184
+ if (maxDepth <= 0) {
185
+ return obj;
186
+ }
187
+ return Array.isArray(obj) ? omitByArray(obj, predicate, maxDepth - 1) : omitByObject(obj, predicate, maxDepth - 1);
188
+ };
189
+ var omitByPrefixPredicate = (prefix) => (_, key) => {
190
+ assertEx(typeof key === "string", () => `Invalid key type [${key}, ${typeof key}]`);
191
+ return key.startsWith(prefix);
192
+ };
193
+ var omitByPrefix = (payload, prefix, maxDepth = 100) => {
194
+ return omitBy(payload, omitByPrefixPredicate(prefix), maxDepth);
195
+ };
196
+
197
+ // src/pickBy.ts
198
+ import { assertEx as assertEx2 } from "../../assert/neutral/index.mjs";
199
+ var pickByArray = (obj, predicate, maxDepth) => {
200
+ return obj.map((value) => {
201
+ return value !== null && typeof value === "object" ? pickBy(value, predicate, maxDepth) : value;
202
+ });
203
+ };
204
+ var pickByObject = (obj, predicate, maxDepth) => {
205
+ const result = {};
206
+ for (const key of Object.keys(obj)) {
207
+ const value = obj[key];
208
+ if (predicate(value, key)) {
209
+ result[key] = value !== null && typeof value === "object" ? pickBy(value, predicate, maxDepth - 1) : value;
210
+ }
211
+ }
212
+ return result;
213
+ };
214
+ var pickBy = (obj, predicate, maxDepth = 1) => {
215
+ if (maxDepth <= 0) {
216
+ return obj;
217
+ }
218
+ return Array.isArray(obj) ? pickByArray(obj, predicate, maxDepth - 1) : pickByObject(obj, predicate, maxDepth - 1);
219
+ };
220
+ var pickByPrefixPredicate = (prefix) => (_, key) => {
221
+ assertEx2(typeof key === "string", () => `Invalid key type [${key}, ${typeof key}]`);
222
+ return key.startsWith(prefix);
223
+ };
224
+ var pickByPrefix = (payload, prefix, maxDepth = 100) => {
225
+ return pickBy(payload, pickByPrefixPredicate(prefix), maxDepth);
226
+ };
227
+
228
+ // src/removeFields.ts
229
+ var removeFields = (obj, fields) => {
230
+ const clone = { ...obj };
231
+ for (const field of fields) {
232
+ delete clone[field];
233
+ }
234
+ return clone;
235
+ };
236
+
237
+ // src/toSafeJson.ts
238
+ var toSafeJsonArray = (value, cycleList, maxDepth = 3) => {
239
+ return value.map((item) => toSafeJsonValue(item, cycleList, maxDepth));
240
+ };
241
+ var toSafeJsonObject = (value, cycleList, maxDepth = 3) => {
242
+ const result = {};
243
+ for (const [key, entry] of Object.entries(value)) {
244
+ result[key] = entry === void 0 ? "[Undefined]" : toSafeJsonValue(entry, cycleList, maxDepth);
245
+ }
246
+ return result;
247
+ };
248
+ var toSafeJsonValue = (value, cycleList, maxDepth = 3) => {
249
+ if (maxDepth <= 0 && typeof value === "object") {
250
+ return "[MaxDepth]";
251
+ }
252
+ if (cycleList?.includes(value) === true) {
253
+ return "[Circular]";
254
+ }
255
+ switch (typeof value) {
256
+ case "string":
257
+ case "boolean":
258
+ case "number": {
259
+ return value;
260
+ }
261
+ case "object": {
262
+ if (value === null) {
263
+ return null;
264
+ }
265
+ const newCycleList = cycleList ?? [];
266
+ newCycleList.push(value);
267
+ if (Array.isArray(value)) {
268
+ return toSafeJsonArray(value, newCycleList, maxDepth - 1);
269
+ }
270
+ return toSafeJsonObject(value, newCycleList, maxDepth - 1);
271
+ }
272
+ default: {
273
+ return `[${typeof value}]`;
274
+ }
275
+ }
276
+ };
277
+ var toSafeJsonString = (value, maxDepth = 3) => {
278
+ return JSON.stringify(toSafeJson(value, maxDepth), null, 2);
279
+ };
280
+ var toSafeJson = (value, maxDepth = 3) => {
281
+ return toSafeJsonValue(value, void 0, maxDepth);
282
+ };
283
+
284
+ // src/Validator.ts
285
+ var ValidatorBase = class extends ObjectWrapper {
286
+ };
287
+
288
+ // src/index-un-deprecated.ts
289
+ export * from "../../object-model/neutral/index.mjs";
290
+ export {
291
+ AsObjectFactory,
292
+ AsTypeFactory,
293
+ IsObjectFactory,
294
+ JsonObjectZod,
295
+ ObjectWrapper,
296
+ ValidatorBase,
297
+ asAnyObject,
298
+ asJsonArray,
299
+ asJsonObject,
300
+ asJsonValue,
301
+ createDeepMerge,
302
+ deepMerge,
303
+ isJsonArray,
304
+ isJsonObject,
305
+ isJsonValue,
306
+ omitBy,
307
+ omitByPrefix,
308
+ pickBy,
309
+ pickByPrefix,
310
+ removeFields,
311
+ toJsonArray,
312
+ toJsonObject,
313
+ toJsonValue,
314
+ toSafeJson,
315
+ toSafeJsonArray,
316
+ toSafeJsonObject,
317
+ toSafeJsonString,
318
+ toSafeJsonValue
319
+ };
320
+ //# sourceMappingURL=index-un-deprecated.mjs.map
@@ -0,0 +1,3 @@
1
+ export * from './index-deprecated.ts';
2
+ export * from './index-un-deprecated.ts';
3
+ //# sourceMappingURL=index.d.ts.map