@zag-js/core
Advanced tools
Comparing version 0.0.0-dev-20220413175519 to 0.0.0-dev-20220415160434
@@ -52,3 +52,3 @@ var __defProp = Object.defineProperty; | ||
// ../utilities/core/src/array.ts | ||
// ../utilities/core/dist/index.mjs | ||
function clear(v) { | ||
@@ -59,4 +59,2 @@ while (v.length > 0) | ||
} | ||
// ../utilities/core/src/functions.ts | ||
var runIfFn = (v, ...a) => { | ||
@@ -81,4 +79,2 @@ const res = typeof v === "function" ? v(...a) : v; | ||
})(); | ||
// ../utilities/core/src/guard.ts | ||
var isArray = (v) => Array.isArray(v); | ||
@@ -89,4 +85,2 @@ var isObject = (v) => !(v == null || typeof v !== "object" || isArray(v)); | ||
var isFunction = (v) => typeof v === "function"; | ||
// ../utilities/core/src/warning.ts | ||
function warn(...a) { | ||
@@ -199,31 +193,4 @@ const m = a.length === 1 ? a[0] : a[1]; | ||
// ../../node_modules/klona/json/index.mjs | ||
function klona(val) { | ||
var k, out, tmp; | ||
if (Array.isArray(val)) { | ||
out = Array(k = val.length); | ||
while (k--) | ||
out[k] = (tmp = val[k]) && typeof tmp === "object" ? klona(tmp) : tmp; | ||
return out; | ||
} | ||
if (Object.prototype.toString.call(val) === "[object Object]") { | ||
out = {}; | ||
for (k in val) { | ||
if (k === "__proto__") { | ||
Object.defineProperty(out, k, { | ||
value: klona(val[k]), | ||
configurable: true, | ||
enumerable: true, | ||
writable: true | ||
}); | ||
} else { | ||
out[k] = (tmp = val[k]) && typeof tmp === "object" ? klona(tmp) : tmp; | ||
} | ||
} | ||
return out; | ||
} | ||
return val; | ||
} | ||
// src/machine.ts | ||
var import_json = require("klona/json"); | ||
var import_utils9 = require("valtio/utils"); | ||
@@ -783,3 +750,3 @@ var import_vanilla2 = require("valtio/vanilla"); | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k; | ||
this.options = klona(options); | ||
this.options = (0, import_json.klona)(options); | ||
this.id = (_a = config.id) != null ? _a : `machine-${uuid()}`; | ||
@@ -791,3 +758,3 @@ this.guardMap = (_c = (_b = this.options) == null ? void 0 : _b.guards) != null ? _c : {}; | ||
this.sync = (_k = (_j = this.options) == null ? void 0 : _j.sync) != null ? _k : false; | ||
this.state = createProxy(klona(config)); | ||
this.state = createProxy((0, import_json.klona)(config)); | ||
this.setupComputed(); | ||
@@ -794,0 +761,0 @@ const event = toEvent("machine.created" /* Created */); |
{ | ||
"name": "@zag-js/core", | ||
"version": "0.0.0-dev-20220413175519", | ||
"version": "0.0.0-dev-20220415160434", | ||
"description": "A minimal implementation of xstate fsm for UI machines", | ||
@@ -40,3 +40,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/utils": "^0.0.0-dev-20220413175519", | ||
"@zag-js/utils": "^0.0.0-dev-20220415160434", | ||
"klona": "^2.0.5", | ||
@@ -43,0 +43,0 @@ "valtio": "^1.5.2" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13
226839
122003
2052
9
429