We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In Node >=15.x, the WebCrypto API allows destructuring of SubtleCrypto methods:
import { webcrypto } from 'crypto'; ... let { importKey, exportKey } = webcrypto.subtle; const keys = await importKey(...);
However, doing this using the liner throws errors (methods and properties called on 'undefined').
A quick workaround is to bind this when destructuring:
this
import { crypto } from "webcrypto-liner"; ... let { importKey } = crypto.subtle; importKey = importKey.bind(crypto.subtle);
Bad code smell though, and side-effects unknown.
The text was updated successfully, but these errors were encountered:
microshine
No branches or pull requests
In Node >=15.x, the WebCrypto API allows destructuring of SubtleCrypto methods:
However, doing this using the liner throws errors (methods and properties called on 'undefined').
A quick workaround is to bind
this
when destructuring:Bad code smell though, and side-effects unknown.
The text was updated successfully, but these errors were encountered: