MCPcopy Create free account
hub / github.com/angular/dev-infra / readOperation

Function readOperation

github-actions/browserstack/set-browserstack-env.js:15292–15359  ·  view source on GitHub ↗
(fr, blob, type, encodingName)

Source from the content-addressed store, hash-verified

15290 return "replacement";
15291 case "unicodefffe":
15292 case "utf-16be":
15293 return "UTF-16BE";
15294 case "csunicode":
15295 case "iso-10646-ucs-2":
15296 case "ucs-2":
15297 case "unicode":
15298 case "unicodefeff":
15299 case "utf-16":
15300 case "utf-16le":
15301 return "UTF-16LE";
15302 case "x-user-defined":
15303 return "x-user-defined";
15304 default:
15305 return "failure";
15306 }
15307 }
15308 module.exports = {
15309 getEncoding
15310 };
15311 }
15312 });
15313
15314 //
15315 var require_util4 = __commonJS({
15316 ""(exports, module) {
15317 "use strict";
15318 var {
15319 kState,
15320 kError,
15321 kResult,
15322 kAborted,
15323 kLastProgressEventFired
15324 } = require_symbols3();
15325 var { ProgressEvent } = require_progressevent();
15326 var { getEncoding } = require_encoding();
15327 var { serializeAMimeType, parseMIMEType } = require_data_url();
15328 var { types } = __require("util");
15329 var { StringDecoder: StringDecoder2 } = __require("string_decoder");
15330 var { btoa } = __require("buffer");
15331 var staticPropertyDescriptors = {
15332 enumerable: true,
15333 writable: false,
15334 configurable: false
15335 };
15336 function readOperation(fr, blob, type, encodingName) {
15337 if (fr[kState] === "loading") {
15338 throw new DOMException("Invalid state", "InvalidStateError");
15339 }
15340 fr[kState] = "loading";
15341 fr[kResult] = null;
15342 fr[kError] = null;
15343 const stream = blob.stream();
15344 const reader = stream.getReader();
15345 const bytes = [];
15346 let chunkPromise = reader.read();
15347 let isFirstChunk = true;
15348 (() => __async(this, null, function* () {
15349 while (!fr[kAborted]) {

Callers 4

readAsArrayBufferMethod · 0.70
readAsBinaryStringMethod · 0.70
readAsTextMethod · 0.70
readAsDataURLMethod · 0.70

Calls 5

__asyncFunction · 0.70
fireAProgressEventFunction · 0.70
packageDataFunction · 0.70
streamMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected