Skip to content

Commit

Permalink
feat(layered-storage): simplify
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Most stuff was changed.

This is a really big overhaul that greatly reduces the API and the
codebase. This should be much easier to maintain and also more
performant when used at the expense of removing support for some niche
features.
  • Loading branch information
Thomaash committed Jan 26, 2020
1 parent 84a0144 commit cc0f866
Show file tree
Hide file tree
Showing 15 changed files with 513 additions and 960 deletions.
20 changes: 11 additions & 9 deletions src/layered-storage/common.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
export type KeyRange = number | string | symbol;
export type KeyValueLookup = Record<KeyRange, any>;
export type LayerRange = number;
export type Segment = boolean | number | object | string | symbol;
export type KeyValueEntry<KV extends KeyValueLookup> = {
[Key in keyof KV]: readonly [Key, KV[Key]];
}[keyof KV];
export type FilteredKeyValueEntry<
KV extends KeyValueLookup,
Keys extends keyof KV

export type KeyValueLookup<Keys extends KeyRange> = Record<
Keys,
boolean | number | object | string | symbol
>;

export type KeyValueEntry<
KV extends object,
Key extends keyof KV = keyof KV
> = {
[Key in Keys]: readonly [Key, KV[Key]];
}[Keys];
[Key in keyof KV]: readonly [Key, KV[Key]];
}[Key];
Loading

0 comments on commit cc0f866

Please sign in to comment.