diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-09-18 15:20:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-18 09:20:55 -0400 |
commit | 7845740637eb646c0b13dc541f043fd65136fc03 (patch) | |
tree | 8576a376d72ffdfe4ffed983a2bed9e605d20e8b /cli/rt/01_web_util.js | |
parent | cead79f5b8ffd376d339b6e0c30e872bfe6820f6 (diff) |
refactor: deno_fetch op crate (#7524)
Diffstat (limited to 'cli/rt/01_web_util.js')
-rw-r--r-- | cli/rt/01_web_util.js | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/cli/rt/01_web_util.js b/cli/rt/01_web_util.js index d64ef28c3..1b7f7b83a 100644 --- a/cli/rt/01_web_util.js +++ b/cli/rt/01_web_util.js @@ -1,10 +1,6 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. ((window) => { - function isTypedArray(x) { - return ArrayBuffer.isView(x) && !(x instanceof DataView); - } - function isInvalidDate(x) { return isNaN(x.getTime()); } @@ -149,40 +145,12 @@ } } - function getHeaderValueParams(value) { - const params = new Map(); - // Forced to do so for some Map constructor param mismatch - value - .split(";") - .slice(1) - .map((s) => s.trim().split("=")) - .filter((arr) => arr.length > 1) - .map(([k, v]) => [k, v.replace(/^"([^"]*)"$/, "$1")]) - .forEach(([k, v]) => params.set(k, v)); - return params; - } - - function hasHeaderValueOf(s, value) { - return new RegExp(`^${value}[\t\s]*;?`).test(s); - } - - /** An internal function which provides a function name for some generated - * functions, so stack traces are a bit more readable. - */ - function setFunctionName(fn, value) { - Object.defineProperty(fn, "name", { value, configurable: true }); - } - window.__bootstrap.webUtil = { - isTypedArray, isInvalidDate, requiredArguments, immutableDefine, hasOwnProperty, cloneValue, defineEnumerableProps, - getHeaderValueParams, - hasHeaderValueOf, - setFunctionName, }; })(this); |