Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(layered-storage): add a new storage for options #71

Draft
wants to merge 54 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
d4476da
feat(layered-storage): add a new storage for options
Thomaash Dec 8, 2019
285977d
feat(layered-storage): return off function from on
Thomaash Dec 9, 2019
4b49dc1
docs(layered-storage): add some docs
Thomaash Dec 9, 2019
9fb537a
docs(layered-storage): add yet more docs
Thomaash Dec 11, 2019
357b951
docs(layered-storage): add docs to transactions
Thomaash Dec 12, 2019
353f220
style(layered-storage): rename revert to abort
Thomaash Dec 12, 2019
47bfa2f
docs(layered-storage): finish the docs
Thomaash Dec 12, 2019
bfb7012
test(layered-storage): check that off unbinds listeners
Thomaash Dec 12, 2019
b2f0408
fix(layered-storage): fix unwritten segments being undefined
Thomaash Dec 14, 2019
85ea039
fix(layered-storage): cache the values when accessed
Thomaash Dec 14, 2019
e5d429c
fix(layered-storage): throw for nonnumeric layers
Thomaash Dec 14, 2019
689c154
feat(layered-storage): add console dump method
Thomaash Dec 14, 2019
b6f13b8
fix(layered-storage): purge empty structures
Thomaash Dec 15, 2019
7c4350c
fix(layered-storage): do not create new structures on access
Thomaash Dec 15, 2019
d9eb64c
style: fix linting issues
Thomaash Dec 15, 2019
de132b4
feat(layered-storage): remove events
Thomaash Dec 17, 2019
24beaa2
style(layered-storage): remove unused import
Thomaash Dec 17, 2019
b1787b8
feat(layered-layout): add validation
Thomaash Dec 18, 2019
b64c4fd
perf(layered-storage): do not clean unaffacted cache
Thomaash Dec 23, 2019
4bf2f3a
perf(layered-storage): cache nonexistent values too
Thomaash Dec 25, 2019
80f189c
perf(layered-storage): iterate over cache when clearing it
Thomaash Dec 25, 2019
e87368a
feat(layered-storage): add expanders
Thomaash Dec 26, 2019
1ca06e1
feat(layered-storage): unify validator and expander API
Thomaash Dec 26, 2019
1fed169
feat(layered-storage): add segment cloning
Thomaash Dec 27, 2019
b9b559c
fix(layered-storage): use entries instead of pair
Thomaash Dec 27, 2019
9d61fa2
fix(layered-storage): sort debug output
Thomaash Dec 27, 2019
84f4d27
chore(layered-storage): fix some doc comments
Thomaash Jan 21, 2020
093040f
perf(layered-storage): improve performance
Thomaash Jan 21, 2020
fd2a42e
docs(layered-storage): update outdated comment
Thomaash Jan 21, 2020
84a0144
style(layered-storage): unify the way existence is checked in core
Thomaash Jan 21, 2020
cc0f866
feat(layered-storage): simplify
Thomaash Jan 26, 2020
cc7e879
fix(layered-storage): remove cyclic dep
Thomaash Jan 26, 2020
bf566ec
Merge branch 'master' of github.com:visjs/vis-util into layered-storage
Thomaash May 24, 2020
763c703
style: reformat
Thomaash May 24, 2020
28a1240
style: fix typo in config
Thomaash May 24, 2020
1153f4a
chore: restore package* from master
Thomaash May 24, 2020
41195bd
feat(layered-storage): add export to object
Thomaash May 24, 2020
6b3785b
fix(layered-storage): throw right away in transactions
Thomaash May 24, 2020
d229669
test(layered-storage): fix copy paste error
Thomaash May 24, 2020
d1c16b9
feat(layered-storage): add inheritance
Thomaash May 24, 2020
10367bb
feat(layered-storage): add a basic library of validators
Thomaash May 24, 2020
9175f38
feat(layered-storage)!: use sepparate input and output types
Thomaash May 31, 2020
9089b80
fix(layered-storage): expand keys recursively
Thomaash May 31, 2020
fb0fc8b
feat(layered-storage)!: add DELETE keyword to delete values through set
Thomaash May 31, 2020
ab56402
Merge branch 'master' of github.com:visjs/vis-util into layered-storage
Thomaash May 31, 2020
6c3c545
Merge branch 'master' of github.com:visjs/vis-util into layered-storage
Thomaash Jun 1, 2020
3a4b9f2
Merge branch 'master' of github.com:visjs/vis-util into layered-storage
Thomaash Jun 18, 2020
ab88903
Merge branch 'master' of github.com:visjs/vis-util into layered-storage
Thomaash Aug 9, 2020
edb0996
style(layered-storage): fix linting issues
Thomaash Aug 9, 2020
4d41b96
feat(layered-storage): add delete single layer from segment
Thomaash Aug 9, 2020
81fd0c3
Merge branch 'master' of github.com:visjs/vis-util into layered-storage
Thomaash Aug 9, 2020
15603e8
test: disable DTS testing for now
Thomaash Aug 9, 2020
97deb9b
style(eslint): fix automerging error
Thomaash Aug 9, 2020
501926e
fix(layered-storage): export it
Thomaash Aug 14, 2020
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
17 changes: 16 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ module.exports = {
],

// Disable console log.
"no-console": ["error", { allow: ["info", "warn", "error"] }],
"no-console": [
"error",
{
allow: ["error", "group", "groupCollapsed", "groupEnd", "info", "warn"],
},
],

// This would be a breaking change for little gain. Though there definitely
// is some merit in this.
Expand All @@ -62,6 +67,8 @@ module.exports = {
"@typescript-eslint/explicit-module-boundary-types": "off",
// Empty functions are useful sometimes.
"@typescript-eslint/no-empty-function": "off",
// This would be great if TypeScript was perfect but sometimes tsc can't infer the correct type.
"@typescript-eslint/no-non-null-assertion": "off",
// This is really crazy given the functions in this package.
"@typescript-eslint/no-explicit-any": "off",
// These are hoisted, I have no idea why it reports them by default.
Expand All @@ -85,6 +92,14 @@ module.exports = {
"@typescript-eslint/no-var-requires": "off",
},
},
// TypeScript files
{
files: ["test/**/*.ts"],
rules: {
// This is useful to ignore private property access in a test.
"@typescript-eslint/ban-ts-comment": "off",
},
},
],
settings: {
jsdoc: {
Expand Down
28 changes: 28 additions & 0 deletions __snapshots__/test/package.test.ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,34 @@ exports['Package Exported files 1'] = {
" declarations/entry-standalone.d.ts.map",
" declarations/index.d.ts",
" declarations/index.d.ts.map",
" declarations/layered-storage/common.d.ts",
" declarations/layered-storage/common.d.ts.map",
" declarations/layered-storage/core.d.ts",
" declarations/layered-storage/core.d.ts.map",
" declarations/layered-storage/index.d.ts",
" declarations/layered-storage/index.d.ts.map",
" declarations/layered-storage/layered-storage.d.ts",
" declarations/layered-storage/layered-storage.d.ts.map",
" declarations/layered-storage/segment.d.ts",
" declarations/layered-storage/segment.d.ts.map",
" declarations/layered-storage/transactions.d.ts",
" declarations/layered-storage/transactions.d.ts.map",
" declarations/layered-storage/validator-library/boolean.d.ts",
" declarations/layered-storage/validator-library/boolean.d.ts.map",
" declarations/layered-storage/validator-library/index.d.ts",
" declarations/layered-storage/validator-library/index.d.ts.map",
" declarations/layered-storage/validator-library/number.d.ts",
" declarations/layered-storage/validator-library/number.d.ts.map",
" declarations/layered-storage/validator-library/operators.d.ts",
" declarations/layered-storage/validator-library/operators.d.ts.map",
" declarations/layered-storage/validator-library/other.d.ts",
" declarations/layered-storage/validator-library/other.d.ts.map",
" declarations/layered-storage/validator-library/public-util.d.ts",
" declarations/layered-storage/validator-library/public-util.d.ts.map",
" declarations/layered-storage/validator-library/string.d.ts",
" declarations/layered-storage/validator-library/string.d.ts.map",
" declarations/layered-storage/validator-library/util.d.ts",
" declarations/layered-storage/validator-library/util.d.ts.map",
" declarations/random/alea.d.ts",
" declarations/random/alea.d.ts.map",
" declarations/random/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"test:coverage": "BABEL_ENV=test-cov nyc mocha",
"test:interop": "node interop.js",
"test:interop:debug": "npm run test:interop -- --fail-command \"$SHELL\"",
"test:types:check-dts": "cd test && check-dts",
"test:types:check-dts": "echo disabled for now because tsconfig.json cannot be configured",
"test:types:tsc": "tsc --noemit --project tsconfig.check.json",
"test:unit": "BABEL_ENV=test mocha",
"type-check": "run-s test:types:*",
Expand Down
1 change: 1 addition & 0 deletions src/entry-esnext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from "./deep-object-assign";
export * from "./layered-storage";
export * from "./random";
export * from "./util";
16 changes: 16 additions & 0 deletions src/layered-storage/common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export const LS_DELETE = null;

export type KeyRange = number | string | symbol;
export type LayerRange = number;
export type Segment = boolean | number | object | string | symbol;

export type KeyValueLookup = {
[Key in KeyRange]: any;
};

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