Skip to content

Commit 8eaef38

Browse files
committed
chore: Updating dependencies and lock file to calm down npm audit
1 parent 2acdea5 commit 8eaef38

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

lib/TextEncoder.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,37 @@ exports.install = (globalObject, globalNames = ["Window"]) => {
109109
return esValue[implSymbol].encode(...args);
110110
}
111111

112+
encodeInto(source, destination) {
113+
const esValue = this !== null && this !== undefined ? this : globalObject;
114+
if (!exports.is(esValue)) {
115+
throw new TypeError("Illegal invocation");
116+
}
117+
118+
if (arguments.length < 2) {
119+
throw new TypeError(
120+
"Failed to execute 'encodeInto' on 'TextEncoder': 2 arguments required, but only " +
121+
arguments.length +
122+
" present."
123+
);
124+
}
125+
const args = [];
126+
{
127+
let curArg = arguments[0];
128+
curArg = conversions["USVString"](curArg, {
129+
context: "Failed to execute 'encodeInto' on 'TextEncoder': parameter 1"
130+
});
131+
args.push(curArg);
132+
}
133+
{
134+
let curArg = arguments[1];
135+
curArg = conversions["Uint8Array"](curArg, {
136+
context: "Failed to execute 'encodeInto' on 'TextEncoder': parameter 2"
137+
});
138+
args.push(curArg);
139+
}
140+
return utils.tryWrapperForImpl(esValue[implSymbol].encodeInto(...args));
141+
}
142+
112143
get encoding() {
113144
const esValue = this !== null && this !== undefined ? this : globalObject;
114145

@@ -121,6 +152,7 @@ exports.install = (globalObject, globalNames = ["Window"]) => {
121152
}
122153
Object.defineProperties(TextEncoder.prototype, {
123154
encode: { enumerable: true },
155+
encodeInto: { enumerable: true },
124156
encoding: { enumerable: true },
125157
[Symbol.toStringTag]: { value: "TextEncoder", configurable: true }
126158
});

0 commit comments

Comments
 (0)