@inglorious/web 6.31.0 → 6.31.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inglorious/web",
3
- "version": "6.31.0",
3
+ "version": "6.31.1",
4
4
  "description": "A new web framework that leverages the power of the Inglorious Store combined with the performance and simplicity of lit-html.",
5
5
  "author": "Matteo Antony Mistretta <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
6
6
  "contributors": [
@@ -169,18 +169,18 @@
169
169
  },
170
170
  "sideEffects": false,
171
171
  "dependencies": {
172
- "@inglorious/utils": "^5.4.0",
172
+ "@inglorious/utils": "^5.4.1",
173
173
  "@lit-labs/ssr-client": "^1.1.8",
174
174
  "lit-html": "^3.3.3"
175
175
  },
176
176
  "peerDependencies": {
177
- "@inglorious/store": "^12.9.0"
177
+ "@inglorious/store": "^12.9.1"
178
178
  },
179
179
  "devDependencies": {
180
180
  "@inglorious/eslint-config": "1.2.0",
181
- "prettier": "^3.10.0",
181
+ "prettier": "^3.10.1",
182
182
  "typescript": "~7.0.2",
183
- "vitest": "^5.1.0"
183
+ "vitest": "^5.1.1"
184
184
  },
185
185
  "engines": {
186
186
  "node": ">= 26"
@@ -19,9 +19,9 @@ import { isNative } from "../../native/index.js"
19
19
  export function createNativeStorage({ plugin } = {}) {
20
20
  if (!plugin || !isNative()) {
21
21
  return {
22
- getItem: (key) => globalThis.localStorage?.getItem(key) ?? null,
23
- setItem: (key, value) => globalThis.localStorage?.setItem(key, value),
24
- removeItem: (key) => globalThis.localStorage?.removeItem(key),
22
+ getItem: (key) => browserStorage()?.getItem(key) ?? null,
23
+ setItem: (key, value) => browserStorage()?.setItem(key, value),
24
+ removeItem: (key) => browserStorage()?.removeItem(key),
25
25
  }
26
26
  }
27
27
 
@@ -59,3 +59,8 @@ export function createSecureStorage({ plugin } = {}) {
59
59
  removeItem: (key) => plugin.deleteData({ key }),
60
60
  }
61
61
  }
62
+
63
+ // Never Node's own localStorage: on a server it would be shared by every request.
64
+ function browserStorage() {
65
+ return globalThis.window?.localStorage
66
+ }