Skip to content

Commit a4456bb

Browse files
committed
version
1 parent 6bdda45 commit a4456bb

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
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/ordered-keyvalue-db",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
44
"description": "Ordered keyvalue database type for orbit-db.",
55
"author": "Julien Jean Malard-Adam",
66
"keywords": [

src/utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ export const getScalePosition = async ({
3333
// Insert to beginning of list if there is no preceding entry
3434
// Note: use Math.random() rather than mean to reduce risk of collisions in concurrent edits
3535
if (beforePosition === undefined)
36-
return (afterPosition === undefined ? Math.random() : afterPosition - Math.random());
36+
return afterPosition === undefined
37+
? Math.random()
38+
: afterPosition - Math.random();
3739

3840
// Insert to end of list if there is no following entry, or somewhere between adjacent entries
3941
return afterPosition === undefined

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.3.1";
2+
export const version = "1.3.2";

test/ordered-keyvalue.spec.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -377,12 +377,10 @@ describe("OrderedKeyValue Database", () => {
377377

378378
const actual = await db.all();
379379

380-
// Here we only check the middle value, because we don't know if key0 or key1 was
380+
// Here we only check the middle value, because we don't know if key0 or key1 was
381381
// added first due to the race condition we intentionally introduced above
382-
expect(actual[1]).to.deep.equal(
383-
{ value: "between", key: "in", hash },
384-
);
385-
})
382+
expect(actual[1]).to.deep.equal({ value: "between", key: "in", hash });
383+
});
386384

387385
it("returns all values", async () => {
388386
const keyvalue: {

test/utils.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
export const sortPosition = <T>(array: (T & { position: number})[]): T[] => {
2-
const sorted = array.toSorted((a, b) => a.position - b.position)
3-
return sorted.map(x=>{
4-
delete (x as T & { position?: number})["position"]
5-
return x
6-
})
7-
}
1+
export const sortPosition = <T>(array: (T & { position: number })[]): T[] => {
2+
const sorted = array.toSorted((a, b) => a.position - b.position);
3+
return sorted.map((x) => {
4+
delete (x as T & { position?: number })["position"];
5+
return x;
6+
});
7+
};

0 commit comments

Comments
 (0)