@nemigo/storage 2.0.0 → 2.2.0

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.
@@ -74,8 +74,8 @@ export class Vault {
74
74
  //...
75
75
  __upsert(key, pld, timings, now_sec) {
76
76
  // Вычисляем абсолютные времена для сохранения
77
- const Exp = timings.exp !== undefined ? now_sec + timings.exp : undefined;
78
- const Upd = timings.upd !== undefined ? now_sec + timings.upd : undefined;
77
+ const Exp = timings.exp === undefined ? undefined : now_sec + timings.exp;
78
+ const Upd = timings.upd === undefined ? undefined : now_sec + timings.upd;
79
79
  const item = { pld, iat: now_sec, exp: Exp, upd: Upd };
80
80
  return { item, transaction: this.storage.set(key, item, { ttl_seconds: timings.ttl }) };
81
81
  }
package/dist/types.d.ts CHANGED
@@ -21,7 +21,7 @@ export interface ISyncStorage<Delete extends boolean | void = boolean | void> {
21
21
  get<T extends IStorageValue>(name: string): T | undefined;
22
22
  set(name: string, value: IStorageValue, options?: IStorageSetOptions): void;
23
23
  /**
24
- * @return `true`, если оно существовало. Допускаются имплементации без этого
24
+ * @returns `true`, если оно существовало. Допускаются имплементации без этого
25
25
  */
26
26
  delete(name: string): Delete;
27
27
  /**
@@ -36,7 +36,7 @@ export interface IStorage<Delete extends boolean | void = boolean | void> {
36
36
  get<T extends IStorageValue>(name: string): CanBePromise<T | undefined>;
37
37
  set(name: string, value: IStorageValue, options?: IStorageSetOptions): CanBePromise;
38
38
  /**
39
- * @return `true`, если оно существовало. Допускаются имплементации без этого
39
+ * @returns `true`, если оно существовало. Допускаются имплементации без этого
40
40
  */
41
41
  delete(name: string): CanBePromise<Delete>;
42
42
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nemigo/storage",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "private": false,
5
5
  "author": {
6
6
  "name": "Vlad Logvin",
@@ -8,14 +8,12 @@
8
8
  },
9
9
  "type": "module",
10
10
  "scripts": {
11
- "build": "svelte-package && rimraf .svelte-kit",
12
- "check": "tsc --noemit",
13
- "eslint": "eslint ./",
14
- "eslint:fix": "eslint --fix ./",
15
- "lint": "biome lint",
16
- "lint:fix": "biome lint --fix --unsafe",
17
- "lint:fix:unsafe": "biome lint --fix --unsafe",
18
- "format": "biome check --write --linter-enabled=false"
11
+ "build": "bunx --bun svelte-package && bunx --bun rimraf .svelte-kit",
12
+ "check": "bunx --bun tsc --noemit",
13
+ "eslint": "bunx --bun eslint ./",
14
+ "oxlint": "bunx --bun oxlint --config .././../oxlintrc.jsonc --ignore-path ../configs/.eslint.ignore ./",
15
+ "bilint": "bunx --bun biome lint",
16
+ "format": "bunx --bun biome check --write --linter-enabled=false"
19
17
  },
20
18
  "exports": {
21
19
  "./capacity": {
@@ -48,10 +46,10 @@
48
46
  }
49
47
  },
50
48
  "peerDependencies": {
51
- "@nemigo/helpers": ">=2.0.0"
49
+ "@nemigo/helpers": ">=2.2.0"
52
50
  },
53
51
  "devDependencies": {
54
- "@nemigo/configs": "2.0.0",
55
- "@nemigo/helpers": "2.0.0"
52
+ "@nemigo/configs": "2.2.0",
53
+ "@nemigo/helpers": "2.2.0"
56
54
  }
57
55
  }