Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ dist
.env
.npmrc
**/.mf
coverage
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Encrypters",
"flagly",
"gracely",
"isly",
"isoly",
"langly",
"paramly",
Expand Down
10 changes: 4 additions & 6 deletions Database/Buffer/Backend/Archivist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,10 @@ export class Archivist {
Archivist.#lastArchived = Promise.resolve(lastChanged)
await this.state.storage.put<string>("lastArchived", lastChanged)
}
return (
{
documents: Array.from((await this.storage.storage.get<Item | Document>(staleKeys)).values()),
changed: staleKeys.join("\n"),
} ?? {}
)
return {
documents: Array.from((await this.storage.storage.get<Item | Document>(staleKeys)).values()),
changed: staleKeys.join("\n"),
}
}
static open(
keyValueNamespace: platform.KVNamespace | undefined,
Expand Down
2 changes: 1 addition & 1 deletion Database/Cursor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export namespace Cursor {
return cryptly.Base64.encode(JSON.stringify(cursor), "url")
}
export function parse(cursor?: string): Cursor | undefined {
return cursor && JSON.parse(new cryptly.TextDecoder().decode(cryptly.Base64.decode(cursor, "url")))
return cursor && JSON.parse(new TextDecoder().decode(cryptly.Base64.decode(cursor, "url")))
}

export function dates(cursor?: Cursor): isoly.Date[] {
Expand Down
2 changes: 1 addition & 1 deletion KeyValueStore/FromPlatform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class FromPlatform<
}

private async range(options: ListOptions): Promise<Continuable<ListItem<V, M>>> {
const firstKey = (options.prefix ?? "") + (options.range && (options.range[0] ?? "")) ?? ""
const firstKey = (options.prefix ?? "") + (options.range && (options.range[0] ?? ""))
const lastKey = options.range && options.range[1] ? (options.prefix ?? "") + options.range[1] : undefined
let search = firstKey.slice(0, -1)

Expand Down
2 changes: 1 addition & 1 deletion KeyValueStore/InMemory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class InMemory<
}) + 1
if (o.cursor && start == 0) {
try {
const cursor = new cryptly.TextDecoder().decode(cryptly.Base64.decode(o.cursor, "url"))
const cursor = new TextDecoder().decode(cryptly.Base64.decode(o.cursor, "url"))
start =
partition.findIndex(([key, value]) => {
return key == cursor
Expand Down
8 changes: 4 additions & 4 deletions KeyValueStore/Indexed/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TimeSpan } from "isoly"
import { isoly } from "isoly"
import { Continuable } from "../Continuable"
import { KeyValueStore } from "../KeyValueStore"
import { ListItem } from "../ListItem"
Expand All @@ -9,8 +9,8 @@ import { partition } from "../partition"
export class Indexed<V, I extends string, M = any> implements KeyValueStore<V, M> {
private constructor(private data: KeyValueStore<V, M>, private indexes: Record<I, Index<V>>) {}
set(key: string, value?: undefined): Promise<void>
set(key: string, value: V, options?: { retention?: TimeSpan; meta?: M }): Promise<void>
async set(key: string, value?: V, options?: { retention?: TimeSpan; meta?: M }): Promise<void> {
set(key: string, value: V, options?: { retention?: isoly.TimeSpan; meta?: M }): Promise<void>
async set(key: string, value?: V, options?: { retention?: isoly.TimeSpan; meta?: M }): Promise<void> {
const old = (await this.data.get(key))?.value
if (value)
await this.data.set(key, value, options)
Expand Down Expand Up @@ -58,7 +58,7 @@ class Index<V> {
value: V | undefined,
oldValue: V | undefined,
key: string,
options?: { retention?: TimeSpan | undefined }
options?: { retention?: isoly.TimeSpan | undefined }
): Promise<void> {
const index = value && this.index(value)
const oldIndex = oldValue && this.index(oldValue)
Expand Down
Loading