@thi.ng/strings 3.7.17 → 3.7.18

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-02-25T14:07:53Z
3
+ - **Last updated**: 2024-02-28T14:23:30Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/strings",
3
- "version": "3.7.17",
3
+ "version": "3.7.18",
4
4
  "description": "Various string formatting & utility functions",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -203,5 +203,5 @@
203
203
  "thi.ng": {
204
204
  "year": 2015
205
205
  },
206
- "gitHead": "6e20f80dd9df1c8055ffa3c1e4d6f7598add0c0b\n"
206
+ "gitHead": "190d68e7f7524631b333cfdbf32c6a23be27c166\n"
207
207
  }
package/stringify.d.ts CHANGED
@@ -1,9 +1,24 @@
1
1
  import type { Stringer } from "./api.js";
2
2
  /**
3
- * Higher order version of `JSON.stringify()` with the option to treat strings
4
- * and numbers differently. If `all` is `false` (default), strings and numbers
5
- * are simply converted using `String(x)`. If `indent` is given, it will be used
6
- * for `JSON.stringify(x, null, indent)`
3
+ * Higher order version of `JSON.stringify()` with the option to treat top-level
4
+ * strings and numbers differently (i.e. NOT if they're nested values!). If
5
+ * `all` is `false` (default), strings and numbers are simply converted using
6
+ * `String(x)`. If `indent` is given, it will be used for `JSON.stringify(x,
7
+ * null, indent)`
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * import { stringify } from "@thi.ng/strings";
12
+ *
13
+ * stringify()("hello");
14
+ * // hello
15
+ *
16
+ * stringify(true)("hello");
17
+ * // "hello"
18
+ *
19
+ * stringify()({ a: "hello" })
20
+ * // { "a": "hello" }
21
+ * ```
7
22
  *
8
23
  * @param all -
9
24
  * @param indent -