@thi.ng/strings 3.7.17 → 3.7.19

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-03-01T15:22:50Z
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/README.md CHANGED
@@ -1,16 +1,5 @@
1
1
  <!-- This file is generated - DO NOT EDIT! -->
2
2
  <!-- Please see: https://github.com/thi-ng/umbrella/blob/develop/CONTRIBUTING.md#changes-to-readme-files -->
3
- > [!IMPORTANT]
4
- > ‼️ Announcing the thi.ng user survey 2024 📋
5
- >
6
- > [Please participate in the survey here!](https://forms.gle/XacbSDEmQMPZg8197)\
7
- > (open until end of February)
8
- >
9
- > **To achieve a better sample size, I'd highly appreciate if you could
10
- > circulate the link to this survey in your own networks.**
11
- >
12
- > [Discussion](https://github.com/thi-ng/umbrella/discussions/447)
13
-
14
3
  # ![@thi.ng/strings](https://media.thi.ng/umbrella/banners-20230807/thing-strings.svg?41f4988c)
15
4
 
16
5
  [![npm version](https://img.shields.io/npm/v/@thi.ng/strings.svg)](https://www.npmjs.com/package/@thi.ng/strings)
@@ -22,7 +11,7 @@
22
11
  > of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
23
12
  > and anti-framework.
24
13
  >
25
- > 🚀 Help me to work full-time on these projects by [sponsoring me on
14
+ > 🚀 Please help me to work full-time on these projects by [sponsoring me on
26
15
  > GitHub](https://github.com/sponsors/postspectacular). Thank you! ❤️
27
16
 
28
17
  - [About](#about)
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.19",
4
4
  "description": "Various string formatting & utility functions",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -35,10 +35,10 @@
35
35
  "test": "bun test"
36
36
  },
37
37
  "dependencies": {
38
- "@thi.ng/api": "^8.9.26",
39
- "@thi.ng/errors": "^2.4.18",
40
- "@thi.ng/hex": "^2.3.37",
41
- "@thi.ng/memoize": "^3.1.60"
38
+ "@thi.ng/api": "^8.9.27",
39
+ "@thi.ng/errors": "^2.4.19",
40
+ "@thi.ng/hex": "^2.3.38",
41
+ "@thi.ng/memoize": "^3.1.61"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@microsoft/api-extractor": "^7.40.1",
@@ -203,5 +203,5 @@
203
203
  "thi.ng": {
204
204
  "year": 2015
205
205
  },
206
- "gitHead": "6e20f80dd9df1c8055ffa3c1e4d6f7598add0c0b\n"
206
+ "gitHead": "d660ae8fd1bf64d919b4334f19509f1f539d70f6\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 -