@augment-vir/common 31.66.0 → 31.67.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.
@@ -1,4 +1,4 @@
1
- import { type JsonCompatibleValue } from '@augment-vir/core';
1
+ import { type JsonCompatibleValue, type PartialWithUndefined } from '@augment-vir/core';
2
2
  import { type IsUnknown, type Jsonify, type Writable } from 'type-fest';
3
3
  /**
4
4
  * Deeply copy an object through JSON. This is the fastest deep copy, but the input must already be
@@ -34,4 +34,6 @@ import { type IsUnknown, type Jsonify, type Writable } from 'type-fest';
34
34
  *
35
35
  * @package [`@augment-vir/common`](https://www.npmjs.com/package/@augment-vir/common)
36
36
  */
37
- export declare function copyThroughJson<const T>(input: T): IsUnknown<T> extends true ? JsonCompatibleValue : Writable<Jsonify<T>>;
37
+ export declare function copyThroughJson<const T>(input: T, { enableUnsafeCopyAll, }?: Readonly<PartialWithUndefined<{
38
+ enableUnsafeCopyAll: boolean;
39
+ }>> | undefined): IsUnknown<T> extends true ? JsonCompatibleValue : Writable<Jsonify<T>>;
@@ -33,9 +33,10 @@ import { safeJsonStringify } from './safe-json-stringify.js';
33
33
  *
34
34
  * @package [`@augment-vir/common`](https://www.npmjs.com/package/@augment-vir/common)
35
35
  */
36
- export function copyThroughJson(input) {
36
+ export function copyThroughJson(input, { enableUnsafeCopyAll, } = {}) {
37
37
  try {
38
- return JSON.parse(safeJsonStringify(input));
38
+ const stringified = enableUnsafeCopyAll ? JSON.stringify(input) : safeJsonStringify(input);
39
+ return JSON.parse(stringified);
39
40
  /* node:coverage ignore next 4 */
40
41
  }
41
42
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@augment-vir/common",
3
- "version": "31.66.0",
3
+ "version": "31.67.0",
4
4
  "description": "A collection of augments, helpers types, functions, and classes for any JavaScript environment.",
5
5
  "keywords": [
6
6
  "augment",
@@ -40,8 +40,8 @@
40
40
  "test:web": "virmator --no-deps test web"
41
41
  },
42
42
  "dependencies": {
43
- "@augment-vir/assert": "^31.66.0",
44
- "@augment-vir/core": "^31.66.0",
43
+ "@augment-vir/assert": "^31.67.0",
44
+ "@augment-vir/core": "^31.67.0",
45
45
  "@date-vir/duration": "^8.1.1",
46
46
  "ansi-styles": "^6.2.3",
47
47
  "deepcopy-esm": "^2.1.1",