Skip to content

Commit 960765b

Browse files
committed
version
1 parent 28e3d5e commit 960765b

File tree

6 files changed

+12
-32
lines changed

6 files changed

+12
-32
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@orbitdb/nested-db",
3-
"version": "1.0.3",
3+
"version": "1.2.0",
44
"description": "Nested key-value database type for orbit-db.",
55
"author": "Julien Jean Malard-Adam",
66
"keywords": [

src/index.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
export { default as Nested, NestedDatabaseType, NestedApi } from "@/nested.js";
22

3-
export {
4-
flatten,
5-
toNested,
6-
splitKey,
7-
joinKey,
8-
isSubkey,
9-
} from "@/utils.js";
3+
export { flatten, toNested, splitKey, joinKey, isSubkey } from "@/utils.js";
104

115
export { NestedKey, PossiblyNestedValue, NestedValue } from "@/types.js";
126

src/nested.ts

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,8 @@ const Nested =
6666
onUpdate,
6767
});
6868

69-
const {
70-
put,
71-
set,
72-
putNested,
73-
setNested,
74-
get,
75-
del,
76-
iterator,
77-
all,
78-
} = NestedApi({ database });
69+
const { put, set, putNested, setNested, get, del, iterator, all } =
70+
NestedApi({ database });
7971

8072
return {
8173
...database,
@@ -94,7 +86,6 @@ const Nested =
9486
Nested.type = type;
9587

9688
export const NestedApi = ({ database }: { database: InternalDatabase }) => {
97-
9889
const { addOperation, log } = database;
9990

10091
const put = async (
@@ -143,9 +134,7 @@ export const NestedApi = ({ database }: { database: InternalDatabase }) => {
143134
} else {
144135
flattenedEntries = flatten(keyOrObject);
145136
}
146-
return await Promise.all(
147-
flattenedEntries.map((e) => put(e.key, e.value)),
148-
);
137+
return await Promise.all(flattenedEntries.map((e) => put(e.key, e.value)));
149138
};
150139

151140
const iterator = async function* ({
@@ -197,7 +186,7 @@ export const NestedApi = ({ database }: { database: InternalDatabase }) => {
197186
setNested: putNested,
198187
iterator,
199188
all,
200-
}
201-
}
189+
};
190+
};
202191

203192
export default Nested;

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// Generated by genversion.
2-
export const version = "1.0.3";
2+
export const version = "1.2.0";

test/nested.spec.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ describe("Nested Database", () => {
166166
await db.put("a/c", 2);
167167

168168
const actual = await db.all();
169-
expect(actual).to.deep.equal({ a: { b: 1, c: 2 }});
169+
expect(actual).to.deep.equal({ a: { b: 1, c: 2 } });
170170
});
171171

172172
it("get a nested value", async () => {
@@ -196,7 +196,7 @@ describe("Nested Database", () => {
196196
await db.put(["a", "c"], 2);
197197

198198
const actual = await db.all();
199-
expect(actual).to.deep.equal({ a: { b: 1, c: 2 }});
199+
expect(actual).to.deep.equal({ a: { b: 1, c: 2 } });
200200
});
201201

202202
it("remove root key", async () => {
@@ -223,7 +223,7 @@ describe("Nested Database", () => {
223223
await db.putNested({ a: { b: 1, c: 2 } });
224224

225225
const actual = await db.all();
226-
expect(actual).to.deep.equal({ a: { b: 1, c: 2 }});
226+
expect(actual).to.deep.equal({ a: { b: 1, c: 2 } });
227227
});
228228

229229
it("put key nested value", async () => {
@@ -369,5 +369,4 @@ describe("Nested Database", () => {
369369
expect(all.length).to.equal(amount);
370370
});
371371
});
372-
373372
});

test/utils.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
import { expect } from "aegir/chai";
42
import { flatten, isSubkey, joinKey, splitKey, toNested } from "@/utils.js";
53

@@ -74,4 +72,4 @@ describe("Utils", () => {
7472
expect(actual).to.be.false();
7573
});
7674
});
77-
});
75+
});

0 commit comments

Comments
 (0)