The Web Crypto API is available in all browsers, Node.js, and Deno. This PR assumes that covers the majority of the environments where this polyfill will be used. A simple semi-random v4 formatted string is provided for all other cases. These changes reduce the code and complexity, and should resolve bundler errors stemming from the platform-specific imports and top-level awaits that have now been removed.
Issues
Partial fix for #32
Notes
I had trouble getting things setup on my machine, so I haven't run the tests, though I was able to build at some point along the way. I am currently relying on CI to tell me if I broke anything.
Description
The Web Crypto API is available in all browsers, Node.js, and Deno. This PR assumes that covers the majority of the environments where this polyfill will be used. A simple semi-random v4 formatted string is provided for all other cases. These changes reduce the code and complexity, and should resolve bundler errors stemming from the platform-specific imports and top-level awaits that have now been removed.
Issues
Notes
I had trouble getting things setup on my machine, so I haven't run the tests, though I was able to build at some point along the way. I am currently relying on CI to tell me if I broke anything.
Checklist
yarn build
Next Steps
Once some version of this PR is fixed, I'll follow up with a second PR to address the JSON parse ocde also reference in #32.