@slonik/sql-tag 48.6.0 → 48.7.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,2 +1,2 @@
|
|
|
1
|
-
export declare const safeStringify: (subject: unknown
|
|
1
|
+
export declare const safeStringify: (subject: unknown) => string;
|
|
2
2
|
//# sourceMappingURL=safeStringify.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safeStringify.d.ts","sourceRoot":"","sources":["../../src/utilities/safeStringify.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"safeStringify.d.ts","sourceRoot":"","sources":["../../src/utilities/safeStringify.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,aAAa,GAAI,SAAS,OAAO,KAAG,MAchD,CAAC"}
|
|
@@ -4,8 +4,14 @@ const stringify = configure({
|
|
|
4
4
|
circularValue: '[Circular]',
|
|
5
5
|
strict: true,
|
|
6
6
|
});
|
|
7
|
-
export const safeStringify = (subject
|
|
8
|
-
|
|
7
|
+
export const safeStringify = (subject) => {
|
|
8
|
+
try {
|
|
9
|
+
return JSON.stringify(subject);
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
// Ignore
|
|
13
|
+
}
|
|
14
|
+
const result = stringify(subject);
|
|
9
15
|
if (result === undefined) {
|
|
10
16
|
throw new Error('Expected result to be string');
|
|
11
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safeStringify.js","sourceRoot":"","sources":["../../src/utilities/safeStringify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,MAAM,SAAS,GAAG,SAAS,CAAC;IAC1B,MAAM,EAAE,IAAI;IACZ,aAAa,EAAE,YAAY;IAC3B,MAAM,EAAE,IAAI;CACb,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,
|
|
1
|
+
{"version":3,"file":"safeStringify.js","sourceRoot":"","sources":["../../src/utilities/safeStringify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,MAAM,SAAS,GAAG,SAAS,CAAC;IAC1B,MAAM,EAAE,IAAI;IACZ,aAAa,EAAE,YAAY;IAC3B,MAAM,EAAE,IAAI;CACb,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAgB,EAAU,EAAE;IACxD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,SAAS;IACX,CAAC;IAED,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IAElC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
]
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@slonik/errors": "^48.
|
|
20
|
-
"@slonik/types": "^48.
|
|
19
|
+
"@slonik/errors": "^48.7.0",
|
|
20
|
+
"@slonik/types": "^48.7.0",
|
|
21
21
|
"roarr": "^7.21.1",
|
|
22
22
|
"safe-stable-stringify": "^2.5.0",
|
|
23
23
|
"serialize-error": "^12.0.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"tsimp": "^2.0.12",
|
|
34
34
|
"typescript": "^5.8.3",
|
|
35
35
|
"typescript-eslint": "^8.33.0",
|
|
36
|
-
"@slonik/eslint-config": "^48.
|
|
36
|
+
"@slonik/eslint-config": "^48.7.0"
|
|
37
37
|
},
|
|
38
38
|
"engines": {
|
|
39
39
|
"node": ">=24"
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"type": "module",
|
|
58
58
|
"types": "./dist/index.d.ts",
|
|
59
|
-
"version": "48.
|
|
59
|
+
"version": "48.7.0",
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "rm -fr ./dist && tsc --project ./tsconfig.json",
|
|
62
62
|
"lint": "npm run lint:cspell && npm run lint:eslint && npm run lint:tsc",
|
|
@@ -6,16 +6,14 @@ const stringify = configure({
|
|
|
6
6
|
strict: true,
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
-
export const safeStringify = (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
): string => {
|
|
18
|
-
const result = stringify(subject, replacer, space);
|
|
9
|
+
export const safeStringify = (subject: unknown): string => {
|
|
10
|
+
try {
|
|
11
|
+
return JSON.stringify(subject);
|
|
12
|
+
} catch {
|
|
13
|
+
// Ignore
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const result = stringify(subject);
|
|
19
17
|
|
|
20
18
|
if (result === undefined) {
|
|
21
19
|
throw new Error('Expected result to be string');
|