0.8.0 • Published 4 years ago

typeson-registry-sca-reverter v0.8.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

typeson-registry-sca-reverter

Dependencies devDependencies npm License

Version 4.0.0 of IndexedDBShim uses a later version of typeson-registry's Structured Cloning Algorithm serialization/parsing format by default.

This small utility allows IndexedDBShim databases created under version 3.0.0 (and thus the earlier typeson-registry format) to be used with version 4.0.0 of IndexedDBShim. (It should also be usable for converting back typeson-registry storage for non-IndexedDBShim uses as well.)

Note that it does not prevent new types added to typeson-registry/IndexedDBShim from being usable (e.g., BigInt), so data stored under the converted form will not be usable on older versions of IndexedDBShim, but it does allow data stored under older versions of IndexedDBShim to continue to be read.

You must set config early, e.g., within the call to setGlobalVars in the non-invasive distribution of IndexedDBShim.

Note that while the code was mostly the same as that working previously within IndexedDBShim, some code has been added without testing, so you ought to do your own testing to confirm.

setGlobalVars(null, {
  registerSCA: typesonRegistrySCAReverter
});

Or you may set the config before any indexedDB calls:

shimIndexedDB.__setConfig({
  registerSCA: typesonRegistrySCAReverter
});
// Safe to use indexedDB now...

To-dos

  1. Add tests
0.8.0

4 years ago

0.7.0

4 years ago

0.6.0

4 years ago

0.4.0

4 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.1

6 years ago

0.1.0

6 years ago