seitu 0.10.10 → 0.10.11

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.
Files changed (2) hide show
  1. package/dist/web.js +12 -11
  2. package/package.json +1 -1
package/dist/web.js CHANGED
@@ -128,13 +128,14 @@ function l(i) {
128
128
  return typeof window < "u" && window.addEventListener("storage", e), () => {
129
129
  typeof window < "u" && window.removeEventListener("storage", e);
130
130
  };
131
- } }), l = () => {
131
+ } }), l, u, d = () => {
132
132
  if (typeof window > "u") return o;
133
133
  let t = window[a].getItem(i.key);
134
- if (t === null) return o;
134
+ if (l !== void 0 && t === l) return u;
135
+ if (l = t, t === null) return u = o, u;
135
136
  let r = n(t);
136
137
  try {
137
- return "schema" in i ? e(i.schema, t, {
138
+ return "schema" in i ? (u = e(i.schema, t, {
138
139
  defaultValue: o,
139
140
  label: `createWebStorageValue:${i.key}`,
140
141
  onError: i.onValidationError ? (e, t) => i.onValidationError({
@@ -142,23 +143,23 @@ function l(i) {
142
143
  issues: [...e],
143
144
  value: t
144
145
  }) : void 0
145
- }) : r;
146
+ }), u) : (u = r, u);
146
147
  } catch {
147
- return o !== void 0 && typeof o != "string" ? o : r;
148
+ return u = o !== void 0 && typeof o != "string" ? o : r, u;
148
149
  }
149
150
  };
150
151
  return {
151
- ...r(l, s, c),
152
+ ...r(d, s, c),
152
153
  set: (e) => {
153
154
  if (typeof window > "u") return;
154
- let t = window[a], n = typeof e == "function" ? e(l()) : e;
155
- t.setItem(i.key, typeof n == "string" ? n : JSON.stringify(n)), window.dispatchEvent(new StorageEvent("storage", {
155
+ let t = window[a], n = typeof e == "function" ? e(d()) : e, r = typeof n == "string" ? n : JSON.stringify(n);
156
+ t.setItem(i.key, r), window.dispatchEvent(new StorageEvent("storage", {
156
157
  key: i.key,
157
- newValue: n
158
- }));
158
+ newValue: r
159
+ })), l = void 0;
159
160
  },
160
161
  remove: () => {
161
- typeof window > "u" || window[a].removeItem(i.key);
162
+ typeof window > "u" || (window[a].removeItem(i.key), l = void 0);
162
163
  }
163
164
  };
164
165
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "seitu",
3
3
  "displayName": "Seitu",
4
4
  "type": "module",
5
- "version": "0.10.10",
5
+ "version": "0.10.11",
6
6
  "private": false,
7
7
  "author": "Valerii Strilets",
8
8
  "license": "MIT",