node-consul-service 1.0.17 → 1.0.18
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/consul/dataLink.d.ts +1 -1
- package/dist/index.cjs.js +4 -3
- package/dist/index.esm.js +4 -3
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ interface LinkSchema {
|
|
|
2
2
|
filed: string;
|
|
3
3
|
service: string;
|
|
4
4
|
path: string;
|
|
5
|
-
cacheGetter?: (
|
|
5
|
+
cacheGetter?: (ids: string[]) => Promise<(any | null)[]>;
|
|
6
6
|
}
|
|
7
7
|
export declare function dataLink(data: any[], schema: LinkSchema[]): Promise<any[]>;
|
|
8
8
|
export {};
|
package/dist/index.cjs.js
CHANGED
|
@@ -19422,14 +19422,15 @@ async function dataLink(data, schema) {
|
|
|
19422
19422
|
let cacheMap = new Map();
|
|
19423
19423
|
let idsToFetch = uniqueIds;
|
|
19424
19424
|
if (cacheGetter) {
|
|
19425
|
-
const cacheResults = await
|
|
19425
|
+
const cacheResults = await cacheGetter(uniqueIds);
|
|
19426
19426
|
idsToFetch = [];
|
|
19427
19427
|
cacheResults.forEach((item, index) => {
|
|
19428
|
+
const id = uniqueIds[index];
|
|
19428
19429
|
if (item) {
|
|
19429
|
-
cacheMap.set(
|
|
19430
|
+
cacheMap.set(id, item);
|
|
19430
19431
|
}
|
|
19431
19432
|
else {
|
|
19432
|
-
idsToFetch.push(
|
|
19433
|
+
idsToFetch.push(id);
|
|
19433
19434
|
}
|
|
19434
19435
|
});
|
|
19435
19436
|
}
|
package/dist/index.esm.js
CHANGED
|
@@ -19420,14 +19420,15 @@ async function dataLink(data, schema) {
|
|
|
19420
19420
|
let cacheMap = new Map();
|
|
19421
19421
|
let idsToFetch = uniqueIds;
|
|
19422
19422
|
if (cacheGetter) {
|
|
19423
|
-
const cacheResults = await
|
|
19423
|
+
const cacheResults = await cacheGetter(uniqueIds);
|
|
19424
19424
|
idsToFetch = [];
|
|
19425
19425
|
cacheResults.forEach((item, index) => {
|
|
19426
|
+
const id = uniqueIds[index];
|
|
19426
19427
|
if (item) {
|
|
19427
|
-
cacheMap.set(
|
|
19428
|
+
cacheMap.set(id, item);
|
|
19428
19429
|
}
|
|
19429
19430
|
else {
|
|
19430
|
-
idsToFetch.push(
|
|
19431
|
+
idsToFetch.push(id);
|
|
19431
19432
|
}
|
|
19432
19433
|
});
|
|
19433
19434
|
}
|