@inglorious/store 12.9.0 → 12.9.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/store",
3
- "version": "12.9.0",
3
+ "version": "12.9.1",
4
4
  "description": "A state manager for real-time, collaborative apps, inspired by game development patterns and compatible with Redux.",
5
5
  "author": "Matteo Antony Mistretta <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
6
6
  "license": "MIT",
@@ -82,16 +82,16 @@
82
82
  "mutative": "^2.0.2"
83
83
  },
84
84
  "peerDependencies": {
85
- "@inglorious/utils": "^5.4.0"
85
+ "@inglorious/utils": "^5.4.1"
86
86
  },
87
87
  "devDependencies": {
88
88
  "@inglorious/eslint-config": "1.2.0",
89
- "@inglorious/utils": "5.4.0",
90
- "@reduxjs/toolkit": "^2.14.0",
91
- "prettier": "^3.10.0",
89
+ "@inglorious/utils": "5.4.1",
90
+ "@reduxjs/toolkit": "^2.15.0",
91
+ "prettier": "^3.10.1",
92
92
  "typescript": "~7.0.2",
93
93
  "vite": "^8.3.8",
94
- "vitest": "^5.1.0"
94
+ "vitest": "^5.1.1"
95
95
  },
96
96
  "engines": {
97
97
  "node": ">= 26"
@@ -30,7 +30,8 @@ let decorators = 0
30
30
  * @param {() => Storage | undefined} [options.storage] A Web Storage, such as
31
31
  * `() => sessionStorage` for the tab only, or anything with the same
32
32
  * `getItem` and `setItem`, answering now or with a promise. Defaults to
33
- * `localStorage`.
33
+ * the browser's `localStorage`; on a server, where Node's own would be
34
+ * shared by every request, nothing is kept.
34
35
  *
35
36
  * @example
36
37
  * const types = {
@@ -40,7 +41,7 @@ let decorators = 0
40
41
  */
41
42
  export function withStorage(
42
43
  fields,
43
- { key, storage = () => globalThis.localStorage } = {},
44
+ { key, storage = () => globalThis.window?.localStorage } = {},
44
45
  ) {
45
46
  const keyOf = (entity) =>
46
47
  typeof key === "function" ? key(entity) : (key ?? entity.id)