@augment-vir/core 31.34.1 → 31.35.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.
@@ -7,4 +7,6 @@
7
7
  * @category Package : @augment-vir/common
8
8
  * @package [`@augment-vir/common`](https://www.npmjs.com/package/@augment-vir/common)
9
9
  */
10
- export declare function stringify(input: unknown): string;
10
+ export declare function stringify(input: unknown,
11
+ /** Passed directly to the `space` parameter of `JSON.stringify`. */
12
+ space?: string | number): string;
@@ -15,7 +15,9 @@ const undefinedSentinelStringRegExp = new RegExp(`['"]${undefinedSentinel}['"]`)
15
15
  * @category Package : @augment-vir/common
16
16
  * @package [`@augment-vir/common`](https://www.npmjs.com/package/@augment-vir/common)
17
17
  */
18
- export function stringify(input) {
18
+ export function stringify(input,
19
+ /** Passed directly to the `space` parameter of `JSON.stringify`. */
20
+ space) {
19
21
  try {
20
22
  const json5String = JSON5.stringify(input,
21
23
  // Use a replacer to turn undefined into a unique string so the key is kept.
@@ -24,7 +26,7 @@ export function stringify(input) {
24
26
  return undefinedSentinel;
25
27
  }
26
28
  return value;
27
- });
29
+ }, space || undefined);
28
30
  return json5String.split(undefinedSentinelStringRegExp).join('undefined');
29
31
  }
30
32
  catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@augment-vir/core",
3
- "version": "31.34.1",
3
+ "version": "31.35.0",
4
4
  "description": "Core augment-vir augments. Use @augment-vir/common instead.",
5
5
  "homepage": "https://github.com/electrovir/augment-vir",
6
6
  "bugs": {