AKASHAorg / secure-webstore

A secure IndexedDB store with built-in encryption
MIT License
44 stars 6 forks source link

#6 feat(typescript): TypeScriptify it #7

Closed Jopie64 closed 4 years ago

Jopie64 commented 4 years ago

Description

This is a follow-up on AKASHAorg/easy-web-crypto#7 in an effort to typescriptify secure-webstore (this project), so it can be used in TypeScript projects like Angular.

In store.ts I also made some code changes outside of just TypeScriptifying it. It makes a bit more use of async-await. This makes the code-flow a bit nicer in my view and it was easier to make it compile in TypeScript this way. Of course the tests still run, but maybe it needs some special attention during review.

Also I renamed src/index.js to src/secure-webstore.ts, so WebPack also names the TypeScript definition output file secure-webstore.d.ts. There's also a generated file called dist/store.d.ts. But since WebPack adds the TypeScript compile output from store.ts to dist/secure-webstore.js too, the store.d.ts file is probably useless for users of this lib. But since this seems only an auxiliary file I think this doesn't matter too much.

Issues that will be closed

6

Testing

Tested with existing tests. They all still succeed.

deiu commented 4 years ago

Looks good! Thanks again for this huge contribution. :)