Skip to content

Commit

Permalink
0.0.601
Browse files Browse the repository at this point in the history
  • Loading branch information
ivansglazunov committed Oct 3, 2024
1 parent f699fdb commit 712e046
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions imports/packager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Debug from 'debug';
import { DeepClient } from './client.js';
import { _ids, DeepClient } from './client.js';
import type { DeepSerialOperation } from './client.js';
import { Id, Link, minilinks, MinilinksResult } from './minilinks.js';
import { serializeError } from 'serialize-error';
Expand Down Expand Up @@ -1090,8 +1090,13 @@ export class Packager<L extends Link<any>> {
}) {
const deep = this.client;
if (!deep.isId(packageId)) throw new Error('!packageId');
console.log(inserting);
await deep.insert(inserting.map(i => ({ ...i, containerId: packageId })));
const contains = inserting.map((l, i) => {
const r = { type_id: _ids['@deep-foundation/core']['Contain'], from_id: packageId, to_id: l.id, string: l.name };
delete inserting[i].containerId;
delete inserting[i].name;
return r;
});
await deep.insert([...inserting, ...contains]);
for (let u of updating) {
if (u.value) await deep.value(u.id, u.value);
else await deep.update(u.id, { from_id: u.from_id, to_id: u.to_id })
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@deep-foundation/deeplinks",
"version": "0.0.600",
"version": "0.0.601",
"license": "Unlicense",
"type": "module",
"main": "import.js",
Expand Down

0 comments on commit 712e046

Please sign in to comment.