value-enhancer
Advanced tools
Comparing version 5.4.4 to 5.4.5
@@ -47,43 +47,2 @@ (function (global, factory) { | ||
// src/dev/customFormatter.ts | ||
function initCustomFormatter() { | ||
if (typeof window === "undefined") { | ||
return; | ||
} | ||
const valStyle = { style: "color:#a225c2" }; | ||
const numberStyle = { style: "color:#268bd2" }; | ||
const stringStyle = { style: "color:#e28c5f" }; | ||
const keywordStyle = { style: "color:#eb2f96" }; | ||
const formatter = { | ||
header: (obj) => isVal(obj) ? [ | ||
"div", | ||
valStyle, | ||
`${isWritable(obj) ? "Val" : "ReadonlyVal"}`, | ||
`<`, | ||
formatValue(obj.value), | ||
`>` | ||
] : null, | ||
hasBody: () => false | ||
}; | ||
function formatValue(v) { | ||
if (typeof v === "number") { | ||
return ["span", numberStyle, v]; | ||
} else if (typeof v === "string") { | ||
return ["span", stringStyle, v]; | ||
} else if (typeof v === "boolean") { | ||
return ["span", keywordStyle, v]; | ||
} else if (typeof v === "object" && v !== null) { | ||
return ["object", { object: v }]; | ||
} else { | ||
return ["span", stringStyle, String(v)]; | ||
} | ||
} | ||
(window.devtoolsFormatters ??= []).push(formatter); | ||
} | ||
// src/dev/index.ts | ||
function initDev() { | ||
initCustomFormatter(); | ||
} | ||
// src/scheduler.ts | ||
@@ -162,8 +121,2 @@ var tick = /* @__PURE__ */ Promise.resolve(); | ||
n = () => { | ||
if (process.env.NODE_ENV !== "production") { | ||
if (this.f) { | ||
console.error(new Error("[val-dev] Updating a disposed val.")); | ||
console.error(this.f); | ||
} | ||
} | ||
this.s |= 4 /* NeedResolveValue */; | ||
@@ -223,5 +176,2 @@ if (this.b.size) { | ||
this.#disposeEffect?.(); | ||
if (process.env.NODE_ENV !== "production") { | ||
this.f = new Error("[val-dev] Val disposed at:"); | ||
} | ||
} | ||
@@ -529,7 +479,2 @@ w(value) { | ||
// src/index.ts | ||
if (process.env.NODE_ENV !== "production") { | ||
initDev(); | ||
} | ||
// src/collections/list.ts | ||
@@ -536,0 +481,0 @@ var ReactiveListImpl = class { |
{ | ||
"name": "value-enhancer", | ||
"version": "5.4.4", | ||
"version": "5.4.5", | ||
"private": false, | ||
@@ -65,2 +65,3 @@ "description": "Enhance value with plain and explicit reactive wrapper. Think of it as hook-style signals.", | ||
"@jest/globals": "^29.5.0", | ||
"@rollup/plugin-replace": "^5.0.7", | ||
"@size-limit/esbuild": "^11.1.4", | ||
@@ -67,0 +68,0 @@ "@size-limit/file": "^11.1.4", |
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
188151
21
5675