@nemigo/storage 1.5.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.
- package/dist/cookie.d.ts +50 -0
- package/dist/cookie.js +51 -0
- package/dist/internal/index.d.ts +1 -0
- package/dist/internal/index.js +10 -0
- package/dist/internal/veil.d.ts +5 -0
- package/dist/internal/veil.js +10 -0
- package/dist/runtime.d.ts +59 -0
- package/dist/runtime.js +116 -0
- package/dist/types.d.ts +38 -0
- package/dist/types.js +1 -0
- package/dist/web.d.ts +28 -0
- package/dist/web.js +64 -0
- package/package.json +53 -0
package/dist/cookie.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { VeilPrefixStorage } from "./internal/veil.js";
|
|
2
|
+
import type { IStorage, IStorageValue, SetIStorageOptions } from "./types.js";
|
|
3
|
+
import type { SetDocumentCookieOptions } from "@nemigo/helpers/html/cookie";
|
|
4
|
+
/**
|
|
5
|
+
* Серверные readonly-куки для {@link CookieStorage}
|
|
6
|
+
*/
|
|
7
|
+
export interface ServerCookie {
|
|
8
|
+
name: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Опции для {@link CookieStorage.set}
|
|
13
|
+
*/
|
|
14
|
+
export interface SetCookieStorageOptions extends SetDocumentCookieOptions, SetIStorageOptions {
|
|
15
|
+
prefix?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Опции для {@link CookieStorage.delete}
|
|
19
|
+
*/
|
|
20
|
+
export interface DeleteCookieStorageOptions {
|
|
21
|
+
Path?: string;
|
|
22
|
+
prefix?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare class CookieStorage extends VeilPrefixStorage implements IStorage {
|
|
25
|
+
__server: Map<string, string>;
|
|
26
|
+
/**
|
|
27
|
+
* TTL (time-to-live) хранилища
|
|
28
|
+
*/
|
|
29
|
+
ttl_seconds?: number | null;
|
|
30
|
+
/**
|
|
31
|
+
* @remarks `options.ttl_seconds === null` делает хранение сессионным!
|
|
32
|
+
*/
|
|
33
|
+
constructor({ cookies, prefix, ttl_seconds }: {
|
|
34
|
+
cookies?: ServerCookie[];
|
|
35
|
+
prefix?: string;
|
|
36
|
+
ttl_seconds?: number | null;
|
|
37
|
+
});
|
|
38
|
+
fill(cookies?: ServerCookie[]): void;
|
|
39
|
+
__unveil<T>(value?: string | null): T | undefined;
|
|
40
|
+
get<T extends IStorageValue>(name: string, prefix?: string): T | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* @remarks `options.ttl_seconds === null` делает хранение сессионным!
|
|
43
|
+
*/
|
|
44
|
+
set(name: string, value: IStorageValue, options?: SetCookieStorageOptions): void;
|
|
45
|
+
delete(name: string, options?: DeleteCookieStorageOptions): void;
|
|
46
|
+
/**
|
|
47
|
+
* Очистка серверных кук
|
|
48
|
+
*/
|
|
49
|
+
destroy(): void;
|
|
50
|
+
}
|
package/dist/cookie.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { VeilPrefixStorage } from "./internal/veil.js";
|
|
2
|
+
import { isSSR } from "@nemigo/helpers/html";
|
|
3
|
+
import { deleteDocumentCookie, getDocumentCookie, setDocumentCookie } from "@nemigo/helpers/html/cookie";
|
|
4
|
+
import { unveil, veil } from "@nemigo/helpers/veil";
|
|
5
|
+
export class CookieStorage extends VeilPrefixStorage {
|
|
6
|
+
__server = new Map();
|
|
7
|
+
/**
|
|
8
|
+
* TTL (time-to-live) хранилища
|
|
9
|
+
*/
|
|
10
|
+
ttl_seconds;
|
|
11
|
+
/**
|
|
12
|
+
* @remarks `options.ttl_seconds === null` делает хранение сессионным!
|
|
13
|
+
*/
|
|
14
|
+
constructor({ cookies, prefix, ttl_seconds }) {
|
|
15
|
+
super(prefix);
|
|
16
|
+
this.fill(cookies);
|
|
17
|
+
this.ttl_seconds = ttl_seconds;
|
|
18
|
+
}
|
|
19
|
+
fill(cookies = []) {
|
|
20
|
+
for (const item of cookies)
|
|
21
|
+
this.__server.set(item.name, item.value);
|
|
22
|
+
}
|
|
23
|
+
//...
|
|
24
|
+
__unveil(value) {
|
|
25
|
+
return value ? unveil(value) : undefined;
|
|
26
|
+
}
|
|
27
|
+
get(name, prefix) {
|
|
28
|
+
const key = this.__toKey(name, prefix);
|
|
29
|
+
return this.__unveil(isSSR ? this.__server.get(key) : getDocumentCookie(key));
|
|
30
|
+
}
|
|
31
|
+
//...
|
|
32
|
+
/**
|
|
33
|
+
* @remarks `options.ttl_seconds === null` делает хранение сессионным!
|
|
34
|
+
*/
|
|
35
|
+
set(name, value, options = {}) {
|
|
36
|
+
if (isSSR)
|
|
37
|
+
return;
|
|
38
|
+
const MaxAge = options.ttl_seconds !== undefined ? options.ttl_seconds : this.ttl_seconds;
|
|
39
|
+
setDocumentCookie(this.__toKey(name, options.prefix), veil(value), { ...options, MaxAge });
|
|
40
|
+
}
|
|
41
|
+
delete(name, options = {}) {
|
|
42
|
+
if (!isSSR)
|
|
43
|
+
deleteDocumentCookie(this.__toKey(name, options.prefix), options.Path);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Очистка серверных кук
|
|
47
|
+
*/
|
|
48
|
+
destroy() {
|
|
49
|
+
this.__server.clear();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getTTL: (entry_in_seconds?: number | null, storage?: number | null) => number | null | undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const getTTL = (entry_in_seconds, storage) => {
|
|
2
|
+
if (entry_in_seconds)
|
|
3
|
+
return Date.now() + entry_in_seconds * 1000;
|
|
4
|
+
if (entry_in_seconds === null)
|
|
5
|
+
return null;
|
|
6
|
+
if (storage)
|
|
7
|
+
return Date.now() + storage;
|
|
8
|
+
if (storage === null)
|
|
9
|
+
return null;
|
|
10
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { IStorage, IStorageValue, SetIStorageOptions } from "./types.js";
|
|
2
|
+
import type { Timestamp } from "@nemigo/helpers/types";
|
|
3
|
+
interface InternalValue {
|
|
4
|
+
value: IStorageValue;
|
|
5
|
+
expired?: Timestamp;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* LRU (Least Recently Used) runtime-хранилище данных, имплементирующее интерфейс {@link IStorage}
|
|
9
|
+
*
|
|
10
|
+
* - Значения удаляются при превышении максимального размера или по истечении заданного TTL
|
|
11
|
+
* - TTL для каждого значения используется из хранилища (если задано), но можно указать и индивидуальное
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const storage = new RuntimeStorage({ max: 2, ttl_minutes: 5 });
|
|
16
|
+
* storage.set('one', 1);
|
|
17
|
+
* storage.set('two', 2);
|
|
18
|
+
* storage.set('three', 3); // Если хранилище переполнено, удалится наименее недавно использованное или устаревшее значение
|
|
19
|
+
* console.log(storage.get('one')); // undefined, если значение устарело или удалено
|
|
20
|
+
* console.log(storage.get('two')); // 2
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare class RuntimeStorage implements IStorage {
|
|
24
|
+
__storage: Map<string, InternalValue>;
|
|
25
|
+
/**
|
|
26
|
+
* Максимальное количество значений в хранилище
|
|
27
|
+
*/
|
|
28
|
+
max: number;
|
|
29
|
+
/**
|
|
30
|
+
* TTL (time-to-live) хранилища в миллисекундах
|
|
31
|
+
*/
|
|
32
|
+
ttl?: number | null;
|
|
33
|
+
/**
|
|
34
|
+
* @param options - Настройки хранилища
|
|
35
|
+
* @param [options.max=200] - Максимальное количество значений в хранилище
|
|
36
|
+
* @param [options.ttl_seconds] - TTL (time-to-live) хранилища в **секундах**
|
|
37
|
+
*/
|
|
38
|
+
constructor({ max, ttl_seconds }?: {
|
|
39
|
+
max?: number;
|
|
40
|
+
ttl_seconds?: number | null;
|
|
41
|
+
});
|
|
42
|
+
__isExpired(entry: InternalValue): boolean;
|
|
43
|
+
get<T = any>(key: string): T | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Устанавливает значение в кэш
|
|
46
|
+
*
|
|
47
|
+
* - Если индивидуальный TTL в **секундах** не указан, используется TTL хранилища (если задано)
|
|
48
|
+
* - Если ключ уже существует, его значение обновляется и перемещается в конец
|
|
49
|
+
* - Если размер хранимых значений превышает максимальное значение, производится очистка устаревших
|
|
50
|
+
* - Если после очистки хранилище всё ещё переполнено, удаляется наименее недавно использованное значение
|
|
51
|
+
*/
|
|
52
|
+
set(key: string, value: any, options?: SetIStorageOptions): void;
|
|
53
|
+
size(): number;
|
|
54
|
+
shake(): void;
|
|
55
|
+
delete(key: string): boolean;
|
|
56
|
+
clear(): void;
|
|
57
|
+
has(key: string): boolean;
|
|
58
|
+
}
|
|
59
|
+
export {};
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { getTTL } from "./internal/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* LRU (Least Recently Used) runtime-хранилище данных, имплементирующее интерфейс {@link IStorage}
|
|
4
|
+
*
|
|
5
|
+
* - Значения удаляются при превышении максимального размера или по истечении заданного TTL
|
|
6
|
+
* - TTL для каждого значения используется из хранилища (если задано), но можно указать и индивидуальное
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const storage = new RuntimeStorage({ max: 2, ttl_minutes: 5 });
|
|
11
|
+
* storage.set('one', 1);
|
|
12
|
+
* storage.set('two', 2);
|
|
13
|
+
* storage.set('three', 3); // Если хранилище переполнено, удалится наименее недавно использованное или устаревшее значение
|
|
14
|
+
* console.log(storage.get('one')); // undefined, если значение устарело или удалено
|
|
15
|
+
* console.log(storage.get('two')); // 2
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export class RuntimeStorage {
|
|
19
|
+
__storage;
|
|
20
|
+
/**
|
|
21
|
+
* Максимальное количество значений в хранилище
|
|
22
|
+
*/
|
|
23
|
+
max;
|
|
24
|
+
/**
|
|
25
|
+
* TTL (time-to-live) хранилища в миллисекундах
|
|
26
|
+
*/
|
|
27
|
+
ttl;
|
|
28
|
+
/**
|
|
29
|
+
* @param options - Настройки хранилища
|
|
30
|
+
* @param [options.max=200] - Максимальное количество значений в хранилище
|
|
31
|
+
* @param [options.ttl_seconds] - TTL (time-to-live) хранилища в **секундах**
|
|
32
|
+
*/
|
|
33
|
+
constructor({ max = 200, ttl_seconds } = {}) {
|
|
34
|
+
this.max = max;
|
|
35
|
+
this.ttl = ttl_seconds ? ttl_seconds * 1000 : ttl_seconds;
|
|
36
|
+
this.__storage = new Map();
|
|
37
|
+
}
|
|
38
|
+
__isExpired(entry) {
|
|
39
|
+
return Boolean(entry.expired && Date.now() > entry.expired);
|
|
40
|
+
}
|
|
41
|
+
get(key) {
|
|
42
|
+
const entry = this.__storage.get(key);
|
|
43
|
+
if (!entry)
|
|
44
|
+
return undefined;
|
|
45
|
+
if (this.__isExpired(entry)) {
|
|
46
|
+
this.__storage.delete(key);
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
// Обновляем порядок использования, чтобы сохранить от LRU-удаления
|
|
50
|
+
this.__storage.delete(key);
|
|
51
|
+
this.__storage.set(key, entry);
|
|
52
|
+
return entry.value;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Устанавливает значение в кэш
|
|
56
|
+
*
|
|
57
|
+
* - Если индивидуальный TTL в **секундах** не указан, используется TTL хранилища (если задано)
|
|
58
|
+
* - Если ключ уже существует, его значение обновляется и перемещается в конец
|
|
59
|
+
* - Если размер хранимых значений превышает максимальное значение, производится очистка устаревших
|
|
60
|
+
* - Если после очистки хранилище всё ещё переполнено, удаляется наименее недавно использованное значение
|
|
61
|
+
*/
|
|
62
|
+
set(key, value, options) {
|
|
63
|
+
if (this.__storage.has(key)) {
|
|
64
|
+
this.__storage.delete(key);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
if (this.__storage.size >= this.max) {
|
|
68
|
+
// Удаляем устаревшие элементы
|
|
69
|
+
for (const existingKey of this.__storage.keys()) {
|
|
70
|
+
const entry = this.__storage.get(existingKey);
|
|
71
|
+
if (!entry || this.__isExpired(entry)) {
|
|
72
|
+
this.__storage.delete(existingKey);
|
|
73
|
+
}
|
|
74
|
+
if (this.__storage.size < this.max)
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
// Если всё ещё переполнен — удаляем LRU
|
|
78
|
+
if (this.__storage.size >= this.max) {
|
|
79
|
+
const firstKey = this.__storage.keys().next().value;
|
|
80
|
+
if (firstKey !== undefined) {
|
|
81
|
+
this.__storage.delete(firstKey);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const expired = getTTL(options?.ttl_seconds, this.ttl);
|
|
87
|
+
this.__storage.set(key, expired ? { value, expired } : { value });
|
|
88
|
+
}
|
|
89
|
+
size() {
|
|
90
|
+
return this.__storage.size;
|
|
91
|
+
}
|
|
92
|
+
shake() {
|
|
93
|
+
for (const existingKey of this.__storage.keys()) {
|
|
94
|
+
const entry = this.__storage.get(existingKey);
|
|
95
|
+
if (!entry || this.__isExpired(entry)) {
|
|
96
|
+
this.__storage.delete(existingKey);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
delete(key) {
|
|
101
|
+
return this.__storage.delete(key);
|
|
102
|
+
}
|
|
103
|
+
clear() {
|
|
104
|
+
this.__storage.clear();
|
|
105
|
+
}
|
|
106
|
+
has(key) {
|
|
107
|
+
const entry = this.__storage.get(key);
|
|
108
|
+
if (!entry)
|
|
109
|
+
return false;
|
|
110
|
+
if (this.__isExpired(entry)) {
|
|
111
|
+
this.__storage.delete(key);
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CanBePromise } from "@nemigo/helpers/types";
|
|
2
|
+
/**
|
|
3
|
+
* Тип значений, которые могут жить в {@link IStorage}
|
|
4
|
+
*/
|
|
5
|
+
export type IStorageValue = object | string | boolean | number | null;
|
|
6
|
+
/**
|
|
7
|
+
* Опции для {@link IStorage.set}
|
|
8
|
+
*/
|
|
9
|
+
export interface SetIStorageOptions {
|
|
10
|
+
/**
|
|
11
|
+
* @remarks `null` поведение может отличаться у разных имплементаций!
|
|
12
|
+
*/
|
|
13
|
+
ttl_seconds?: number | null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Интерфейс для синхронных хранилищ данных для полиморфизма
|
|
17
|
+
*
|
|
18
|
+
* Используется только там, где нельзя использовать {@link IStorage}
|
|
19
|
+
*/
|
|
20
|
+
export interface ISyncStorage {
|
|
21
|
+
get<T extends IStorageValue>(key: string): T | undefined;
|
|
22
|
+
set(key: string, value: IStorageValue, options?: SetIStorageOptions): void;
|
|
23
|
+
/**
|
|
24
|
+
* @return `true`, если оно существовало. Допускаются имплементации без проверки
|
|
25
|
+
*/
|
|
26
|
+
delete(key: string): boolean | void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Интерфейс для всех хранилищ данных для полиморфизма
|
|
30
|
+
*/
|
|
31
|
+
export interface IStorage {
|
|
32
|
+
get<T extends IStorageValue>(key: string): CanBePromise<T | undefined>;
|
|
33
|
+
set(key: string, value: IStorageValue, options?: SetIStorageOptions): CanBePromise;
|
|
34
|
+
/**
|
|
35
|
+
* @return `true`, если оно существовало. Допускаются имплементации без проверки
|
|
36
|
+
*/
|
|
37
|
+
delete(key: string): CanBePromise<boolean | void>;
|
|
38
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/web.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { VeilPrefixStorage } from "./internal/veil.js";
|
|
2
|
+
import type { IStorage, IStorageValue, SetIStorageOptions } from "./types.js";
|
|
3
|
+
export type WebStorageType = "local" | "session";
|
|
4
|
+
export interface WebStorageOptions {
|
|
5
|
+
type?: WebStorageType;
|
|
6
|
+
prefix?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class WebStorage extends VeilPrefixStorage implements IStorage {
|
|
9
|
+
/**
|
|
10
|
+
* TTL (time-to-live) хранилища в миллисекундах
|
|
11
|
+
*/
|
|
12
|
+
ttl?: number | null;
|
|
13
|
+
/**
|
|
14
|
+
* @param options - Настройки хранилища
|
|
15
|
+
* @param [options.ttl_seconds] - TTL (time-to-live) хранилища в **секундах**
|
|
16
|
+
*/
|
|
17
|
+
constructor({ ttl_seconds, prefix }?: {
|
|
18
|
+
prefix?: string;
|
|
19
|
+
ttl_seconds?: number | null;
|
|
20
|
+
});
|
|
21
|
+
__get<T>(storage: Storage, key: string): T | undefined;
|
|
22
|
+
get<T extends IStorageValue>(name: string, options?: WebStorageOptions): T | undefined;
|
|
23
|
+
set(name: string, value: IStorageValue, options?: SetIStorageOptions & WebStorageOptions): void;
|
|
24
|
+
delete(name: string, options?: {
|
|
25
|
+
type?: WebStorageType;
|
|
26
|
+
prefix?: string;
|
|
27
|
+
}): boolean | void;
|
|
28
|
+
}
|
package/dist/web.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { getTTL } from "./internal/index.js";
|
|
2
|
+
import { VeilPrefixStorage } from "./internal/veil.js";
|
|
3
|
+
import { isSSR } from "@nemigo/helpers/html";
|
|
4
|
+
import { unveil, veil } from "@nemigo/helpers/veil";
|
|
5
|
+
export class WebStorage extends VeilPrefixStorage {
|
|
6
|
+
/**
|
|
7
|
+
* TTL (time-to-live) хранилища в миллисекундах
|
|
8
|
+
*/
|
|
9
|
+
ttl;
|
|
10
|
+
/**
|
|
11
|
+
* @param options - Настройки хранилища
|
|
12
|
+
* @param [options.ttl_seconds] - TTL (time-to-live) хранилища в **секундах**
|
|
13
|
+
*/
|
|
14
|
+
constructor({ ttl_seconds, prefix } = {}) {
|
|
15
|
+
super(prefix);
|
|
16
|
+
this.ttl = ttl_seconds ? ttl_seconds * 1000 : ttl_seconds;
|
|
17
|
+
}
|
|
18
|
+
__get(storage, key) {
|
|
19
|
+
const entry = storage.getItem(key);
|
|
20
|
+
if (!entry)
|
|
21
|
+
return;
|
|
22
|
+
const encoded = unveil(entry);
|
|
23
|
+
if (encoded.expired && Date.now() > encoded.expired) {
|
|
24
|
+
storage.removeItem(key);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
return encoded.value;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
get(name, options = {}) {
|
|
31
|
+
if (isSSR)
|
|
32
|
+
return;
|
|
33
|
+
const key = this.__toKey(name, options.prefix);
|
|
34
|
+
if (options.type !== "session") {
|
|
35
|
+
const value = this.__get(localStorage, key);
|
|
36
|
+
if (value)
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
if (options.type !== "local") {
|
|
40
|
+
return this.__get(sessionStorage, key);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
set(name, value, options = {}) {
|
|
44
|
+
if (isSSR)
|
|
45
|
+
return;
|
|
46
|
+
const key = this.__toKey(name, options.prefix);
|
|
47
|
+
const expired = getTTL(options.ttl_seconds, this.ttl);
|
|
48
|
+
const internalValue = expired ? { value, expired } : { value };
|
|
49
|
+
const _value = veil(internalValue);
|
|
50
|
+
if (options.type === "session")
|
|
51
|
+
sessionStorage.setItem(key, _value);
|
|
52
|
+
else
|
|
53
|
+
localStorage.setItem(key, _value);
|
|
54
|
+
}
|
|
55
|
+
delete(name, options = {}) {
|
|
56
|
+
if (isSSR)
|
|
57
|
+
return;
|
|
58
|
+
const key = this.__toKey(name, options.prefix);
|
|
59
|
+
if (options.type !== "session")
|
|
60
|
+
localStorage.removeItem(key);
|
|
61
|
+
if (options.type !== "local")
|
|
62
|
+
sessionStorage.removeItem(key);
|
|
63
|
+
}
|
|
64
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nemigo/storage",
|
|
3
|
+
"version": "1.5.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Vlad Logvin",
|
|
7
|
+
"email": "vlad.logvin84@gmail.com"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=22",
|
|
12
|
+
"pnpm": ">=10.9.0"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "svelte-package && rimraf .svelte-kit",
|
|
16
|
+
"check": "tsc --noemit",
|
|
17
|
+
"lint": "eslint ./",
|
|
18
|
+
"format": "prettier --write ./"
|
|
19
|
+
},
|
|
20
|
+
"exports": {
|
|
21
|
+
"./cookie": {
|
|
22
|
+
"types": "./dist/cookie.d.ts",
|
|
23
|
+
"default": "./dist/cookie.js"
|
|
24
|
+
},
|
|
25
|
+
"./internal": {
|
|
26
|
+
"types": "./dist/internal/index.d.ts",
|
|
27
|
+
"default": "./dist/internal/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./internal/veil": {
|
|
30
|
+
"types": "./dist/internal/veil.d.ts",
|
|
31
|
+
"default": "./dist/internal/veil.js"
|
|
32
|
+
},
|
|
33
|
+
"./runtime": {
|
|
34
|
+
"types": "./dist/runtime.d.ts",
|
|
35
|
+
"default": "./dist/runtime.js"
|
|
36
|
+
},
|
|
37
|
+
"./types": {
|
|
38
|
+
"types": "./dist/types.d.ts",
|
|
39
|
+
"default": "./dist/types.js"
|
|
40
|
+
},
|
|
41
|
+
"./web": {
|
|
42
|
+
"types": "./dist/web.d.ts",
|
|
43
|
+
"default": "./dist/web.js"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@nemigo/helpers": ">=1.5.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@nemigo/configs": "workspace:*",
|
|
51
|
+
"@nemigo/helpers": "workspace:*"
|
|
52
|
+
}
|
|
53
|
+
}
|