MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / decode

Method decode

packages/core/text/text-common.ts:69–81  ·  view source on GitHub ↗
(input: BufferSource)

Source from the content-addressed store, hash-verified

67 }
68
69 public decode(input: BufferSource): string {
70 const buffer = ArrayBuffer.isView(input) ? input.buffer : input;
71 if (Object_prototype_toString.call(buffer) !== ArrayBufferString) {
72 throw Error("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");
73 }
74 const inputAs8 = new Uint8Array(buffer);
75 let resultingString = '';
76 for (let index = 0, len = inputAs8.length | 0; index < len; index = (index + 32768) | 0) {
77 resultingString += String.fromCharCode.apply(0, inputAs8.slice(index, (index + 32768) | 0));
78 }
79
80 return resultingString.replace(/[\xc0-\xff][\x80-\xbf]*/g, decoderReplacer);
81 }
82
83 public toString() {
84 return '[object TextDecoder]';

Callers 8

textMethod · 0.95
readAsTextMethod · 0.95
gen_rsa_oaepFunction · 0.95
fromBase64SyncMethod · 0.80
fromBase64Function · 0.80
atobMethod · 0.80
getFileMethod · 0.80
doInBackgroundMethod · 0.80

Calls 5

replaceMethod · 0.80
ErrorClass · 0.50
callMethod · 0.45
applyMethod · 0.45
sliceMethod · 0.45

Tested by

no test coverage detected