@lacqjs/nuxt-dict 0.0.11 → 0.0.12
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/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -7,7 +7,7 @@ export { createDictTranslator } from '../dist/runtime/utils/dict-translator.js';
|
|
|
7
7
|
export { defineDictAdapter } from '../dist/runtime/core/define-adapter.js';
|
|
8
8
|
|
|
9
9
|
const name = "@lacqjs/nuxt-dict";
|
|
10
|
-
const version = "0.0.
|
|
10
|
+
const version = "0.0.12";
|
|
11
11
|
const devDependencies = {
|
|
12
12
|
nuxt: "^4.4.8"};
|
|
13
13
|
const pkg = {
|
|
@@ -257,7 +257,6 @@ declare module '#build/nuxt-dict/adapters' {
|
|
|
257
257
|
stores: sanitizedStores
|
|
258
258
|
};
|
|
259
259
|
_nuxt.options.build.transpile.push(resolver.resolve("./runtime"));
|
|
260
|
-
_nuxt.options.build.transpile.push("dexie");
|
|
261
260
|
addPlugin(resolver.resolve("./runtime/plugins/dict"));
|
|
262
261
|
addImportsDir(resolver.resolve("./runtime/composables"));
|
|
263
262
|
addImports([{ name: "defineDictAdapter", from: resolver.resolve("./runtime/core/define-adapter") }]);
|
|
@@ -129,8 +129,7 @@ export class DictManager {
|
|
|
129
129
|
if (idbEntry) {
|
|
130
130
|
this.memoryCache.set(key, {
|
|
131
131
|
data: idbEntry.data,
|
|
132
|
-
timestamp: Date.now()
|
|
133
|
-
version: idbEntry.version
|
|
132
|
+
timestamp: Date.now()
|
|
134
133
|
});
|
|
135
134
|
return idbEntry.data;
|
|
136
135
|
}
|
|
@@ -147,8 +146,7 @@ export class DictManager {
|
|
|
147
146
|
}
|
|
148
147
|
const cacheEntry = {
|
|
149
148
|
data: entry,
|
|
150
|
-
timestamp: Date.now()
|
|
151
|
-
version: response.version
|
|
149
|
+
timestamp: Date.now()
|
|
152
150
|
};
|
|
153
151
|
this.memoryCache.set(key, cacheEntry);
|
|
154
152
|
try {
|
|
@@ -180,8 +178,7 @@ export class DictManager {
|
|
|
180
178
|
}
|
|
181
179
|
const cacheEntry = {
|
|
182
180
|
data: entry,
|
|
183
|
-
timestamp: Date.now()
|
|
184
|
-
version: response.version
|
|
181
|
+
timestamp: Date.now()
|
|
185
182
|
};
|
|
186
183
|
this.memoryCache.set(key, cacheEntry);
|
|
187
184
|
try {
|
|
@@ -43,14 +43,12 @@ export interface DictEntry {
|
|
|
43
43
|
}
|
|
44
44
|
/** API 返回的字典响应格式 */
|
|
45
45
|
export interface DictResponse {
|
|
46
|
-
version: string;
|
|
47
46
|
data: Record<string, DictEntry>;
|
|
48
47
|
}
|
|
49
48
|
/** IndexedDB 中存储的缓存条目 */
|
|
50
49
|
export interface CacheEntry<T = DictEntry> {
|
|
51
50
|
data: T;
|
|
52
51
|
timestamp: number;
|
|
53
|
-
version: string;
|
|
54
52
|
}
|
|
55
53
|
/**
|
|
56
54
|
* 字典适配器接口,允许用户自定义数据源(REST / GraphQL / 本地文件等)。
|