MCPcopy Create free account
hub / github.com/microsoft/SandDance / getResourceContentLength

Function getResourceContentLength

docs/app/js/sanddance-app.js:55358–55365  ·  view source on GitHub ↗
(resource)

Source from the content-addressed store, hash-verified

55356 };
55357}
55358function getResourceContentLength(resource) {
55359 if ((0, _isType.isResponse)(resource)) return resource.headers["content-length"] || -1;
55360 if ((0, _isType.isBlob)(resource)) return resource.size;
55361 if (typeof resource === "string") return resource.length;
55362 if (resource instanceof ArrayBuffer) return resource.byteLength;
55363 if (ArrayBuffer.isView(resource)) return resource.byteLength;
55364 return -1;
55365}
55366function stripQueryString(url) {
55367 return url.replace(QUERY_STRING_PATTERN, "");
55368}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected