From 7845740637eb646c0b13dc541f043fd65136fc03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 18 Sep 2020 15:20:55 +0200 Subject: refactor: deno_fetch op crate (#7524) --- cli/rt/01_web_util.js | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'cli/rt/01_web_util.js') 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); -- cgit v1.2.3