@brillout/json-serializer 0.5.10 → 0.5.12
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/dist/cjs/stringify.d.ts +9 -5
- package/dist/cjs/stringify.js +61 -19
- package/dist/cjs/utils/isKeyDotNotationCompatible.d.ts +0 -1
- package/dist/cjs/utils/isKeyDotNotationCompatible.js +0 -6
- package/dist/cjs/utils/replacerWithPath.d.ts +4 -2
- package/dist/cjs/utils/replacerWithPath.js +10 -14
- package/dist/esm/parse.js +1 -0
- package/dist/esm/stringify.d.ts +9 -5
- package/dist/esm/stringify.js +61 -19
- package/dist/esm/utils/isKeyDotNotationCompatible.d.ts +0 -1
- package/dist/esm/utils/isKeyDotNotationCompatible.js +1 -3
- package/dist/esm/utils/replacerWithPath.d.ts +4 -2
- package/dist/esm/utils/replacerWithPath.js +9 -14
- package/package.json +5 -8
- package/parse.js +1 -1
package/dist/cjs/stringify.d.ts
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
export { stringify };
|
|
2
2
|
export { isJsonSerializerError };
|
|
3
|
-
import { type Iterable } from './utils/replacerWithPath';
|
|
3
|
+
import { type Iterable, type Path } from './utils/replacerWithPath';
|
|
4
4
|
declare function stringify(value: unknown, { forbidReactElements, space, valueName, sortObjectKeys, replacer: replacerUserProvided, }?: {
|
|
5
5
|
forbidReactElements?: boolean;
|
|
6
6
|
space?: number;
|
|
7
7
|
valueName?: string;
|
|
8
8
|
sortObjectKeys?: boolean;
|
|
9
|
-
replacer?: (this: Iterable, key: string, value: unknown
|
|
9
|
+
replacer?: (this: Iterable, key: string, value: unknown) => void | {
|
|
10
10
|
replacement: unknown;
|
|
11
11
|
};
|
|
12
12
|
}): string;
|
|
13
|
-
type
|
|
14
|
-
messageCore: string
|
|
13
|
+
type ErrAddendum = {
|
|
14
|
+
messageCore: `cannot serialize ${string} because it's a function` | `cannot serialize ${string} because it's a React element`;
|
|
15
|
+
value: unknown;
|
|
16
|
+
path: Path;
|
|
17
|
+
pathString: string;
|
|
18
|
+
subjectName: string;
|
|
15
19
|
};
|
|
16
|
-
declare function isJsonSerializerError(thing: unknown): thing is
|
|
20
|
+
declare function isJsonSerializerError(thing: unknown): thing is Error & ErrAddendum;
|
package/dist/cjs/stringify.js
CHANGED
|
@@ -6,27 +6,40 @@ const isReactElement_1 = require("./utils/isReactElement");
|
|
|
6
6
|
const isCallable_1 = require("./utils/isCallable");
|
|
7
7
|
const isObject_1 = require("./utils/isObject");
|
|
8
8
|
const replacerWithPath_1 = require("./utils/replacerWithPath");
|
|
9
|
-
function stringify(value, { forbidReactElements, space, valueName, sortObjectKeys,
|
|
9
|
+
function stringify(value, { forbidReactElements, space, valueName, sortObjectKeys,
|
|
10
|
+
// Used by Vike: https://github.com/vikejs/vike/blob/b4ba6b70e6bdc2e1f460c0d2e4c3faae5d0a733c/vike/node/plugin/plugins/importUserCode/v1-design/getConfigValuesSerialized.ts#L78
|
|
11
|
+
replacer: replacerUserProvided, } = {}) {
|
|
10
12
|
// The only error `JSON.stringify()` can throw is `TypeError "cyclic object value"`.
|
|
11
13
|
// - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#exceptions
|
|
12
14
|
// - This means we have total of 3 possible errors while serializing:
|
|
13
15
|
// - Cyclic references
|
|
14
16
|
// - Functions
|
|
15
17
|
// - React elements
|
|
16
|
-
const serializer = (val) => JSON.stringify(val, (0, replacerWithPath_1.replacerWithPath)(replacer
|
|
18
|
+
const serializer = (val) => JSON.stringify(val, (0, replacerWithPath_1.replacerWithPath)(replacer), space);
|
|
17
19
|
return serializer(value);
|
|
18
20
|
function replacer(key, value, path) {
|
|
19
21
|
{
|
|
20
|
-
const ret = replacerUserProvided === null || replacerUserProvided === void 0 ? void 0 : replacerUserProvided.call(this, key, value
|
|
22
|
+
const ret = replacerUserProvided === null || replacerUserProvided === void 0 ? void 0 : replacerUserProvided.call(this, key, value);
|
|
21
23
|
if (ret)
|
|
22
24
|
return ret.replacement;
|
|
23
25
|
}
|
|
24
26
|
if (forbidReactElements && (0, isReactElement_1.isReactElement)(value)) {
|
|
25
|
-
throw genErr(
|
|
27
|
+
throw genErr({
|
|
28
|
+
value,
|
|
29
|
+
valueType: 'React element',
|
|
30
|
+
path,
|
|
31
|
+
rootValueName: valueName,
|
|
32
|
+
});
|
|
26
33
|
}
|
|
27
34
|
if ((0, isCallable_1.isCallable)(value)) {
|
|
28
35
|
const functionName = value.name;
|
|
29
|
-
throw genErr(
|
|
36
|
+
throw genErr({
|
|
37
|
+
value,
|
|
38
|
+
valueType: 'function',
|
|
39
|
+
path,
|
|
40
|
+
rootValueName: valueName,
|
|
41
|
+
problematicValueName: path.length === 0 ? functionName : undefined,
|
|
42
|
+
});
|
|
30
43
|
}
|
|
31
44
|
const valueOriginal = this[key];
|
|
32
45
|
for (const { is, serialize } of types_1.types.slice().reverse()) {
|
|
@@ -48,32 +61,61 @@ function stringify(value, { forbidReactElements, space, valueName, sortObjectKey
|
|
|
48
61
|
}
|
|
49
62
|
}
|
|
50
63
|
exports.stringify = stringify;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
64
|
+
function genErr({ value, valueType, path, rootValueName, problematicValueName, }) {
|
|
65
|
+
const subjectName = getSubjectName({ path, rootValueName, problematicValueName });
|
|
66
|
+
const messageCore = `cannot serialize ${subjectName} because it's a ${valueType}`;
|
|
67
|
+
const err = new Error(`[@brillout/json-serializer](https://github.com/brillout/json-serializer) ${messageCore}.`);
|
|
68
|
+
const pathString = getPathString(path, false);
|
|
69
|
+
const errAddendum = {
|
|
56
70
|
[stamp]: true,
|
|
57
|
-
|
|
71
|
+
messageCore,
|
|
72
|
+
value,
|
|
73
|
+
path,
|
|
74
|
+
pathString,
|
|
75
|
+
subjectName,
|
|
76
|
+
};
|
|
77
|
+
Object.assign(err, errAddendum);
|
|
58
78
|
return err;
|
|
59
79
|
}
|
|
80
|
+
const stamp = '_isJsonSerializerError';
|
|
60
81
|
function isJsonSerializerError(thing) {
|
|
61
82
|
return (0, isObject_1.isObject)(thing) && thing[stamp] === true;
|
|
62
83
|
}
|
|
63
84
|
exports.isJsonSerializerError = isJsonSerializerError;
|
|
64
|
-
function
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
85
|
+
function getSubjectName({ path, rootValueName, problematicValueName, }) {
|
|
86
|
+
const pathString = getPathString(path, !rootValueName);
|
|
87
|
+
let subjectName;
|
|
88
|
+
if (!pathString) {
|
|
89
|
+
subjectName = rootValueName || problematicValueName || 'value';
|
|
68
90
|
}
|
|
69
91
|
else {
|
|
70
92
|
if (problematicValueName) {
|
|
71
|
-
|
|
93
|
+
subjectName = problematicValueName + ' at ';
|
|
72
94
|
}
|
|
73
95
|
else {
|
|
74
|
-
|
|
96
|
+
subjectName = '';
|
|
75
97
|
}
|
|
76
|
-
|
|
98
|
+
subjectName = subjectName + (rootValueName || '') + pathString;
|
|
77
99
|
}
|
|
78
|
-
return
|
|
100
|
+
return subjectName;
|
|
101
|
+
}
|
|
102
|
+
function getPathString(path, canBeFirstKey) {
|
|
103
|
+
const pathString = path
|
|
104
|
+
.map((key, i) => {
|
|
105
|
+
if (typeof key === 'number') {
|
|
106
|
+
return `[${key}]`;
|
|
107
|
+
}
|
|
108
|
+
if (i === 0 && canBeFirstKey && isKeyDotNotationCompatible(key)) {
|
|
109
|
+
return key;
|
|
110
|
+
}
|
|
111
|
+
return getPropAccessNotation(key);
|
|
112
|
+
})
|
|
113
|
+
.join('');
|
|
114
|
+
return pathString;
|
|
115
|
+
}
|
|
116
|
+
function getPropAccessNotation(key) {
|
|
117
|
+
return typeof key === 'string' && isKeyDotNotationCompatible(key) ? `.${key}` : `[${JSON.stringify(key)}]`;
|
|
118
|
+
}
|
|
119
|
+
function isKeyDotNotationCompatible(key) {
|
|
120
|
+
return /^[a-z0-9\$_]+$/i.test(key);
|
|
79
121
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isKeyDotNotationCompatible(key: string): boolean;
|
|
@@ -1,7 +1 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isKeyDotNotationCompatible = void 0;
|
|
4
|
-
function isKeyDotNotationCompatible(key) {
|
|
5
|
-
return /^[a-z0-9\$_]+$/i.test(key);
|
|
6
|
-
}
|
|
7
|
-
exports.isKeyDotNotationCompatible = isKeyDotNotationCompatible;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { replacerWithPath };
|
|
2
2
|
export type { Iterable };
|
|
3
|
+
export type { Path };
|
|
4
|
+
type Path = (string | number)[];
|
|
3
5
|
type Iterable = Record<string, unknown>;
|
|
4
|
-
type Replacer = (this: Iterable, key: string, value: unknown, path:
|
|
5
|
-
declare function replacerWithPath(replacer: Replacer
|
|
6
|
+
type Replacer = (this: Iterable, key: string, value: unknown, path: Path) => unknown;
|
|
7
|
+
declare function replacerWithPath(replacer: Replacer): (this: Iterable, key: string, value: unknown) => unknown;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.replacerWithPath = void 0;
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
function replacerWithPath(replacer, canBeFirstKey) {
|
|
7
|
-
const paths = new WeakMap();
|
|
4
|
+
function replacerWithPath(replacer) {
|
|
5
|
+
const pathMap = new WeakMap();
|
|
8
6
|
return function (key, value) {
|
|
9
|
-
|
|
10
|
-
const
|
|
7
|
+
var _a;
|
|
8
|
+
const pathPrevious = (_a = pathMap.get(this)) !== null && _a !== void 0 ? _a : [];
|
|
9
|
+
const path = [...pathPrevious];
|
|
10
|
+
if (key !== '') {
|
|
11
|
+
const pathEntry = !Array.isArray(this) ? key : parseInt(key, 10);
|
|
12
|
+
path.push(pathEntry);
|
|
13
|
+
}
|
|
11
14
|
if (isIterable(value))
|
|
12
|
-
|
|
15
|
+
pathMap.set(value, path);
|
|
13
16
|
return replacer.call(this, key, value, path);
|
|
14
17
|
};
|
|
15
18
|
}
|
|
@@ -17,10 +20,3 @@ exports.replacerWithPath = replacerWithPath;
|
|
|
17
20
|
function isIterable(value) {
|
|
18
21
|
return value === Object(value);
|
|
19
22
|
}
|
|
20
|
-
function getPropAccessNotation(key, obj, isFirstKey) {
|
|
21
|
-
if (Array.isArray(obj))
|
|
22
|
-
return `[${key}]`;
|
|
23
|
-
if ((0, isKeyDotNotationCompatible_1.isKeyDotNotationCompatible)(key))
|
|
24
|
-
return !isFirstKey ? `.${key}` : key; // Dot notation
|
|
25
|
-
return `[${JSON.stringify(key)}]`; // Bracket notation
|
|
26
|
-
}
|
package/dist/esm/parse.js
CHANGED
package/dist/esm/stringify.d.ts
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
export { stringify };
|
|
2
2
|
export { isJsonSerializerError };
|
|
3
|
-
import { type Iterable } from './utils/replacerWithPath';
|
|
3
|
+
import { type Iterable, type Path } from './utils/replacerWithPath';
|
|
4
4
|
declare function stringify(value: unknown, { forbidReactElements, space, valueName, sortObjectKeys, replacer: replacerUserProvided, }?: {
|
|
5
5
|
forbidReactElements?: boolean;
|
|
6
6
|
space?: number;
|
|
7
7
|
valueName?: string;
|
|
8
8
|
sortObjectKeys?: boolean;
|
|
9
|
-
replacer?: (this: Iterable, key: string, value: unknown
|
|
9
|
+
replacer?: (this: Iterable, key: string, value: unknown) => void | {
|
|
10
10
|
replacement: unknown;
|
|
11
11
|
};
|
|
12
12
|
}): string;
|
|
13
|
-
type
|
|
14
|
-
messageCore: string
|
|
13
|
+
type ErrAddendum = {
|
|
14
|
+
messageCore: `cannot serialize ${string} because it's a function` | `cannot serialize ${string} because it's a React element`;
|
|
15
|
+
value: unknown;
|
|
16
|
+
path: Path;
|
|
17
|
+
pathString: string;
|
|
18
|
+
subjectName: string;
|
|
15
19
|
};
|
|
16
|
-
declare function isJsonSerializerError(thing: unknown): thing is
|
|
20
|
+
declare function isJsonSerializerError(thing: unknown): thing is Error & ErrAddendum;
|
package/dist/esm/stringify.js
CHANGED
|
@@ -5,27 +5,40 @@ import { isReactElement } from './utils/isReactElement';
|
|
|
5
5
|
import { isCallable } from './utils/isCallable';
|
|
6
6
|
import { isObject } from './utils/isObject';
|
|
7
7
|
import { replacerWithPath } from './utils/replacerWithPath';
|
|
8
|
-
function stringify(value, { forbidReactElements, space, valueName, sortObjectKeys,
|
|
8
|
+
function stringify(value, { forbidReactElements, space, valueName, sortObjectKeys,
|
|
9
|
+
// Used by Vike: https://github.com/vikejs/vike/blob/b4ba6b70e6bdc2e1f460c0d2e4c3faae5d0a733c/vike/node/plugin/plugins/importUserCode/v1-design/getConfigValuesSerialized.ts#L78
|
|
10
|
+
replacer: replacerUserProvided, } = {}) {
|
|
9
11
|
// The only error `JSON.stringify()` can throw is `TypeError "cyclic object value"`.
|
|
10
12
|
// - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#exceptions
|
|
11
13
|
// - This means we have total of 3 possible errors while serializing:
|
|
12
14
|
// - Cyclic references
|
|
13
15
|
// - Functions
|
|
14
16
|
// - React elements
|
|
15
|
-
const serializer = (val) => JSON.stringify(val, replacerWithPath(replacer
|
|
17
|
+
const serializer = (val) => JSON.stringify(val, replacerWithPath(replacer), space);
|
|
16
18
|
return serializer(value);
|
|
17
19
|
function replacer(key, value, path) {
|
|
18
20
|
{
|
|
19
|
-
const ret = replacerUserProvided?.call(this, key, value
|
|
21
|
+
const ret = replacerUserProvided?.call(this, key, value);
|
|
20
22
|
if (ret)
|
|
21
23
|
return ret.replacement;
|
|
22
24
|
}
|
|
23
25
|
if (forbidReactElements && isReactElement(value)) {
|
|
24
|
-
throw genErr(
|
|
26
|
+
throw genErr({
|
|
27
|
+
value,
|
|
28
|
+
valueType: 'React element',
|
|
29
|
+
path,
|
|
30
|
+
rootValueName: valueName,
|
|
31
|
+
});
|
|
25
32
|
}
|
|
26
33
|
if (isCallable(value)) {
|
|
27
34
|
const functionName = value.name;
|
|
28
|
-
throw genErr(
|
|
35
|
+
throw genErr({
|
|
36
|
+
value,
|
|
37
|
+
valueType: 'function',
|
|
38
|
+
path,
|
|
39
|
+
rootValueName: valueName,
|
|
40
|
+
problematicValueName: path.length === 0 ? functionName : undefined,
|
|
41
|
+
});
|
|
29
42
|
}
|
|
30
43
|
const valueOriginal = this[key];
|
|
31
44
|
for (const { is, serialize } of types.slice().reverse()) {
|
|
@@ -46,31 +59,60 @@ function stringify(value, { forbidReactElements, space, valueName, sortObjectKey
|
|
|
46
59
|
return value;
|
|
47
60
|
}
|
|
48
61
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
62
|
+
function genErr({ value, valueType, path, rootValueName, problematicValueName, }) {
|
|
63
|
+
const subjectName = getSubjectName({ path, rootValueName, problematicValueName });
|
|
64
|
+
const messageCore = `cannot serialize ${subjectName} because it's a ${valueType}`;
|
|
65
|
+
const err = new Error(`[@brillout/json-serializer](https://github.com/brillout/json-serializer) ${messageCore}.`);
|
|
66
|
+
const pathString = getPathString(path, false);
|
|
67
|
+
const errAddendum = {
|
|
54
68
|
[stamp]: true,
|
|
55
|
-
|
|
69
|
+
messageCore,
|
|
70
|
+
value,
|
|
71
|
+
path,
|
|
72
|
+
pathString,
|
|
73
|
+
subjectName,
|
|
74
|
+
};
|
|
75
|
+
Object.assign(err, errAddendum);
|
|
56
76
|
return err;
|
|
57
77
|
}
|
|
78
|
+
const stamp = '_isJsonSerializerError';
|
|
58
79
|
function isJsonSerializerError(thing) {
|
|
59
80
|
return isObject(thing) && thing[stamp] === true;
|
|
60
81
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
82
|
+
function getSubjectName({ path, rootValueName, problematicValueName, }) {
|
|
83
|
+
const pathString = getPathString(path, !rootValueName);
|
|
84
|
+
let subjectName;
|
|
85
|
+
if (!pathString) {
|
|
86
|
+
subjectName = rootValueName || problematicValueName || 'value';
|
|
65
87
|
}
|
|
66
88
|
else {
|
|
67
89
|
if (problematicValueName) {
|
|
68
|
-
|
|
90
|
+
subjectName = problematicValueName + ' at ';
|
|
69
91
|
}
|
|
70
92
|
else {
|
|
71
|
-
|
|
93
|
+
subjectName = '';
|
|
72
94
|
}
|
|
73
|
-
|
|
95
|
+
subjectName = subjectName + (rootValueName || '') + pathString;
|
|
74
96
|
}
|
|
75
|
-
return
|
|
97
|
+
return subjectName;
|
|
98
|
+
}
|
|
99
|
+
function getPathString(path, canBeFirstKey) {
|
|
100
|
+
const pathString = path
|
|
101
|
+
.map((key, i) => {
|
|
102
|
+
if (typeof key === 'number') {
|
|
103
|
+
return `[${key}]`;
|
|
104
|
+
}
|
|
105
|
+
if (i === 0 && canBeFirstKey && isKeyDotNotationCompatible(key)) {
|
|
106
|
+
return key;
|
|
107
|
+
}
|
|
108
|
+
return getPropAccessNotation(key);
|
|
109
|
+
})
|
|
110
|
+
.join('');
|
|
111
|
+
return pathString;
|
|
112
|
+
}
|
|
113
|
+
function getPropAccessNotation(key) {
|
|
114
|
+
return typeof key === 'string' && isKeyDotNotationCompatible(key) ? `.${key}` : `[${JSON.stringify(key)}]`;
|
|
115
|
+
}
|
|
116
|
+
function isKeyDotNotationCompatible(key) {
|
|
117
|
+
return /^[a-z0-9\$_]+$/i.test(key);
|
|
76
118
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isKeyDotNotationCompatible(key: string): boolean;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { replacerWithPath };
|
|
2
2
|
export type { Iterable };
|
|
3
|
+
export type { Path };
|
|
4
|
+
type Path = (string | number)[];
|
|
3
5
|
type Iterable = Record<string, unknown>;
|
|
4
|
-
type Replacer = (this: Iterable, key: string, value: unknown, path:
|
|
5
|
-
declare function replacerWithPath(replacer: Replacer
|
|
6
|
+
type Replacer = (this: Iterable, key: string, value: unknown, path: Path) => unknown;
|
|
7
|
+
declare function replacerWithPath(replacer: Replacer): (this: Iterable, key: string, value: unknown) => unknown;
|
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
export { replacerWithPath };
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function replacerWithPath(replacer, canBeFirstKey) {
|
|
5
|
-
const paths = new WeakMap();
|
|
2
|
+
function replacerWithPath(replacer) {
|
|
3
|
+
const pathMap = new WeakMap();
|
|
6
4
|
return function (key, value) {
|
|
7
|
-
const
|
|
8
|
-
const path =
|
|
5
|
+
const pathPrevious = pathMap.get(this) ?? [];
|
|
6
|
+
const path = [...pathPrevious];
|
|
7
|
+
if (key !== '') {
|
|
8
|
+
const pathEntry = !Array.isArray(this) ? key : parseInt(key, 10);
|
|
9
|
+
path.push(pathEntry);
|
|
10
|
+
}
|
|
9
11
|
if (isIterable(value))
|
|
10
|
-
|
|
12
|
+
pathMap.set(value, path);
|
|
11
13
|
return replacer.call(this, key, value, path);
|
|
12
14
|
};
|
|
13
15
|
}
|
|
14
16
|
function isIterable(value) {
|
|
15
17
|
return value === Object(value);
|
|
16
18
|
}
|
|
17
|
-
function getPropAccessNotation(key, obj, isFirstKey) {
|
|
18
|
-
if (Array.isArray(obj))
|
|
19
|
-
return `[${key}]`;
|
|
20
|
-
if (isKeyDotNotationCompatible(key))
|
|
21
|
-
return !isFirstKey ? `.${key}` : key; // Dot notation
|
|
22
|
-
return `[${JSON.stringify(key)}]`; // Bracket notation
|
|
23
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brillout/json-serializer",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.12",
|
|
4
4
|
"description": "Same as JSON but with added support for `Date`, `undefined`, `Map`, `Set`, and more.",
|
|
5
5
|
"main": "./index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -29,22 +29,20 @@
|
|
|
29
29
|
"test": "vitest",
|
|
30
30
|
"========= Build readme.md": "",
|
|
31
31
|
"docs": "mdocs",
|
|
32
|
-
"========= Clean": "",
|
|
33
|
-
"// Remove all generated files": "",
|
|
34
|
-
"clean": "git clean -Xdf",
|
|
35
|
-
"reset": "pnpm run clean && pnpm install && pnpm run build",
|
|
36
32
|
"========= Formatting": "",
|
|
37
33
|
"format": "pnpm run format:biome",
|
|
38
34
|
"format:prettier": "git ls-files | egrep '\\.(json|js|jsx|css|ts|tsx|vue|mjs|cjs)$' | grep --invert-match package.json | xargs pnpm exec prettier --write",
|
|
39
35
|
"format:biome": "biome format --write .",
|
|
40
36
|
"format:check": "biome format . || echo Fix formatting by running: $ pnpm -w run format",
|
|
41
37
|
"========= Release": "",
|
|
42
|
-
"release": "release-me patch"
|
|
38
|
+
"release": "release-me patch",
|
|
39
|
+
"========= Reset": "",
|
|
40
|
+
"reset": "git clean -Xdf && pnpm install && pnpm run build"
|
|
43
41
|
},
|
|
44
42
|
"devDependencies": {
|
|
45
43
|
"@biomejs/biome": "^1.7.2",
|
|
46
44
|
"@brillout/mdocs": "^0.1.30",
|
|
47
|
-
"@brillout/release-me": "^0.3.
|
|
45
|
+
"@brillout/release-me": "^0.3.8",
|
|
48
46
|
"@types/node": "^20.5.6",
|
|
49
47
|
"@types/react": "^18.2.21",
|
|
50
48
|
"lodash.isequal": "^4.5.0",
|
|
@@ -53,7 +51,6 @@
|
|
|
53
51
|
"typescript": "^5.2.2",
|
|
54
52
|
"vitest": "^0.34.3"
|
|
55
53
|
},
|
|
56
|
-
"packageManager": "pnpm@8.6.12",
|
|
57
54
|
"// Use @vitest/snapshot PR https://github.com/vitest-dev/vitest/pull/3961": "",
|
|
58
55
|
"pnpm": {
|
|
59
56
|
"overrides": {
|
package/parse.js
CHANGED