@zag-js/stringify-state 1.34.1 → 1.35.1
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/index.js
CHANGED
|
@@ -1,12 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
8
29
|
|
|
9
30
|
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
highlightState: () => highlightState,
|
|
34
|
+
stringifyState: () => stringifyState
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(index_exports);
|
|
37
|
+
var import_json_format_highlight = __toESM(require("json-format-highlight"));
|
|
10
38
|
var pick = (obj, keys) => Object.fromEntries(keys.filter((key) => key in obj).map((key) => [key, obj[key]]));
|
|
11
39
|
var hasProp = (v, prop) => Object.prototype.hasOwnProperty.call(v, prop);
|
|
12
40
|
var isTimeObject = (v) => hasProp(v, "hour") && hasProp(v, "minute") && hasProp(v, "second");
|
|
@@ -68,8 +96,10 @@ function stringifyState(state, omit) {
|
|
|
68
96
|
return code;
|
|
69
97
|
}
|
|
70
98
|
function highlightState(state, omit) {
|
|
71
|
-
return
|
|
99
|
+
return (0, import_json_format_highlight.default)(stringifyState(state, omit));
|
|
72
100
|
}
|
|
73
|
-
|
|
74
|
-
exports
|
|
75
|
-
|
|
101
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
102
|
+
0 && (module.exports = {
|
|
103
|
+
highlightState,
|
|
104
|
+
stringifyState
|
|
105
|
+
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import formatHighlight from 'json-format-highlight';
|
|
2
|
-
|
|
3
1
|
// src/index.ts
|
|
2
|
+
import formatHighlight from "json-format-highlight";
|
|
4
3
|
var pick = (obj, keys) => Object.fromEntries(keys.filter((key) => key in obj).map((key) => [key, obj[key]]));
|
|
5
4
|
var hasProp = (v, prop) => Object.prototype.hasOwnProperty.call(v, prop);
|
|
6
5
|
var isTimeObject = (v) => hasProp(v, "hour") && hasProp(v, "minute") && hasProp(v, "second");
|
|
@@ -64,5 +63,7 @@ function stringifyState(state, omit) {
|
|
|
64
63
|
function highlightState(state, omit) {
|
|
65
64
|
return formatHighlight(stringifyState(state, omit));
|
|
66
65
|
}
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
export {
|
|
67
|
+
highlightState,
|
|
68
|
+
stringifyState
|
|
69
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare module "json-format-highlight" {
|
|
2
|
+
export interface FormatOptions {
|
|
3
|
+
keyColor?: string | undefined
|
|
4
|
+
numberColor?: string | undefined
|
|
5
|
+
stringColor?: string | undefined
|
|
6
|
+
trueColor?: string | undefined
|
|
7
|
+
falseColor?: string | undefined
|
|
8
|
+
nullColor?: string | undefined
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default function formatHighlight(code: string, options?: Options): string
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare module "json-format-highlight" {
|
|
2
|
+
export interface FormatOptions {
|
|
3
|
+
keyColor?: string | undefined
|
|
4
|
+
numberColor?: string | undefined
|
|
5
|
+
stringColor?: string | undefined
|
|
6
|
+
trueColor?: string | undefined
|
|
7
|
+
falseColor?: string | undefined
|
|
8
|
+
nullColor?: string | undefined
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default function formatHighlight(code: string, options?: Options): string
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|