aboutsummaryrefslogtreecommitdiffstats
path: root/vanilla/node_modules/whatwg-url/lib/encoding.js
diff options
context:
space:
mode:
Diffstat (limited to 'vanilla/node_modules/whatwg-url/lib/encoding.js')
-rw-r--r--vanilla/node_modules/whatwg-url/lib/encoding.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/vanilla/node_modules/whatwg-url/lib/encoding.js b/vanilla/node_modules/whatwg-url/lib/encoding.js
new file mode 100644
index 0000000..cb66b8f
--- /dev/null
+++ b/vanilla/node_modules/whatwg-url/lib/encoding.js
@@ -0,0 +1,16 @@
+"use strict";
+const utf8Encoder = new TextEncoder();
+const utf8Decoder = new TextDecoder("utf-8", { ignoreBOM: true });
+
+function utf8Encode(string) {
+ return utf8Encoder.encode(string);
+}
+
+function utf8DecodeWithoutBOM(bytes) {
+ return utf8Decoder.decode(bytes);
+}
+
+module.exports = {
+ utf8Encode,
+ utf8DecodeWithoutBOM
+};