diff options
author | Casper Beyer <caspervonb@pm.me> | 2021-06-06 18:57:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-06 12:57:10 +0200 |
commit | 3f9187c366be362a219274ded5be9e679b96af98 (patch) | |
tree | 75dae6273afd4fa8fb300360df18bcbd2914edfc /extensions/crypto/00_webidl.js | |
parent | 633c5aab1f28538dde619fe755f8ec9fa77a3719 (diff) |
feat(extensions/crypto): implement subtle.digest (#10796)
Co-authored-by: Yacine Hmito yacinehmito@users.noreply.github.com
Diffstat (limited to 'extensions/crypto/00_webidl.js')
-rw-r--r-- | extensions/crypto/00_webidl.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/extensions/crypto/00_webidl.js b/extensions/crypto/00_webidl.js new file mode 100644 index 000000000..4545526bf --- /dev/null +++ b/extensions/crypto/00_webidl.js @@ -0,0 +1,26 @@ +// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +"use strict"; + +((window) => { + const webidl = window.__bootstrap.webidl; + webidl.converters["AlgorithmIdentifier"] = (V, opts) => { + // Union for (object or DOMString) + if (typeof V == "object") { + return webidl.converters["object"](V, opts); + } + + return webidl.converters["DOMString"](V, opts); + }; + + const algorithmDictionary = [ + { + key: "name", + converter: webidl.converters["DOMString"], + }, + ]; + + webidl.converters["Algorithm"] = webidl.createDictionaryConverter( + "Algorithm", + algorithmDictionary, + ); +})(this); |