@gtkx/utils 1.0.0-rc.3 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/README.md +8 -9
  2. package/dist/array/index-before-or-end.d.ts +0 -12
  3. package/dist/array/index-before-or-end.d.ts.map +1 -1
  4. package/dist/array/index-before-or-end.js +0 -12
  5. package/dist/array/index-before-or-end.js.map +1 -1
  6. package/dist/array/index.d.ts +5 -5
  7. package/dist/array/index.js.map +1 -1
  8. package/dist/array/remove.d.ts +0 -11
  9. package/dist/array/remove.d.ts.map +1 -1
  10. package/dist/array/remove.js +0 -11
  11. package/dist/array/remove.js.map +1 -1
  12. package/dist/array/sort-strings-by.d.ts +0 -12
  13. package/dist/array/sort-strings-by.d.ts.map +1 -1
  14. package/dist/array/sort-strings-by.js +0 -12
  15. package/dist/array/sort-strings-by.js.map +1 -1
  16. package/dist/array/sort-strings.d.ts +0 -9
  17. package/dist/array/sort-strings.d.ts.map +1 -1
  18. package/dist/array/sort-strings.js +0 -9
  19. package/dist/array/sort-strings.js.map +1 -1
  20. package/dist/array/uniq-by.d.ts +0 -15
  21. package/dist/array/uniq-by.d.ts.map +1 -1
  22. package/dist/array/uniq-by.js +0 -15
  23. package/dist/array/uniq-by.js.map +1 -1
  24. package/dist/class/any-class.d.ts +2 -3
  25. package/dist/class/any-class.d.ts.map +1 -1
  26. package/dist/class/any-class.js.map +1 -1
  27. package/dist/class/get-parent-class.d.ts +1 -7
  28. package/dist/class/get-parent-class.d.ts.map +1 -1
  29. package/dist/class/get-parent-class.js +0 -6
  30. package/dist/class/get-parent-class.js.map +1 -1
  31. package/dist/class/index.d.ts +3 -3
  32. package/dist/class/index.js.map +1 -1
  33. package/dist/class/walk-class-chain.d.ts +1 -10
  34. package/dist/class/walk-class-chain.d.ts.map +1 -1
  35. package/dist/class/walk-class-chain.js +0 -9
  36. package/dist/class/walk-class-chain.js.map +1 -1
  37. package/dist/error/error-like.js.map +1 -1
  38. package/dist/error/error-message.d.ts +0 -10
  39. package/dist/error/error-message.d.ts.map +1 -1
  40. package/dist/error/error-message.js +0 -10
  41. package/dist/error/error-message.js.map +1 -1
  42. package/dist/error/format-child-process-error.d.ts +0 -9
  43. package/dist/error/format-child-process-error.d.ts.map +1 -1
  44. package/dist/error/format-child-process-error.js +0 -9
  45. package/dist/error/format-child-process-error.js.map +1 -1
  46. package/dist/error/index.d.ts +3 -3
  47. package/dist/error/index.js.map +1 -1
  48. package/dist/error/normalize-error.d.ts +0 -10
  49. package/dist/error/normalize-error.d.ts.map +1 -1
  50. package/dist/error/normalize-error.js +0 -10
  51. package/dist/error/normalize-error.js.map +1 -1
  52. package/dist/index.d.ts +12 -13
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +0 -1
  55. package/dist/index.js.map +1 -1
  56. package/dist/log/create-logger.d.ts +1 -12
  57. package/dist/log/create-logger.d.ts.map +1 -1
  58. package/dist/log/create-logger.js +0 -11
  59. package/dist/log/create-logger.js.map +1 -1
  60. package/dist/log/default-logger.d.ts +4 -30
  61. package/dist/log/default-logger.d.ts.map +1 -1
  62. package/dist/log/default-logger.js +3 -29
  63. package/dist/log/default-logger.js.map +1 -1
  64. package/dist/log/index.d.ts +5 -3
  65. package/dist/log/index.d.ts.map +1 -1
  66. package/dist/log/index.js +3 -1
  67. package/dist/log/index.js.map +1 -1
  68. package/dist/log/logger.d.ts +2 -43
  69. package/dist/log/logger.d.ts.map +1 -1
  70. package/dist/log/logger.js +3 -34
  71. package/dist/log/logger.js.map +1 -1
  72. package/dist/map/get-or-insert.d.ts +1 -16
  73. package/dist/map/get-or-insert.d.ts.map +1 -1
  74. package/dist/map/get-or-insert.js +0 -15
  75. package/dist/map/get-or-insert.js.map +1 -1
  76. package/dist/map/index.d.ts +1 -1
  77. package/dist/map/index.js.map +1 -1
  78. package/dist/object/index.d.ts +3 -3
  79. package/dist/object/index.js.map +1 -1
  80. package/dist/object/omit.d.ts +0 -12
  81. package/dist/object/omit.d.ts.map +1 -1
  82. package/dist/object/omit.js +0 -12
  83. package/dist/object/omit.js.map +1 -1
  84. package/dist/object/pick-by.d.ts +0 -12
  85. package/dist/object/pick-by.d.ts.map +1 -1
  86. package/dist/object/pick-by.js +0 -12
  87. package/dist/object/pick-by.js.map +1 -1
  88. package/dist/object/structured-clone.d.ts +0 -16
  89. package/dist/object/structured-clone.d.ts.map +1 -1
  90. package/dist/object/structured-clone.js +0 -16
  91. package/dist/object/structured-clone.js.map +1 -1
  92. package/dist/predicate/index.d.ts +6 -6
  93. package/dist/predicate/index.js.map +1 -1
  94. package/dist/predicate/is-deep-equal.d.ts.map +1 -1
  95. package/dist/predicate/is-deep-equal.js +0 -13
  96. package/dist/predicate/is-deep-equal.js.map +1 -1
  97. package/dist/predicate/is-plain-object.d.ts +0 -14
  98. package/dist/predicate/is-plain-object.d.ts.map +1 -1
  99. package/dist/predicate/is-plain-object.js +0 -14
  100. package/dist/predicate/is-plain-object.js.map +1 -1
  101. package/dist/predicate/is-record.d.ts +0 -11
  102. package/dist/predicate/is-record.d.ts.map +1 -1
  103. package/dist/predicate/is-record.js +0 -11
  104. package/dist/predicate/is-record.js.map +1 -1
  105. package/dist/predicate/is-same-array-by.d.ts +0 -12
  106. package/dist/predicate/is-same-array-by.d.ts.map +1 -1
  107. package/dist/predicate/is-same-array-by.js +0 -12
  108. package/dist/predicate/is-same-array-by.js.map +1 -1
  109. package/dist/predicate/is-same-array.d.ts +0 -12
  110. package/dist/predicate/is-same-array.d.ts.map +1 -1
  111. package/dist/predicate/is-same-array.js +0 -12
  112. package/dist/predicate/is-same-array.js.map +1 -1
  113. package/dist/predicate/is-shallow-equal.d.ts.map +1 -1
  114. package/dist/predicate/is-shallow-equal.js +0 -14
  115. package/dist/predicate/is-shallow-equal.js.map +1 -1
  116. package/dist/process/exit-code-for-signal.d.ts +0 -11
  117. package/dist/process/exit-code-for-signal.d.ts.map +1 -1
  118. package/dist/process/exit-code-for-signal.js +0 -11
  119. package/dist/process/exit-code-for-signal.js.map +1 -1
  120. package/dist/process/index.d.ts +4 -3
  121. package/dist/process/index.d.ts.map +1 -1
  122. package/dist/process/index.js +2 -1
  123. package/dist/process/index.js.map +1 -1
  124. package/dist/process/install-graceful-shutdown.d.ts +1 -7
  125. package/dist/process/install-graceful-shutdown.d.ts.map +1 -1
  126. package/dist/process/install-graceful-shutdown.js +7 -13
  127. package/dist/process/install-graceful-shutdown.js.map +1 -1
  128. package/dist/process/kill-marked-processes.d.ts +4 -0
  129. package/dist/process/kill-marked-processes.d.ts.map +1 -0
  130. package/dist/process/kill-marked-processes.js +38 -0
  131. package/dist/process/kill-marked-processes.js.map +1 -0
  132. package/dist/process/process-guard.d.ts +2 -0
  133. package/dist/process/process-guard.d.ts.map +1 -0
  134. package/dist/process/process-guard.js +16 -0
  135. package/dist/process/process-guard.js.map +1 -0
  136. package/dist/process/resolve-executable.d.ts +2 -12
  137. package/dist/process/resolve-executable.d.ts.map +1 -1
  138. package/dist/process/resolve-executable.js +6 -14
  139. package/dist/process/resolve-executable.js.map +1 -1
  140. package/dist/process/spawn-with-parent-death-signal.d.ts +8 -0
  141. package/dist/process/spawn-with-parent-death-signal.d.ts.map +1 -0
  142. package/dist/process/spawn-with-parent-death-signal.js +50 -0
  143. package/dist/process/spawn-with-parent-death-signal.js.map +1 -0
  144. package/dist/set/drain.d.ts +0 -8
  145. package/dist/set/drain.d.ts.map +1 -1
  146. package/dist/set/drain.js +0 -8
  147. package/dist/set/drain.js.map +1 -1
  148. package/dist/set/index.d.ts +1 -1
  149. package/dist/set/index.js.map +1 -1
  150. package/dist/source/index.d.ts +3 -3
  151. package/dist/source/index.js.map +1 -1
  152. package/dist/source/sanitize-identifier.d.ts +0 -11
  153. package/dist/source/sanitize-identifier.d.ts.map +1 -1
  154. package/dist/source/sanitize-identifier.js +0 -11
  155. package/dist/source/sanitize-identifier.js.map +1 -1
  156. package/dist/source/source-string-literal.d.ts +0 -10
  157. package/dist/source/source-string-literal.d.ts.map +1 -1
  158. package/dist/source/source-string-literal.js +0 -10
  159. package/dist/source/source-string-literal.js.map +1 -1
  160. package/dist/source/to-camel-identifier.d.ts +0 -10
  161. package/dist/source/to-camel-identifier.d.ts.map +1 -1
  162. package/dist/source/to-camel-identifier.js +0 -10
  163. package/dist/source/to-camel-identifier.js.map +1 -1
  164. package/dist/string/camel-case.d.ts +0 -14
  165. package/dist/string/camel-case.d.ts.map +1 -1
  166. package/dist/string/camel-case.js +0 -14
  167. package/dist/string/camel-case.js.map +1 -1
  168. package/dist/string/index.d.ts +5 -5
  169. package/dist/string/index.js.map +1 -1
  170. package/dist/string/kebab-case.d.ts +0 -11
  171. package/dist/string/kebab-case.d.ts.map +1 -1
  172. package/dist/string/kebab-case.js +0 -11
  173. package/dist/string/kebab-case.js.map +1 -1
  174. package/dist/string/lower-first.d.ts +0 -10
  175. package/dist/string/lower-first.d.ts.map +1 -1
  176. package/dist/string/lower-first.js +0 -10
  177. package/dist/string/lower-first.js.map +1 -1
  178. package/dist/string/pascal-case.d.ts +0 -13
  179. package/dist/string/pascal-case.d.ts.map +1 -1
  180. package/dist/string/pascal-case.js +0 -13
  181. package/dist/string/pascal-case.js.map +1 -1
  182. package/dist/string/upper-first.d.ts +0 -10
  183. package/dist/string/upper-first.d.ts.map +1 -1
  184. package/dist/string/upper-first.js +0 -10
  185. package/dist/string/upper-first.js.map +1 -1
  186. package/dist/util/index.d.ts +1 -1
  187. package/dist/util/index.js.map +1 -1
  188. package/dist/util/package-version.d.ts +1 -10
  189. package/dist/util/package-version.d.ts.map +1 -1
  190. package/dist/util/package-version.js +2 -11
  191. package/dist/util/package-version.js.map +1 -1
  192. package/package.json +1 -1
  193. package/src/array/index-before-or-end.ts +0 -12
  194. package/src/array/index.ts +5 -5
  195. package/src/array/remove.ts +0 -11
  196. package/src/array/sort-strings-by.ts +0 -12
  197. package/src/array/sort-strings.ts +0 -9
  198. package/src/array/uniq-by.ts +0 -15
  199. package/src/class/any-class.ts +2 -3
  200. package/src/class/get-parent-class.ts +1 -7
  201. package/src/class/index.ts +3 -3
  202. package/src/class/walk-class-chain.ts +2 -11
  203. package/src/error/error-like.ts +1 -1
  204. package/src/error/error-message.ts +1 -11
  205. package/src/error/format-child-process-error.ts +2 -11
  206. package/src/error/index.ts +3 -3
  207. package/src/error/normalize-error.ts +2 -12
  208. package/src/index.ts +12 -13
  209. package/src/log/create-logger.ts +1 -12
  210. package/src/log/default-logger.ts +4 -30
  211. package/src/log/index.ts +5 -3
  212. package/src/log/logger.ts +4 -45
  213. package/src/map/get-or-insert.ts +1 -16
  214. package/src/map/index.ts +1 -1
  215. package/src/object/index.ts +3 -3
  216. package/src/object/omit.ts +0 -12
  217. package/src/object/pick-by.ts +0 -12
  218. package/src/object/structured-clone.ts +1 -17
  219. package/src/predicate/index.ts +6 -6
  220. package/src/predicate/is-deep-equal.ts +2 -15
  221. package/src/predicate/is-plain-object.ts +0 -14
  222. package/src/predicate/is-record.ts +0 -11
  223. package/src/predicate/is-same-array-by.ts +0 -12
  224. package/src/predicate/is-same-array.ts +1 -13
  225. package/src/predicate/is-shallow-equal.ts +2 -16
  226. package/src/process/exit-code-for-signal.ts +0 -11
  227. package/src/process/index.ts +4 -3
  228. package/src/process/install-graceful-shutdown.ts +12 -18
  229. package/src/process/kill-marked-processes.ts +44 -0
  230. package/src/process/process-guard.ts +20 -0
  231. package/src/process/resolve-executable.ts +7 -14
  232. package/src/process/spawn-with-parent-death-signal.ts +74 -0
  233. package/src/set/drain.ts +0 -8
  234. package/src/set/index.ts +1 -1
  235. package/src/source/index.ts +3 -3
  236. package/src/source/sanitize-identifier.ts +0 -11
  237. package/src/source/source-string-literal.ts +0 -10
  238. package/src/source/to-camel-identifier.ts +2 -12
  239. package/src/string/camel-case.ts +2 -16
  240. package/src/string/index.ts +5 -5
  241. package/src/string/kebab-case.ts +0 -11
  242. package/src/string/lower-first.ts +0 -10
  243. package/src/string/pascal-case.ts +2 -15
  244. package/src/string/upper-first.ts +0 -10
  245. package/src/util/index.ts +1 -1
  246. package/src/util/package-version.ts +2 -11
  247. package/dist/function/call-method.d.ts +0 -3
  248. package/dist/function/call-method.d.ts.map +0 -1
  249. package/dist/function/call-method.js +0 -19
  250. package/dist/function/call-method.js.map +0 -1
  251. package/dist/function/index.d.ts +0 -2
  252. package/dist/function/index.d.ts.map +0 -1
  253. package/dist/function/index.js +0 -2
  254. package/dist/function/index.js.map +0 -1
  255. package/src/function/call-method.ts +0 -22
  256. package/src/function/index.ts +0 -1
package/README.md CHANGED
@@ -6,7 +6,8 @@
6
6
 
7
7
  <p align="center">
8
8
  The React framework for Linux.<br />
9
- Build GTK4 and Adwaita apps in TypeScript, with React components and hooks driving GNOME's own widgets. What you ship is a GNOME app.
9
+ Write native Linux applications with React and TypeScript.
10
+ Built on the GNOME stack and standard web tooling.
10
11
  </p>
11
12
 
12
13
  <p align="center">
@@ -20,15 +21,13 @@
20
21
 
21
22
  <p align="center">
22
23
  <a href="https://gtkx.dev">Homepage</a> &middot;
23
- <a href="https://gtkx.dev/guide/why-gtkx">Documentation</a> &middot;
24
+ <a href="https://gtkx.dev/guide/getting-started">Documentation</a> &middot;
24
25
  <a href="https://github.com/gtkx-org/gtkx/tree/main/examples">Examples</a> &middot;
25
26
  <a href="https://github.com/gtkx-org/gtkx/blob/main/CONTRIBUTING.md">Contributing</a>
26
27
  </p>
27
28
 
28
29
  ---
29
30
 
30
- GTKX generates fully typed bindings for the entire GTK4 and Adwaita surface directly from GObject-Introspection. On top of those bindings you get the React programming model: components and hooks driving GObject instances, with Fast Refresh while you develop.
31
-
32
31
  <p align="center">
33
32
  <img src="https://raw.githubusercontent.com/gtkx-org/gtkx/main/examples/tutorial/assets/screenshot.png" alt="The Tasks app: an Adwaita window with a sidebar of smart views and colored lists on the left, and a boxed task list on the right." />
34
33
  </p>
@@ -109,7 +108,7 @@ React Native and similar frameworks hide the native toolkit so one API can run e
109
108
 
110
109
  ### Why Node.js, and why generated bindings
111
110
 
112
- GTKX runs on Node.js, which puts native modules, the npm ecosystem, and the tooling built for Node.js APIs within reach. GJS is GNOME's own runtime, built on SpiderMonkey rather than V8; node-gtk runs on Node.js but is lightly maintained, on the older nan/V8 ABI rather than N-API, and still centered on GTK3. The [why-gtkx guide](https://gtkx.dev/guide/why-gtkx) covers the comparison in full.
111
+ GTKX runs on Node.js, which puts native modules, the npm ecosystem, and the tooling built for Node.js APIs within reach. GJS is GNOME's own runtime, built on SpiderMonkey rather than V8; node-gtk runs on Node.js but is lightly maintained, on the older nan/V8 ABI rather than N-API, and still centered on GTK3. The [Why GTKX guide](https://gtkx.dev/guide/why-gtkx) covers what running on Node.js means day to day.
113
112
 
114
113
  GTKX generates the TypeScript types and the native FFI calls from the same GObject-Introspection data, so the types cannot drift from the calls they back. Codegen covers the whole GTK4 and Adwaita surface.
115
114
 
@@ -122,10 +121,10 @@ GTKX is Linux-only and needs Node.js 24 or later. See [Requirements](#requiremen
122
121
  Scaffold a new app with the `create-gtkx` initializer:
123
122
 
124
123
  ```sh
125
- npm create gtkx@rc
124
+ npm create gtkx
126
125
  ```
127
126
 
128
- The same command works with other package managers: `pnpm create gtkx@rc` or `yarn create gtkx@rc`.
127
+ The same command works with other package managers: `pnpm create gtkx` or `yarn create gtkx`.
129
128
 
130
129
  Then run your new app:
131
130
 
@@ -146,7 +145,7 @@ The documentation at **[gtkx.dev](https://gtkx.dev)** includes a step-by-step tu
146
145
 
147
146
  GTKX is Linux-only. You need:
148
147
 
149
- - Linux with the GTK4 (4.20 or later), Adwaita (1.8 or later), and GLib development libraries
148
+ - Linux with the GTK4 (4.20 or later) and GLib development libraries, plus Adwaita (1.8 or later) once your project binds `Adw-1`
150
149
  - Node.js 24 or later
151
150
 
152
151
  The `@gtkx/native` addon ships prebuilt for x64 and arm64 glibc Linux; other targets need to build it from the GTKX repository, which requires a Rust toolchain.
@@ -162,7 +161,7 @@ Explore the [example apps](https://github.com/gtkx-org/gtkx/tree/main/examples):
162
161
 
163
162
  ## Status
164
163
 
165
- GTKX 1.0 is at the release candidate stage.
164
+ GTKX 1.0 is released.
166
165
 
167
166
  ## Contributing
168
167
 
@@ -1,15 +1,3 @@
1
- /**
2
- * Finds the index of the first item matching `before`, or `list.length` when `before` is `null` or
3
- * nothing matches. Use it to resolve where a new item should be inserted so it lands before the
4
- * referenced one, defaulting to the end.
5
- *
6
- * @template T - The list item type.
7
- * @template B - The reference value type.
8
- * @param list - The list to search.
9
- * @param before - The item to insert before, or `null` to target the end.
10
- * @param isMatch - Called with each item and the non-null `before`; return `true` on a match.
11
- * @returns The matched index, or `list.length`.
12
- */
13
1
  declare const indexBeforeOrEnd: <T, B>(list: T[], before: B | null, isMatch: (item: T, before: B) => boolean) => number;
14
2
  export { indexBeforeOrEnd };
15
3
  //# sourceMappingURL=index-before-or-end.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-before-or-end.d.ts","sourceRoot":"","sources":["../../src/array/index-before-or-end.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,gBAAgB,GAAI,CAAC,EAAE,CAAC,EAC1B,MAAM,CAAC,EAAE,EACT,QAAQ,CAAC,GAAG,IAAI,EAChB,SAAS,CAAC,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,KAAK,OAAO,KACzC,MAQF,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"index-before-or-end.d.ts","sourceRoot":"","sources":["../../src/array/index-before-or-end.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,gBAAgB,GAAI,CAAC,EAAE,CAAC,EAC1B,MAAM,CAAC,EAAE,EACT,QAAQ,CAAC,GAAG,IAAI,EAChB,SAAS,CAAC,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,KAAK,OAAO,KACzC,MAQF,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,15 +1,3 @@
1
- /**
2
- * Finds the index of the first item matching `before`, or `list.length` when `before` is `null` or
3
- * nothing matches. Use it to resolve where a new item should be inserted so it lands before the
4
- * referenced one, defaulting to the end.
5
- *
6
- * @template T - The list item type.
7
- * @template B - The reference value type.
8
- * @param list - The list to search.
9
- * @param before - The item to insert before, or `null` to target the end.
10
- * @param isMatch - Called with each item and the non-null `before`; return `true` on a match.
11
- * @returns The matched index, or `list.length`.
12
- */
13
1
  const indexBeforeOrEnd = (list, before, isMatch) => {
14
2
  if (before === null) {
15
3
  return list.length;
@@ -1 +1 @@
1
- {"version":3,"file":"index-before-or-end.js","sourceRoot":"","sources":["../../src/array/index-before-or-end.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,gBAAgB,GAAG,CACrB,IAAS,EACT,MAAgB,EAChB,OAAwC,EAClC,EAAE;IACR,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAE9D,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;AAC9C,CAAC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC","sourcesContent":["/**\n * Finds the index of the first item matching `before`, or `list.length` when `before` is `null` or\n * nothing matches. Use it to resolve where a new item should be inserted so it lands before the\n * referenced one, defaulting to the end.\n *\n * @template T - The list item type.\n * @template B - The reference value type.\n * @param list - The list to search.\n * @param before - The item to insert before, or `null` to target the end.\n * @param isMatch - Called with each item and the non-null `before`; return `true` on a match.\n * @returns The matched index, or `list.length`.\n */\nconst indexBeforeOrEnd = <T, B>(\n list: T[],\n before: B | null,\n isMatch: (item: T, before: B) => boolean,\n): number => {\n if (before === null) {\n return list.length;\n }\n\n const index = list.findIndex((item) => isMatch(item, before));\n\n return index === -1 ? list.length : index;\n};\n\nexport { indexBeforeOrEnd };\n"]}
1
+ {"version":3,"file":"index-before-or-end.js","sourceRoot":"","sources":["../../src/array/index-before-or-end.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG,CACrB,IAAS,EACT,MAAgB,EAChB,OAAwC,EAClC,EAAE;IACR,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAE9D,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;AAC9C,CAAC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC","sourcesContent":["const indexBeforeOrEnd = <T, B>(\n list: T[],\n before: B | null,\n isMatch: (item: T, before: B) => boolean,\n): number => {\n if (before === null) {\n return list.length;\n }\n\n const index = list.findIndex((item) => isMatch(item, before));\n\n return index === -1 ? list.length : index;\n};\n\nexport { indexBeforeOrEnd };\n"]}
@@ -1,6 +1,6 @@
1
- export { indexBeforeOrEnd } from "./index-before-or-end.js";
2
- export { remove } from "./remove.js";
3
- export { sortStringsBy } from "./sort-strings-by.js";
4
- export { sortStrings } from "./sort-strings.js";
5
- export { uniqBy } from "./uniq-by.js";
1
+ export { indexBeforeOrEnd } from "./index-before-or-end.ts";
2
+ export { remove } from "./remove.ts";
3
+ export { sortStringsBy } from "./sort-strings-by.ts";
4
+ export { sortStrings } from "./sort-strings.ts";
5
+ export { uniqBy } from "./uniq-by.ts";
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/array/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { indexBeforeOrEnd } from \"./index-before-or-end.js\";\nexport { remove } from \"./remove.js\";\nexport { sortStringsBy } from \"./sort-strings-by.js\";\nexport { sortStrings } from \"./sort-strings.js\";\nexport { uniqBy } from \"./uniq-by.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/array/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { indexBeforeOrEnd } from \"./index-before-or-end.ts\";\nexport { remove } from \"./remove.ts\";\nexport { sortStringsBy } from \"./sort-strings-by.ts\";\nexport { sortStrings } from \"./sort-strings.ts\";\nexport { uniqBy } from \"./uniq-by.ts\";\n"]}
@@ -1,14 +1,3 @@
1
- /**
2
- * Removes the first strictly-equal (`===`) occurrence of `value` from `arr` in place.
3
- *
4
- * @template T - The type of the array elements.
5
- * @param arr - The array to mutate.
6
- * @param value - The value to remove.
7
- *
8
- * @example
9
- * const items = ["a", "b", "c"];
10
- * remove(items, "b"); // items is now ["a", "c"]
11
- */
12
1
  declare function remove<T>(arr: T[], value: T): void;
13
2
  export { remove };
14
3
  //# sourceMappingURL=remove.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../src/array/remove.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,iBAAS,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAM3C;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../src/array/remove.ts"],"names":[],"mappings":"AAAA,iBAAS,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAM3C;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1,14 +1,3 @@
1
- /**
2
- * Removes the first strictly-equal (`===`) occurrence of `value` from `arr` in place.
3
- *
4
- * @template T - The type of the array elements.
5
- * @param arr - The array to mutate.
6
- * @param value - The value to remove.
7
- *
8
- * @example
9
- * const items = ["a", "b", "c"];
10
- * remove(items, "b"); // items is now ["a", "c"]
11
- */
12
1
  function remove(arr, value) {
13
2
  const index = arr.indexOf(value);
14
3
  if (index !== -1) {
@@ -1 +1 @@
1
- {"version":3,"file":"remove.js","sourceRoot":"","sources":["../../src/array/remove.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,SAAS,MAAM,CAAI,GAAQ,EAAE,KAAQ;IACjC,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAEjC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;QACf,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACzB,CAAC;AACL,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,CAAC","sourcesContent":["/**\n * Removes the first strictly-equal (`===`) occurrence of `value` from `arr` in place.\n *\n * @template T - The type of the array elements.\n * @param arr - The array to mutate.\n * @param value - The value to remove.\n *\n * @example\n * const items = [\"a\", \"b\", \"c\"];\n * remove(items, \"b\"); // items is now [\"a\", \"c\"]\n */\nfunction remove<T>(arr: T[], value: T): void {\n const index = arr.indexOf(value);\n\n if (index !== -1) {\n arr.splice(index, 1);\n }\n}\n\nexport { remove };\n"]}
1
+ {"version":3,"file":"remove.js","sourceRoot":"","sources":["../../src/array/remove.ts"],"names":[],"mappings":"AAAA,SAAS,MAAM,CAAI,GAAQ,EAAE,KAAQ;IACjC,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAEjC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;QACf,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACzB,CAAC;AACL,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,CAAC","sourcesContent":["function remove<T>(arr: T[], value: T): void {\n const index = arr.indexOf(value);\n\n if (index !== -1) {\n arr.splice(index, 1);\n }\n}\n\nexport { remove };\n"]}
@@ -1,15 +1,3 @@
1
- /**
2
- * Returns the items sorted by a string key using locale-aware comparison.
3
- *
4
- * @template T - The type of items being sorted.
5
- * @param items - The items to sort.
6
- * @param key - Maps an item to the string its order is decided by.
7
- * @returns A new array of the items in ascending locale order of their keys.
8
- *
9
- * @example
10
- * sortStringsBy([{ name: "b" }, { name: "a" }], (item) => item.name);
11
- * // [{ name: "a" }, { name: "b" }]
12
- */
13
1
  declare function sortStringsBy<T>(items: Iterable<T>, key: (item: T) => string): T[];
14
2
  export { sortStringsBy };
15
3
  //# sourceMappingURL=sort-strings-by.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sort-strings-by.d.ts","sourceRoot":"","sources":["../../src/array/sort-strings-by.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,iBAAS,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,CAAC,EAAE,CAE3E;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"sort-strings-by.d.ts","sourceRoot":"","sources":["../../src/array/sort-strings-by.ts"],"names":[],"mappings":"AAAA,iBAAS,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,CAAC,EAAE,CAE3E;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1,15 +1,3 @@
1
- /**
2
- * Returns the items sorted by a string key using locale-aware comparison.
3
- *
4
- * @template T - The type of items being sorted.
5
- * @param items - The items to sort.
6
- * @param key - Maps an item to the string its order is decided by.
7
- * @returns A new array of the items in ascending locale order of their keys.
8
- *
9
- * @example
10
- * sortStringsBy([{ name: "b" }, { name: "a" }], (item) => item.name);
11
- * // [{ name: "a" }, { name: "b" }]
12
- */
13
1
  function sortStringsBy(items, key) {
14
2
  return [...items].toSorted((a, b) => key(a).localeCompare(key(b)));
15
3
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sort-strings-by.js","sourceRoot":"","sources":["../../src/array/sort-strings-by.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,SAAS,aAAa,CAAI,KAAkB,EAAE,GAAwB;IAClE,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,CAAC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["/**\n * Returns the items sorted by a string key using locale-aware comparison.\n *\n * @template T - The type of items being sorted.\n * @param items - The items to sort.\n * @param key - Maps an item to the string its order is decided by.\n * @returns A new array of the items in ascending locale order of their keys.\n *\n * @example\n * sortStringsBy([{ name: \"b\" }, { name: \"a\" }], (item) => item.name);\n * // [{ name: \"a\" }, { name: \"b\" }]\n */\nfunction sortStringsBy<T>(items: Iterable<T>, key: (item: T) => string): T[] {\n return [...items].toSorted((a, b) => key(a).localeCompare(key(b)));\n}\n\nexport { sortStringsBy };\n"]}
1
+ {"version":3,"file":"sort-strings-by.js","sourceRoot":"","sources":["../../src/array/sort-strings-by.ts"],"names":[],"mappings":"AAAA,SAAS,aAAa,CAAI,KAAkB,EAAE,GAAwB;IAClE,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,CAAC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["function sortStringsBy<T>(items: Iterable<T>, key: (item: T) => string): T[] {\n return [...items].toSorted((a, b) => key(a).localeCompare(key(b)));\n}\n\nexport { sortStringsBy };\n"]}
@@ -1,12 +1,3 @@
1
- /**
2
- * Returns the values sorted as strings using locale-aware comparison.
3
- *
4
- * @param values - The strings to sort.
5
- * @returns A new array of the values in ascending locale order.
6
- *
7
- * @example
8
- * sortStrings(["b", "a", "c"]); // ["a", "b", "c"]
9
- */
10
1
  declare function sortStrings(values: Iterable<string>): string[];
11
2
  export { sortStrings };
12
3
  //# sourceMappingURL=sort-strings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sort-strings.d.ts","sourceRoot":"","sources":["../../src/array/sort-strings.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,iBAAS,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAEvD;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"sort-strings.d.ts","sourceRoot":"","sources":["../../src/array/sort-strings.ts"],"names":[],"mappings":"AAAA,iBAAS,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAEvD;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -1,12 +1,3 @@
1
- /**
2
- * Returns the values sorted as strings using locale-aware comparison.
3
- *
4
- * @param values - The strings to sort.
5
- * @returns A new array of the values in ascending locale order.
6
- *
7
- * @example
8
- * sortStrings(["b", "a", "c"]); // ["a", "b", "c"]
9
- */
10
1
  function sortStrings(values) {
11
2
  return [...values].toSorted((a, b) => a.localeCompare(b));
12
3
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sort-strings.js","sourceRoot":"","sources":["../../src/array/sort-strings.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,SAAS,WAAW,CAAC,MAAwB;IACzC,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,CAAC","sourcesContent":["/**\n * Returns the values sorted as strings using locale-aware comparison.\n *\n * @param values - The strings to sort.\n * @returns A new array of the values in ascending locale order.\n *\n * @example\n * sortStrings([\"b\", \"a\", \"c\"]); // [\"a\", \"b\", \"c\"]\n */\nfunction sortStrings(values: Iterable<string>): string[] {\n return [...values].toSorted((a, b) => a.localeCompare(b));\n}\n\nexport { sortStrings };\n"]}
1
+ {"version":3,"file":"sort-strings.js","sourceRoot":"","sources":["../../src/array/sort-strings.ts"],"names":[],"mappings":"AAAA,SAAS,WAAW,CAAC,MAAwB;IACzC,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,CAAC","sourcesContent":["function sortStrings(values: Iterable<string>): string[] {\n return [...values].toSorted((a, b) => a.localeCompare(b));\n}\n\nexport { sortStrings };\n"]}
@@ -1,18 +1,3 @@
1
- /**
2
- * Returns a new array of the unique elements of `arr`, keyed by the value the `mapper` returns.
3
- *
4
- * When two elements map to the same key the first occurrence is kept and later ones discarded,
5
- * preserving first-seen order.
6
- *
7
- * @template T - The type of elements in the array.
8
- * @param arr - The array to deduplicate.
9
- * @param mapper - Maps an element to the key its uniqueness is decided by.
10
- * @returns A new array containing only the first element seen for each distinct key.
11
- *
12
- * @example
13
- * uniqBy([2.1, 1.2, 2.3], Math.floor); // [2.1, 1.2]
14
- * uniqBy([{ id: "a" }, { id: "a" }, { id: "b" }], (item) => item.id); // [{ id: "a" }, { id: "b" }]
15
- */
16
1
  declare function uniqBy<T>(arr: T[], mapper: (item: T, index: number, array: T[]) => unknown): T[];
17
2
  export { uniqBy };
18
3
  //# sourceMappingURL=uniq-by.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"uniq-by.d.ts","sourceRoot":"","sources":["../../src/array/uniq-by.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,iBAAS,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,OAAO,GAAG,CAAC,EAAE,CAezF;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"uniq-by.d.ts","sourceRoot":"","sources":["../../src/array/uniq-by.ts"],"names":[],"mappings":"AAAA,iBAAS,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,OAAO,GAAG,CAAC,EAAE,CAezF;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1,18 +1,3 @@
1
- /**
2
- * Returns a new array of the unique elements of `arr`, keyed by the value the `mapper` returns.
3
- *
4
- * When two elements map to the same key the first occurrence is kept and later ones discarded,
5
- * preserving first-seen order.
6
- *
7
- * @template T - The type of elements in the array.
8
- * @param arr - The array to deduplicate.
9
- * @param mapper - Maps an element to the key its uniqueness is decided by.
10
- * @returns A new array containing only the first element seen for each distinct key.
11
- *
12
- * @example
13
- * uniqBy([2.1, 1.2, 2.3], Math.floor); // [2.1, 1.2]
14
- * uniqBy([{ id: "a" }, { id: "a" }, { id: "b" }], (item) => item.id); // [{ id: "a" }, { id: "b" }]
15
- */
16
1
  function uniqBy(arr, mapper) {
17
2
  const seen = new Map();
18
3
  let index = 0;
@@ -1 +1 @@
1
- {"version":3,"file":"uniq-by.js","sourceRoot":"","sources":["../../src/array/uniq-by.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,SAAS,MAAM,CAAI,GAAQ,EAAE,MAAuD;IAChF,MAAM,IAAI,GAAoB,IAAI,GAAG,EAAE,CAAC;IACxC,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE,CAAC;QACrB,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QAErC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACjB,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACxB,CAAC;QAED,KAAK,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC;AACnC,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,CAAC","sourcesContent":["/**\n * Returns a new array of the unique elements of `arr`, keyed by the value the `mapper` returns.\n *\n * When two elements map to the same key the first occurrence is kept and later ones discarded,\n * preserving first-seen order.\n *\n * @template T - The type of elements in the array.\n * @param arr - The array to deduplicate.\n * @param mapper - Maps an element to the key its uniqueness is decided by.\n * @returns A new array containing only the first element seen for each distinct key.\n *\n * @example\n * uniqBy([2.1, 1.2, 2.3], Math.floor); // [2.1, 1.2]\n * uniqBy([{ id: \"a\" }, { id: \"a\" }, { id: \"b\" }], (item) => item.id); // [{ id: \"a\" }, { id: \"b\" }]\n */\nfunction uniqBy<T>(arr: T[], mapper: (item: T, index: number, array: T[]) => unknown): T[] {\n const seen: Map<unknown, T> = new Map();\n let index = 0;\n\n for (const item of arr) {\n const key = mapper(item, index, arr);\n\n if (!seen.has(key)) {\n seen.set(key, item);\n }\n\n index++;\n }\n\n return seen.values().toArray();\n}\n\nexport { uniqBy };\n"]}
1
+ {"version":3,"file":"uniq-by.js","sourceRoot":"","sources":["../../src/array/uniq-by.ts"],"names":[],"mappings":"AAAA,SAAS,MAAM,CAAI,GAAQ,EAAE,MAAuD;IAChF,MAAM,IAAI,GAAoB,IAAI,GAAG,EAAE,CAAC;IACxC,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE,CAAC;QACrB,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QAErC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACjB,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACxB,CAAC;QAED,KAAK,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC;AACnC,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,CAAC","sourcesContent":["function uniqBy<T>(arr: T[], mapper: (item: T, index: number, array: T[]) => unknown): T[] {\n const seen: Map<unknown, T> = new Map();\n let index = 0;\n\n for (const item of arr) {\n const key = mapper(item, index, arr);\n\n if (!seen.has(key)) {\n seen.set(key, item);\n }\n\n index++;\n }\n\n return seen.values().toArray();\n}\n\nexport { uniqBy };\n"]}
@@ -1,7 +1,6 @@
1
- /**
2
- * A constructor value of any (possibly abstract) class producing instances of `T`.
3
- */
1
+ /** Any class constructor, abstract ones included, whose instances are `T`. */
4
2
  type AnyClass<T extends object = object> = (abstract new (...args: never[]) => T) & {
3
+ /** Object the class's instances inherit from. */
5
4
  prototype: T;
6
5
  };
7
6
  export { type AnyClass };
@@ -1 +1 @@
1
- {"version":3,"file":"any-class.d.ts","sourceRoot":"","sources":["../../src/class/any-class.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,KAAK,QAAQ,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,MAChD,GAAG,IAAI,EAAE,KAAK,EAAE,KACf,CAAC,CAAC,GAAG;IACN,SAAS,EAAE,CAAC,CAAC;CAChB,CAAC;AAEF,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"any-class.d.ts","sourceRoot":"","sources":["../../src/class/any-class.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,KAAK,QAAQ,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,MAChD,GAAG,IAAI,EAAE,KAAK,EAAE,KACf,CAAC,CAAC,GAAG;IACN,iDAAiD;IACjD,SAAS,EAAE,CAAC,CAAC;CAChB,CAAC;AAEF,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"any-class.js","sourceRoot":"","sources":["../../src/class/any-class.ts"],"names":[],"mappings":"AASA,OAAO,EAAiB,CAAC","sourcesContent":["/**\n * A constructor value of any (possibly abstract) class producing instances of `T`.\n */\ntype AnyClass<T extends object = object> = (abstract new (\n ...args: never[]\n) => T) & {\n prototype: T;\n};\n\nexport { type AnyClass };\n"]}
1
+ {"version":3,"file":"any-class.js","sourceRoot":"","sources":["../../src/class/any-class.ts"],"names":[],"mappings":"AAQA,OAAO,EAAiB,CAAC","sourcesContent":["/** Any class constructor, abstract ones included, whose instances are `T`. */\ntype AnyClass<T extends object = object> = (abstract new (\n ...args: never[]\n) => T) & {\n /** Object the class's instances inherit from. */\n prototype: T;\n};\n\nexport { type AnyClass };\n"]}
@@ -1,10 +1,4 @@
1
- import type { AnyClass } from "./any-class.js";
2
- /**
3
- * Returns the direct superclass of `cls`, or `null` when it has no class ancestor.
4
- *
5
- * @param cls - The class whose prototype parent to inspect.
6
- * @returns The parent class, or `null` when there is none.
7
- */
1
+ import type { AnyClass } from "./any-class.ts";
8
2
  declare function getParentClass(cls: AnyClass): AnyClass | null;
9
3
  export { getParentClass };
10
4
  //# sourceMappingURL=get-parent-class.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-parent-class.d.ts","sourceRoot":"","sources":["../../src/class/get-parent-class.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;;;;GAKG;AACH,iBAAS,cAAc,CAAC,GAAG,EAAE,QAAQ,GAAG,QAAQ,GAAG,IAAI,CAItD;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"get-parent-class.d.ts","sourceRoot":"","sources":["../../src/class/get-parent-class.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,iBAAS,cAAc,CAAC,GAAG,EAAE,QAAQ,GAAG,QAAQ,GAAG,IAAI,CAItD;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -1,9 +1,3 @@
1
- /**
2
- * Returns the direct superclass of `cls`, or `null` when it has no class ancestor.
3
- *
4
- * @param cls - The class whose prototype parent to inspect.
5
- * @returns The parent class, or `null` when there is none.
6
- */
7
1
  function getParentClass(cls) {
8
2
  const parent = Object.getPrototypeOf(cls);
9
3
  return typeof parent === "function" && parent !== Function.prototype ? parent : null;
@@ -1 +1 @@
1
- {"version":3,"file":"get-parent-class.js","sourceRoot":"","sources":["../../src/class/get-parent-class.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,SAAS,cAAc,CAAC,GAAa;IACjC,MAAM,MAAM,GAAY,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IAEnD,OAAO,OAAO,MAAM,KAAK,UAAU,IAAI,MAAM,KAAK,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAE,MAAmB,CAAC,CAAC,CAAC,IAAI,CAAC;AACvG,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import type { AnyClass } from \"./any-class.js\";\n\n/**\n * Returns the direct superclass of `cls`, or `null` when it has no class ancestor.\n *\n * @param cls - The class whose prototype parent to inspect.\n * @returns The parent class, or `null` when there is none.\n */\nfunction getParentClass(cls: AnyClass): AnyClass | null {\n const parent: unknown = Object.getPrototypeOf(cls);\n\n return typeof parent === \"function\" && parent !== Function.prototype ? (parent as AnyClass) : null;\n}\n\nexport { getParentClass };\n"]}
1
+ {"version":3,"file":"get-parent-class.js","sourceRoot":"","sources":["../../src/class/get-parent-class.ts"],"names":[],"mappings":"AAEA,SAAS,cAAc,CAAC,GAAa;IACjC,MAAM,MAAM,GAAY,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IAEnD,OAAO,OAAO,MAAM,KAAK,UAAU,IAAI,MAAM,KAAK,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAE,MAAmB,CAAC,CAAC,CAAC,IAAI,CAAC;AACvG,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import type { AnyClass } from \"./any-class.ts\";\n\nfunction getParentClass(cls: AnyClass): AnyClass | null {\n const parent: unknown = Object.getPrototypeOf(cls);\n\n return typeof parent === \"function\" && parent !== Function.prototype ? (parent as AnyClass) : null;\n}\n\nexport { getParentClass };\n"]}
@@ -1,4 +1,4 @@
1
- export type { AnyClass } from "./any-class.js";
2
- export { getParentClass } from "./get-parent-class.js";
3
- export { walkClassChain } from "./walk-class-chain.js";
1
+ export type { AnyClass } from "./any-class.ts";
2
+ export { getParentClass } from "./get-parent-class.ts";
3
+ export { walkClassChain } from "./walk-class-chain.ts";
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/class/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["export type { AnyClass } from \"./any-class.js\";\nexport { getParentClass } from \"./get-parent-class.js\";\nexport { walkClassChain } from \"./walk-class-chain.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/class/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["export type { AnyClass } from \"./any-class.ts\";\nexport { getParentClass } from \"./get-parent-class.ts\";\nexport { walkClassChain } from \"./walk-class-chain.ts\";\n"]}
@@ -1,13 +1,4 @@
1
- import type { AnyClass } from "./any-class.js";
2
- /**
3
- * Walks the class chain from `cls` up through its ancestors, calling `visit` on each and returning
4
- * the first result that is not `undefined`.
5
- *
6
- * @template T - The type produced by the visitor.
7
- * @param cls - The class to start from, or `null` to visit nothing.
8
- * @param visit - Called with each class in the chain; a defined return value stops the walk.
9
- * @returns The first defined result from `visit`, or `undefined` when none was produced.
10
- */
1
+ import type { AnyClass } from "./any-class.ts";
11
2
  declare function walkClassChain<T>(cls: AnyClass | null, visit: (ancestor: AnyClass) => T | undefined): T | undefined;
12
3
  export { walkClassChain };
13
4
  //# sourceMappingURL=walk-class-chain.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"walk-class-chain.d.ts","sourceRoot":"","sources":["../../src/class/walk-class-chain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C;;;;;;;;GAQG;AACH,iBAAS,cAAc,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,CAAC,GAAG,SAAS,GAAG,CAAC,GAAG,SAAS,CAc5G;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"walk-class-chain.d.ts","sourceRoot":"","sources":["../../src/class/walk-class-chain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,iBAAS,cAAc,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,CAAC,GAAG,SAAS,GAAG,CAAC,GAAG,SAAS,CAc5G;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -1,13 +1,4 @@
1
1
  import { getParentClass } from "./get-parent-class.js";
2
- /**
3
- * Walks the class chain from `cls` up through its ancestors, calling `visit` on each and returning
4
- * the first result that is not `undefined`.
5
- *
6
- * @template T - The type produced by the visitor.
7
- * @param cls - The class to start from, or `null` to visit nothing.
8
- * @param visit - Called with each class in the chain; a defined return value stops the walk.
9
- * @returns The first defined result from `visit`, or `undefined` when none was produced.
10
- */
11
2
  function walkClassChain(cls, visit) {
12
3
  let current = cls;
13
4
  while (current !== null) {
@@ -1 +1 @@
1
- {"version":3,"file":"walk-class-chain.js","sourceRoot":"","sources":["../../src/class/walk-class-chain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;;;;;;GAQG;AACH,SAAS,cAAc,CAAI,GAAoB,EAAE,KAA4C;IACzF,IAAI,OAAO,GAAG,GAAG,CAAC;IAElB,OAAO,OAAO,KAAK,IAAI,EAAE,CAAC;QACtB,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QAE9B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,MAAM,CAAC;QAClB,CAAC;QAED,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import type { AnyClass } from \"./any-class.js\";\nimport { getParentClass } from \"./get-parent-class.js\";\n\n/**\n * Walks the class chain from `cls` up through its ancestors, calling `visit` on each and returning\n * the first result that is not `undefined`.\n *\n * @template T - The type produced by the visitor.\n * @param cls - The class to start from, or `null` to visit nothing.\n * @param visit - Called with each class in the chain; a defined return value stops the walk.\n * @returns The first defined result from `visit`, or `undefined` when none was produced.\n */\nfunction walkClassChain<T>(cls: AnyClass | null, visit: (ancestor: AnyClass) => T | undefined): T | undefined {\n let current = cls;\n\n while (current !== null) {\n const result = visit(current);\n\n if (result !== undefined) {\n return result;\n }\n\n current = getParentClass(current);\n }\n\n return undefined;\n}\n\nexport { walkClassChain };\n"]}
1
+ {"version":3,"file":"walk-class-chain.js","sourceRoot":"","sources":["../../src/class/walk-class-chain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,SAAS,cAAc,CAAI,GAAoB,EAAE,KAA4C;IACzF,IAAI,OAAO,GAAG,GAAG,CAAC;IAElB,OAAO,OAAO,KAAK,IAAI,EAAE,CAAC;QACtB,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QAE9B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,MAAM,CAAC;QAClB,CAAC;QAED,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import type { AnyClass } from \"./any-class.ts\";\nimport { getParentClass } from \"./get-parent-class.ts\";\n\nfunction walkClassChain<T>(cls: AnyClass | null, visit: (ancestor: AnyClass) => T | undefined): T | undefined {\n let current = cls;\n\n while (current !== null) {\n const result = visit(current);\n\n if (result !== undefined) {\n return result;\n }\n\n current = getParentClass(current);\n }\n\n return undefined;\n}\n\nexport { walkClassChain };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"error-like.js","sourceRoot":"","sources":["../../src/error/error-like.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,SAAS,WAAW,CAAC,KAAc;IAC/B,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,SAAS,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAAC;AACtF,CAAC;AAED,SAAS,UAAU,CAAC,KAAc;IAC9B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,IAAI,KAAK,YAAY,UAAU,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACxD,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC5B,CAAC;IAED,OAAO,EAAE,CAAC;AACd,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC","sourcesContent":["import { isRecord } from \"../predicate/is-record.js\";\n\nfunction isErrorLike(value: unknown): value is { message: string } {\n return isRecord(value) && \"message\" in value && typeof value.message === \"string\";\n}\n\nfunction readStream(value: unknown): string {\n if (typeof value === \"string\") {\n return value;\n }\n\n if (value instanceof Uint8Array || Buffer.isBuffer(value)) {\n return value.toString();\n }\n\n return \"\";\n}\n\nexport { isErrorLike, readStream };\n"]}
1
+ {"version":3,"file":"error-like.js","sourceRoot":"","sources":["../../src/error/error-like.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,SAAS,WAAW,CAAC,KAAc;IAC/B,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,SAAS,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAAC;AACtF,CAAC;AAED,SAAS,UAAU,CAAC,KAAc;IAC9B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,IAAI,KAAK,YAAY,UAAU,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACxD,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC5B,CAAC;IAED,OAAO,EAAE,CAAC;AACd,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC","sourcesContent":["import { isRecord } from \"../predicate/is-record.ts\";\n\nfunction isErrorLike(value: unknown): value is { message: string } {\n return isRecord(value) && \"message\" in value && typeof value.message === \"string\";\n}\n\nfunction readStream(value: unknown): string {\n if (typeof value === \"string\") {\n return value;\n }\n\n if (value instanceof Uint8Array || Buffer.isBuffer(value)) {\n return value.toString();\n }\n\n return \"\";\n}\n\nexport { isErrorLike, readStream };\n"]}
@@ -1,13 +1,3 @@
1
- /**
2
- * Extracts a human-readable message from an unknown thrown value, falling back to its string form.
3
- *
4
- * @param error - The caught value to describe.
5
- * @returns The value's message when it has one, otherwise its string form.
6
- *
7
- * @example
8
- * errorMessage(new Error("boom")); // "boom"
9
- * errorMessage(42); // "42"
10
- */
11
1
  declare function errorMessage(error: unknown): string;
12
2
  export { errorMessage };
13
3
  //# sourceMappingURL=error-message.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-message.d.ts","sourceRoot":"","sources":["../../src/error/error-message.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,iBAAS,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE5C;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"error-message.d.ts","sourceRoot":"","sources":["../../src/error/error-message.ts"],"names":[],"mappings":"AAEA,iBAAS,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE5C;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,14 +1,4 @@
1
1
  import { isErrorLike } from "./error-like.js";
2
- /**
3
- * Extracts a human-readable message from an unknown thrown value, falling back to its string form.
4
- *
5
- * @param error - The caught value to describe.
6
- * @returns The value's message when it has one, otherwise its string form.
7
- *
8
- * @example
9
- * errorMessage(new Error("boom")); // "boom"
10
- * errorMessage(42); // "42"
11
- */
12
2
  function errorMessage(error) {
13
3
  return Error.isError(error) || isErrorLike(error) ? error.message : String(error);
14
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"error-message.js","sourceRoot":"","sources":["../../src/error/error-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;;;;;;;GASG;AACH,SAAS,YAAY,CAAC,KAAc;IAChC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACtF,CAAC;AAED,OAAO,EAAE,YAAY,EAAE,CAAC","sourcesContent":["import { isErrorLike } from \"./error-like.js\";\n\n/**\n * Extracts a human-readable message from an unknown thrown value, falling back to its string form.\n *\n * @param error - The caught value to describe.\n * @returns The value's message when it has one, otherwise its string form.\n *\n * @example\n * errorMessage(new Error(\"boom\")); // \"boom\"\n * errorMessage(42); // \"42\"\n */\nfunction errorMessage(error: unknown): string {\n return Error.isError(error) || isErrorLike(error) ? error.message : String(error);\n}\n\nexport { errorMessage };\n"]}
1
+ {"version":3,"file":"error-message.js","sourceRoot":"","sources":["../../src/error/error-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,SAAS,YAAY,CAAC,KAAc;IAChC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACtF,CAAC;AAED,OAAO,EAAE,YAAY,EAAE,CAAC","sourcesContent":["import { isErrorLike } from \"./error-like.ts\";\n\nfunction errorMessage(error: unknown): string {\n return Error.isError(error) || isErrorLike(error) ? error.message : String(error);\n}\n\nexport { errorMessage };\n"]}
@@ -1,12 +1,3 @@
1
- /**
2
- * Combines the `stderr` and `stdout` of a failed child-process error into a single trimmed string.
3
- *
4
- * @param error - The child-process error to read output from.
5
- * @returns The joined output, or `undefined` when neither stream carried any text.
6
- *
7
- * @example
8
- * formatChildProcessError({ stderr: "boom" }); // "boom"
9
- */
10
1
  declare function formatChildProcessError(error: unknown): string | undefined;
11
2
  export { formatChildProcessError };
12
3
  //# sourceMappingURL=format-child-process-error.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"format-child-process-error.d.ts","sourceRoot":"","sources":["../../src/error/format-child-process-error.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,iBAAS,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CASnE;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
1
+ {"version":3,"file":"format-child-process-error.d.ts","sourceRoot":"","sources":["../../src/error/format-child-process-error.ts"],"names":[],"mappings":"AAGA,iBAAS,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CASnE;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
@@ -1,14 +1,5 @@
1
1
  import { isRecord } from "../predicate/is-record.js";
2
2
  import { readStream } from "./error-like.js";
3
- /**
4
- * Combines the `stderr` and `stdout` of a failed child-process error into a single trimmed string.
5
- *
6
- * @param error - The child-process error to read output from.
7
- * @returns The joined output, or `undefined` when neither stream carried any text.
8
- *
9
- * @example
10
- * formatChildProcessError({ stderr: "boom" }); // "boom"
11
- */
12
3
  function formatChildProcessError(error) {
13
4
  if (!isRecord(error)) {
14
5
  return undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"format-child-process-error.js","sourceRoot":"","sources":["../../src/error/format-child-process-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;;;;;;GAQG;AACH,SAAS,uBAAuB,CAAC,KAAc;IAC3C,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACnB,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACjC,MAAM,OAAO,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;IAE3F,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AACpD,CAAC;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC","sourcesContent":["import { isRecord } from \"../predicate/is-record.js\";\nimport { readStream } from \"./error-like.js\";\n\n/**\n * Combines the `stderr` and `stdout` of a failed child-process error into a single trimmed string.\n *\n * @param error - The child-process error to read output from.\n * @returns The joined output, or `undefined` when neither stream carried any text.\n *\n * @example\n * formatChildProcessError({ stderr: \"boom\" }); // \"boom\"\n */\nfunction formatChildProcessError(error: unknown): string | undefined {\n if (!isRecord(error)) {\n return undefined;\n }\n\n const { stderr, stdout } = error;\n const details = [readStream(stderr), readStream(stdout)].filter(Boolean).join(\"\\n\").trim();\n\n return details.length > 0 ? details : undefined;\n}\n\nexport { formatChildProcessError };\n"]}
1
+ {"version":3,"file":"format-child-process-error.js","sourceRoot":"","sources":["../../src/error/format-child-process-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,SAAS,uBAAuB,CAAC,KAAc;IAC3C,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACnB,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACjC,MAAM,OAAO,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;IAE3F,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AACpD,CAAC;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC","sourcesContent":["import { isRecord } from \"../predicate/is-record.ts\";\nimport { readStream } from \"./error-like.ts\";\n\nfunction formatChildProcessError(error: unknown): string | undefined {\n if (!isRecord(error)) {\n return undefined;\n }\n\n const { stderr, stdout } = error;\n const details = [readStream(stderr), readStream(stdout)].filter(Boolean).join(\"\\n\").trim();\n\n return details.length > 0 ? details : undefined;\n}\n\nexport { formatChildProcessError };\n"]}
@@ -1,4 +1,4 @@
1
- export { errorMessage } from "./error-message.js";
2
- export { formatChildProcessError } from "./format-child-process-error.js";
3
- export { normalizeError } from "./normalize-error.js";
1
+ export { errorMessage } from "./error-message.ts";
2
+ export { formatChildProcessError } from "./format-child-process-error.ts";
3
+ export { normalizeError } from "./normalize-error.ts";
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/error/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["export { errorMessage } from \"./error-message.js\";\nexport { formatChildProcessError } from \"./format-child-process-error.js\";\nexport { normalizeError } from \"./normalize-error.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/error/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["export { errorMessage } from \"./error-message.ts\";\nexport { formatChildProcessError } from \"./format-child-process-error.ts\";\nexport { normalizeError } from \"./normalize-error.ts\";\n"]}
@@ -1,13 +1,3 @@
1
- /**
2
- * Coerces an unknown thrown value into an `Error`, reusing it when it already is one and otherwise
3
- * wrapping its message while copying any error-like own properties.
4
- *
5
- * @param error - The caught value to normalize.
6
- * @returns The value itself when it is an `Error`, otherwise a new `Error` carrying its message.
7
- *
8
- * @example
9
- * normalizeError("boom"); // Error: boom
10
- */
11
1
  declare function normalizeError(error: unknown): Error;
12
2
  export { normalizeError };
13
3
  //# sourceMappingURL=normalize-error.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalize-error.d.ts","sourceRoot":"","sources":["../../src/error/normalize-error.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,iBAAS,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAM7C;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"normalize-error.d.ts","sourceRoot":"","sources":["../../src/error/normalize-error.ts"],"names":[],"mappings":"AAGA,iBAAS,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAM7C;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -1,15 +1,5 @@
1
1
  import { isErrorLike } from "./error-like.js";
2
2
  import { errorMessage } from "./error-message.js";
3
- /**
4
- * Coerces an unknown thrown value into an `Error`, reusing it when it already is one and otherwise
5
- * wrapping its message while copying any error-like own properties.
6
- *
7
- * @param error - The caught value to normalize.
8
- * @returns The value itself when it is an `Error`, otherwise a new `Error` carrying its message.
9
- *
10
- * @example
11
- * normalizeError("boom"); // Error: boom
12
- */
13
3
  function normalizeError(error) {
14
4
  if (Error.isError(error)) {
15
5
  return error;
@@ -1 +1 @@
1
- {"version":3,"file":"normalize-error.js","sourceRoot":"","sources":["../../src/error/normalize-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;;;;;;;GASG;AACH,SAAS,cAAc,CAAC,KAAc;IAClC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC1F,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { isErrorLike } from \"./error-like.js\";\nimport { errorMessage } from \"./error-message.js\";\n\n/**\n * Coerces an unknown thrown value into an `Error`, reusing it when it already is one and otherwise\n * wrapping its message while copying any error-like own properties.\n *\n * @param error - The caught value to normalize.\n * @returns The value itself when it is an `Error`, otherwise a new `Error` carrying its message.\n *\n * @example\n * normalizeError(\"boom\"); // Error: boom\n */\nfunction normalizeError(error: unknown): Error {\n if (Error.isError(error)) {\n return error;\n }\n\n return Object.assign(new Error(errorMessage(error)), isErrorLike(error) ? error : {});\n}\n\nexport { normalizeError };\n"]}
1
+ {"version":3,"file":"normalize-error.js","sourceRoot":"","sources":["../../src/error/normalize-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,SAAS,cAAc,CAAC,KAAc;IAClC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC1F,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { isErrorLike } from \"./error-like.ts\";\nimport { errorMessage } from \"./error-message.ts\";\n\nfunction normalizeError(error: unknown): Error {\n if (Error.isError(error)) {\n return error;\n }\n\n return Object.assign(new Error(errorMessage(error)), isErrorLike(error) ? error : {});\n}\n\nexport { normalizeError };\n"]}