From 62e9cfea3fc5d6eac0c039fce818ec9a59cc2964 Mon Sep 17 00:00:00 2001 From: Ivan S Glazunov Date: Thu, 3 Oct 2024 20:07:21 +0300 Subject: [PATCH] 0.0.594 --- imports/packager.ts | 14 ++++++++------ package.json | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/imports/packager.ts b/imports/packager.ts index 3dc50448..d21e3cba 100644 --- a/imports/packager.ts +++ b/imports/packager.ts @@ -116,7 +116,7 @@ export function sort( return { sorted }; } -export class Packager> { +export class Packager1> { pckg: Package; client: DeepClient; constructor(client: DeepClient) { @@ -995,12 +995,12 @@ export class Packager2> { const errors = []; let idI = 0; - const ids = Array.from(Array(pckg.data.length).keys()).map(id => id+99999999); - // const ids = await deep.reserve(pckg.data.length); + // const ids = Array.from(Array(pckg.data.length).keys()).map(id => id+99999999); + const ids = await deep.reserve(pckg.data.length); const dc = '@deep-foundation/core'; - const packageId = _packageId || ids[idI++]; + const packageId = _packageId || ids[ids.length]; const inserting = []; const updating = []; const remembered: any = {}; @@ -1011,7 +1011,7 @@ export class Packager2> { console.log('remind', itemId); if (!itemId) return 0; if (pckg.strict) return ids[pckg.data.findIndex(l => l.id === itemId)]; - if (remembered[itemId]) return remembered[itemId]; + else if (remembered[itemId]) return remembered[itemId]; else { const item = pckg.data.find(i => i.id == itemId); await fill(item); @@ -1240,4 +1240,6 @@ export class Packager2> { return { errors }; } } -} \ No newline at end of file +} + +export const Packager = Packager2; diff --git a/package.json b/package.json index 1f18eda6..68bdab2f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@deep-foundation/deeplinks", - "version": "0.0.593", + "version": "0.0.594", "license": "Unlicense", "type": "module", "main": "import.js",