@zipify/wysiwyg 1.1.1 → 1.2.1-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/actions/lint-css/action.yaml +1 -3
- package/.release-it.json +2 -1
- package/dist/cli.js +3 -3
- package/dist/wysiwyg.css +24 -25
- package/dist/wysiwyg.mjs +641 -618
- package/jest.config.js +3 -0
- package/lib/components/base/Modal.vue +21 -2
- package/lib/components/base/__tests__/Modal.test.js +1 -0
- package/lib/components/toolbar/controls/link/LinkControl.vue +22 -10
- package/lib/components/toolbar/controls/link/LinkControlHeader.vue +3 -3
- package/lib/components/toolbar/controls/link/__tests__/LinkControl.test.js +8 -8
- package/lib/components/toolbar/controls/link/__tests__/LinkControlHeader.test.js +1 -1
- package/lib/components/toolbar/controls/link/composables/useLink.js +10 -6
- package/lib/composables/__tests__/__snapshots__/useEditor.test.js.snap +1 -1
- package/lib/composables/useEditor.js +4 -3
- package/lib/enums/TextSettings.js +2 -0
- package/lib/extensions/FontStyle.js +2 -2
- package/lib/extensions/FontWeight.js +2 -0
- package/lib/extensions/Link.js +13 -15
- package/lib/extensions/StylePreset.js +33 -3
- package/lib/extensions/TextDecoration.js +6 -12
- package/lib/extensions/__tests__/FontFamily.test.js +7 -6
- package/lib/extensions/__tests__/FontWeight.test.js +19 -10
- package/lib/extensions/__tests__/StylePreset.test.js +52 -2
- package/lib/extensions/__tests__/TextDecoration.test.js +11 -40
- package/lib/extensions/__tests__/__snapshots__/Alignment.test.js.snap +2 -2
- package/lib/extensions/__tests__/__snapshots__/BackgroundColor.test.js.snap +1 -1
- package/lib/extensions/__tests__/__snapshots__/FontColor.test.js.snap +1 -1
- package/lib/extensions/__tests__/__snapshots__/FontFamily.test.js.snap +19 -1
- package/lib/extensions/__tests__/__snapshots__/FontSize.test.js.snap +2 -2
- package/lib/extensions/__tests__/__snapshots__/FontStyle.test.js.snap +17 -1
- package/lib/extensions/__tests__/__snapshots__/FontWeight.test.js.snap +26 -1
- package/lib/extensions/__tests__/__snapshots__/LineHeight.test.js.snap +2 -2
- package/lib/extensions/__tests__/__snapshots__/Margin.test.js.snap +2 -2
- package/lib/extensions/__tests__/__snapshots__/StylePreset.test.js.snap +22 -2
- package/lib/extensions/__tests__/__snapshots__/TextDecoration.test.js.snap +3 -46
- package/package.json +22 -22
- package/lib/components/toolbar/controls/link/LinkControlApply.vue +0 -35
- package/node_modules_lambda/acorn-globals/node_modules/.bin/acorn +0 -4
- package/node_modules_lambda/acorn-globals/node_modules/acorn/CHANGELOG.md +0 -620
- package/node_modules_lambda/acorn-globals/node_modules/acorn/LICENSE +0 -21
- package/node_modules_lambda/acorn-globals/node_modules/acorn/README.md +0 -269
- package/node_modules_lambda/acorn-globals/node_modules/acorn/bin/acorn +0 -4
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.d.ts +0 -209
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.js +0 -5186
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.js.map +0 -1
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.mjs +0 -5155
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.mjs.d.ts +0 -2
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.mjs.map +0 -1
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/bin.js +0 -64
- package/node_modules_lambda/acorn-globals/node_modules/acorn/package.json +0 -35
- package/node_modules_lambda/cssstyle/node_modules/cssom/LICENSE.txt +0 -20
- package/node_modules_lambda/cssstyle/node_modules/cssom/README.mdown +0 -67
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSDocumentRule.js +0 -39
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSFontFaceRule.js +0 -36
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSHostRule.js +0 -37
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSImportRule.js +0 -132
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSKeyframeRule.js +0 -37
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSKeyframesRule.js +0 -39
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSMediaRule.js +0 -41
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSOM.js +0 -3
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSRule.js +0 -43
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSStyleDeclaration.js +0 -148
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSStyleRule.js +0 -190
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSStyleSheet.js +0 -88
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSSupportsRule.js +0 -36
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSValue.js +0 -43
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSValueExpression.js +0 -344
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/MatcherList.js +0 -62
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/MediaList.js +0 -61
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/StyleSheet.js +0 -17
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/clone.js +0 -82
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/index.js +0 -21
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/parse.js +0 -464
- package/node_modules_lambda/cssstyle/node_modules/cssom/package.json +0 -18
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/LICENSE.txt +0 -21
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/README.md +0 -106
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/index.js +0 -27
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/Function.js +0 -42
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URL-impl.js +0 -209
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URL.js +0 -442
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URLSearchParams-impl.js +0 -130
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URLSearchParams.js +0 -472
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/VoidFunction.js +0 -26
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/encoding.js +0 -16
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/infra.js +0 -26
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/percent-encoding.js +0 -142
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/url-state-machine.js +0 -1244
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/urlencoded.js +0 -106
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/utils.js +0 -190
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/package.json +0 -58
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/webidl2js-wrapper.js +0 -7
- package/node_modules_lambda/escodegen/node_modules/estraverse/.jshintrc +0 -16
- package/node_modules_lambda/escodegen/node_modules/estraverse/LICENSE.BSD +0 -19
- package/node_modules_lambda/escodegen/node_modules/estraverse/README.md +0 -153
- package/node_modules_lambda/escodegen/node_modules/estraverse/estraverse.js +0 -805
- package/node_modules_lambda/escodegen/node_modules/estraverse/gulpfile.js +0 -70
- package/node_modules_lambda/escodegen/node_modules/estraverse/package.json +0 -40
- package/node_modules_lambda/escodegen/node_modules/levn/LICENSE +0 -22
- package/node_modules_lambda/escodegen/node_modules/levn/README.md +0 -196
- package/node_modules_lambda/escodegen/node_modules/levn/lib/cast.js +0 -298
- package/node_modules_lambda/escodegen/node_modules/levn/lib/coerce.js +0 -285
- package/node_modules_lambda/escodegen/node_modules/levn/lib/index.js +0 -22
- package/node_modules_lambda/escodegen/node_modules/levn/lib/parse-string.js +0 -113
- package/node_modules_lambda/escodegen/node_modules/levn/lib/parse.js +0 -102
- package/node_modules_lambda/escodegen/node_modules/levn/package.json +0 -47
- package/node_modules_lambda/escodegen/node_modules/optionator/CHANGELOG.md +0 -56
- package/node_modules_lambda/escodegen/node_modules/optionator/LICENSE +0 -22
- package/node_modules_lambda/escodegen/node_modules/optionator/README.md +0 -238
- package/node_modules_lambda/escodegen/node_modules/optionator/lib/help.js +0 -260
- package/node_modules_lambda/escodegen/node_modules/optionator/lib/index.js +0 -465
- package/node_modules_lambda/escodegen/node_modules/optionator/lib/util.js +0 -54
- package/node_modules_lambda/escodegen/node_modules/optionator/package.json +0 -44
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/CHANGELOG.md +0 -99
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/LICENSE +0 -22
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/README.md +0 -15
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Func.js +0 -65
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/List.js +0 -686
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Num.js +0 -130
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Obj.js +0 -154
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Str.js +0 -92
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/index.js +0 -178
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/package.json +0 -52
- package/node_modules_lambda/escodegen/node_modules/source-map/CHANGELOG.md +0 -301
- package/node_modules_lambda/escodegen/node_modules/source-map/LICENSE +0 -28
- package/node_modules_lambda/escodegen/node_modules/source-map/README.md +0 -742
- package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.debug.js +0 -3234
- package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.js +0 -3233
- package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.min.js +0 -2
- package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.min.js.map +0 -1
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/array-set.js +0 -121
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/base64-vlq.js +0 -140
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/base64.js +0 -67
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/binary-search.js +0 -111
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/mapping-list.js +0 -79
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/quick-sort.js +0 -114
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/source-map-consumer.js +0 -1145
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/source-map-generator.js +0 -425
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/source-node.js +0 -413
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/util.js +0 -488
- package/node_modules_lambda/escodegen/node_modules/source-map/package.json +0 -73
- package/node_modules_lambda/escodegen/node_modules/source-map/source-map.d.ts +0 -98
- package/node_modules_lambda/escodegen/node_modules/source-map/source-map.js +0 -8
- package/node_modules_lambda/escodegen/node_modules/type-check/LICENSE +0 -22
- package/node_modules_lambda/escodegen/node_modules/type-check/README.md +0 -210
- package/node_modules_lambda/escodegen/node_modules/type-check/lib/check.js +0 -126
- package/node_modules_lambda/escodegen/node_modules/type-check/lib/index.js +0 -16
- package/node_modules_lambda/escodegen/node_modules/type-check/lib/parse-type.js +0 -196
- package/node_modules_lambda/escodegen/node_modules/type-check/package.json +0 -40
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/.github/dependabot.yml +0 -11
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/Changelog.md +0 -212
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/LICENSE +0 -21
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/README.md +0 -130
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -597
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/dbcs-data.js +0 -188
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/index.js +0 -23
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/internal.js +0 -198
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -72
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -451
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-data.js +0 -179
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/big5-added.json +0 -122
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp936.json +0 -264
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp949.json +0 -273
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp950.json +0 -177
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/eucjp.json +0 -182
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +0 -1
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/gbk-added.json +0 -56
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/shiftjis.json +0 -125
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/utf16.js +0 -197
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/utf32.js +0 -319
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/utf7.js +0 -290
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/bom-handling.js +0 -52
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/index.d.ts +0 -41
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/index.js +0 -180
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/streams.js +0 -109
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/package.json +0 -44
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const urlencoded = require("./urlencoded");
|
|
3
|
-
|
|
4
|
-
exports.implementation = class URLSearchParamsImpl {
|
|
5
|
-
constructor(globalObject, constructorArgs, { doNotStripQMark = false }) {
|
|
6
|
-
let init = constructorArgs[0];
|
|
7
|
-
this._list = [];
|
|
8
|
-
this._url = null;
|
|
9
|
-
|
|
10
|
-
if (!doNotStripQMark && typeof init === "string" && init[0] === "?") {
|
|
11
|
-
init = init.slice(1);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (Array.isArray(init)) {
|
|
15
|
-
for (const pair of init) {
|
|
16
|
-
if (pair.length !== 2) {
|
|
17
|
-
throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element does not " +
|
|
18
|
-
"contain exactly two elements.");
|
|
19
|
-
}
|
|
20
|
-
this._list.push([pair[0], pair[1]]);
|
|
21
|
-
}
|
|
22
|
-
} else if (typeof init === "object" && Object.getPrototypeOf(init) === null) {
|
|
23
|
-
for (const name of Object.keys(init)) {
|
|
24
|
-
const value = init[name];
|
|
25
|
-
this._list.push([name, value]);
|
|
26
|
-
}
|
|
27
|
-
} else {
|
|
28
|
-
this._list = urlencoded.parseUrlencodedString(init);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
_updateSteps() {
|
|
33
|
-
if (this._url !== null) {
|
|
34
|
-
let query = urlencoded.serializeUrlencoded(this._list);
|
|
35
|
-
if (query === "") {
|
|
36
|
-
query = null;
|
|
37
|
-
}
|
|
38
|
-
this._url._url.query = query;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
append(name, value) {
|
|
43
|
-
this._list.push([name, value]);
|
|
44
|
-
this._updateSteps();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
delete(name) {
|
|
48
|
-
let i = 0;
|
|
49
|
-
while (i < this._list.length) {
|
|
50
|
-
if (this._list[i][0] === name) {
|
|
51
|
-
this._list.splice(i, 1);
|
|
52
|
-
} else {
|
|
53
|
-
i++;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
this._updateSteps();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
get(name) {
|
|
60
|
-
for (const tuple of this._list) {
|
|
61
|
-
if (tuple[0] === name) {
|
|
62
|
-
return tuple[1];
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
getAll(name) {
|
|
69
|
-
const output = [];
|
|
70
|
-
for (const tuple of this._list) {
|
|
71
|
-
if (tuple[0] === name) {
|
|
72
|
-
output.push(tuple[1]);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return output;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
has(name) {
|
|
79
|
-
for (const tuple of this._list) {
|
|
80
|
-
if (tuple[0] === name) {
|
|
81
|
-
return true;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
set(name, value) {
|
|
88
|
-
let found = false;
|
|
89
|
-
let i = 0;
|
|
90
|
-
while (i < this._list.length) {
|
|
91
|
-
if (this._list[i][0] === name) {
|
|
92
|
-
if (found) {
|
|
93
|
-
this._list.splice(i, 1);
|
|
94
|
-
} else {
|
|
95
|
-
found = true;
|
|
96
|
-
this._list[i][1] = value;
|
|
97
|
-
i++;
|
|
98
|
-
}
|
|
99
|
-
} else {
|
|
100
|
-
i++;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
if (!found) {
|
|
104
|
-
this._list.push([name, value]);
|
|
105
|
-
}
|
|
106
|
-
this._updateSteps();
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
sort() {
|
|
110
|
-
this._list.sort((a, b) => {
|
|
111
|
-
if (a[0] < b[0]) {
|
|
112
|
-
return -1;
|
|
113
|
-
}
|
|
114
|
-
if (a[0] > b[0]) {
|
|
115
|
-
return 1;
|
|
116
|
-
}
|
|
117
|
-
return 0;
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
this._updateSteps();
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
[Symbol.iterator]() {
|
|
124
|
-
return this._list[Symbol.iterator]();
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
toString() {
|
|
128
|
-
return urlencoded.serializeUrlencoded(this._list);
|
|
129
|
-
}
|
|
130
|
-
};
|
|
@@ -1,472 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const conversions = require("webidl-conversions");
|
|
4
|
-
const utils = require("./utils.js");
|
|
5
|
-
|
|
6
|
-
const Function = require("./Function.js");
|
|
7
|
-
const newObjectInRealm = utils.newObjectInRealm;
|
|
8
|
-
const implSymbol = utils.implSymbol;
|
|
9
|
-
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
|
10
|
-
|
|
11
|
-
const interfaceName = "URLSearchParams";
|
|
12
|
-
|
|
13
|
-
exports.is = value => {
|
|
14
|
-
return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
|
15
|
-
};
|
|
16
|
-
exports.isImpl = value => {
|
|
17
|
-
return utils.isObject(value) && value instanceof Impl.implementation;
|
|
18
|
-
};
|
|
19
|
-
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
|
20
|
-
if (exports.is(value)) {
|
|
21
|
-
return utils.implForWrapper(value);
|
|
22
|
-
}
|
|
23
|
-
throw new globalObject.TypeError(`${context} is not of type 'URLSearchParams'.`);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
exports.createDefaultIterator = (globalObject, target, kind) => {
|
|
27
|
-
const ctorRegistry = globalObject[ctorRegistrySymbol];
|
|
28
|
-
const iteratorPrototype = ctorRegistry["URLSearchParams Iterator"];
|
|
29
|
-
const iterator = Object.create(iteratorPrototype);
|
|
30
|
-
Object.defineProperty(iterator, utils.iterInternalSymbol, {
|
|
31
|
-
value: { target, kind, index: 0 },
|
|
32
|
-
configurable: true
|
|
33
|
-
});
|
|
34
|
-
return iterator;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
function makeWrapper(globalObject, newTarget) {
|
|
38
|
-
let proto;
|
|
39
|
-
if (newTarget !== undefined) {
|
|
40
|
-
proto = newTarget.prototype;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (!utils.isObject(proto)) {
|
|
44
|
-
proto = globalObject[ctorRegistrySymbol]["URLSearchParams"].prototype;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return Object.create(proto);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
exports.create = (globalObject, constructorArgs, privateData) => {
|
|
51
|
-
const wrapper = makeWrapper(globalObject);
|
|
52
|
-
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
|
56
|
-
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
|
57
|
-
return utils.implForWrapper(wrapper);
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
exports._internalSetup = (wrapper, globalObject) => {};
|
|
61
|
-
|
|
62
|
-
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
|
63
|
-
privateData.wrapper = wrapper;
|
|
64
|
-
|
|
65
|
-
exports._internalSetup(wrapper, globalObject);
|
|
66
|
-
Object.defineProperty(wrapper, implSymbol, {
|
|
67
|
-
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
|
68
|
-
configurable: true
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
|
72
|
-
if (Impl.init) {
|
|
73
|
-
Impl.init(wrapper[implSymbol]);
|
|
74
|
-
}
|
|
75
|
-
return wrapper;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
exports.new = (globalObject, newTarget) => {
|
|
79
|
-
const wrapper = makeWrapper(globalObject, newTarget);
|
|
80
|
-
|
|
81
|
-
exports._internalSetup(wrapper, globalObject);
|
|
82
|
-
Object.defineProperty(wrapper, implSymbol, {
|
|
83
|
-
value: Object.create(Impl.implementation.prototype),
|
|
84
|
-
configurable: true
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
|
88
|
-
if (Impl.init) {
|
|
89
|
-
Impl.init(wrapper[implSymbol]);
|
|
90
|
-
}
|
|
91
|
-
return wrapper[implSymbol];
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
const exposed = new Set(["Window", "Worker"]);
|
|
95
|
-
|
|
96
|
-
exports.install = (globalObject, globalNames) => {
|
|
97
|
-
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
|
102
|
-
class URLSearchParams {
|
|
103
|
-
constructor() {
|
|
104
|
-
const args = [];
|
|
105
|
-
{
|
|
106
|
-
let curArg = arguments[0];
|
|
107
|
-
if (curArg !== undefined) {
|
|
108
|
-
if (utils.isObject(curArg)) {
|
|
109
|
-
if (curArg[Symbol.iterator] !== undefined) {
|
|
110
|
-
if (!utils.isObject(curArg)) {
|
|
111
|
-
throw new globalObject.TypeError(
|
|
112
|
-
"Failed to construct 'URLSearchParams': parameter 1" + " sequence" + " is not an iterable object."
|
|
113
|
-
);
|
|
114
|
-
} else {
|
|
115
|
-
const V = [];
|
|
116
|
-
const tmp = curArg;
|
|
117
|
-
for (let nextItem of tmp) {
|
|
118
|
-
if (!utils.isObject(nextItem)) {
|
|
119
|
-
throw new globalObject.TypeError(
|
|
120
|
-
"Failed to construct 'URLSearchParams': parameter 1" +
|
|
121
|
-
" sequence" +
|
|
122
|
-
"'s element" +
|
|
123
|
-
" is not an iterable object."
|
|
124
|
-
);
|
|
125
|
-
} else {
|
|
126
|
-
const V = [];
|
|
127
|
-
const tmp = nextItem;
|
|
128
|
-
for (let nextItem of tmp) {
|
|
129
|
-
nextItem = conversions["USVString"](nextItem, {
|
|
130
|
-
context:
|
|
131
|
-
"Failed to construct 'URLSearchParams': parameter 1" +
|
|
132
|
-
" sequence" +
|
|
133
|
-
"'s element" +
|
|
134
|
-
"'s element",
|
|
135
|
-
globals: globalObject
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
V.push(nextItem);
|
|
139
|
-
}
|
|
140
|
-
nextItem = V;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
V.push(nextItem);
|
|
144
|
-
}
|
|
145
|
-
curArg = V;
|
|
146
|
-
}
|
|
147
|
-
} else {
|
|
148
|
-
if (!utils.isObject(curArg)) {
|
|
149
|
-
throw new globalObject.TypeError(
|
|
150
|
-
"Failed to construct 'URLSearchParams': parameter 1" + " record" + " is not an object."
|
|
151
|
-
);
|
|
152
|
-
} else {
|
|
153
|
-
const result = Object.create(null);
|
|
154
|
-
for (const key of Reflect.ownKeys(curArg)) {
|
|
155
|
-
const desc = Object.getOwnPropertyDescriptor(curArg, key);
|
|
156
|
-
if (desc && desc.enumerable) {
|
|
157
|
-
let typedKey = key;
|
|
158
|
-
|
|
159
|
-
typedKey = conversions["USVString"](typedKey, {
|
|
160
|
-
context: "Failed to construct 'URLSearchParams': parameter 1" + " record" + "'s key",
|
|
161
|
-
globals: globalObject
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
let typedValue = curArg[key];
|
|
165
|
-
|
|
166
|
-
typedValue = conversions["USVString"](typedValue, {
|
|
167
|
-
context: "Failed to construct 'URLSearchParams': parameter 1" + " record" + "'s value",
|
|
168
|
-
globals: globalObject
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
result[typedKey] = typedValue;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
curArg = result;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
} else {
|
|
178
|
-
curArg = conversions["USVString"](curArg, {
|
|
179
|
-
context: "Failed to construct 'URLSearchParams': parameter 1",
|
|
180
|
-
globals: globalObject
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
} else {
|
|
184
|
-
curArg = "";
|
|
185
|
-
}
|
|
186
|
-
args.push(curArg);
|
|
187
|
-
}
|
|
188
|
-
return exports.setup(Object.create(new.target.prototype), globalObject, args);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
append(name, value) {
|
|
192
|
-
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
193
|
-
if (!exports.is(esValue)) {
|
|
194
|
-
throw new globalObject.TypeError(
|
|
195
|
-
"'append' called on an object that is not a valid instance of URLSearchParams."
|
|
196
|
-
);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
if (arguments.length < 2) {
|
|
200
|
-
throw new globalObject.TypeError(
|
|
201
|
-
`Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.`
|
|
202
|
-
);
|
|
203
|
-
}
|
|
204
|
-
const args = [];
|
|
205
|
-
{
|
|
206
|
-
let curArg = arguments[0];
|
|
207
|
-
curArg = conversions["USVString"](curArg, {
|
|
208
|
-
context: "Failed to execute 'append' on 'URLSearchParams': parameter 1",
|
|
209
|
-
globals: globalObject
|
|
210
|
-
});
|
|
211
|
-
args.push(curArg);
|
|
212
|
-
}
|
|
213
|
-
{
|
|
214
|
-
let curArg = arguments[1];
|
|
215
|
-
curArg = conversions["USVString"](curArg, {
|
|
216
|
-
context: "Failed to execute 'append' on 'URLSearchParams': parameter 2",
|
|
217
|
-
globals: globalObject
|
|
218
|
-
});
|
|
219
|
-
args.push(curArg);
|
|
220
|
-
}
|
|
221
|
-
return utils.tryWrapperForImpl(esValue[implSymbol].append(...args));
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
delete(name) {
|
|
225
|
-
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
226
|
-
if (!exports.is(esValue)) {
|
|
227
|
-
throw new globalObject.TypeError(
|
|
228
|
-
"'delete' called on an object that is not a valid instance of URLSearchParams."
|
|
229
|
-
);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
if (arguments.length < 1) {
|
|
233
|
-
throw new globalObject.TypeError(
|
|
234
|
-
`Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`
|
|
235
|
-
);
|
|
236
|
-
}
|
|
237
|
-
const args = [];
|
|
238
|
-
{
|
|
239
|
-
let curArg = arguments[0];
|
|
240
|
-
curArg = conversions["USVString"](curArg, {
|
|
241
|
-
context: "Failed to execute 'delete' on 'URLSearchParams': parameter 1",
|
|
242
|
-
globals: globalObject
|
|
243
|
-
});
|
|
244
|
-
args.push(curArg);
|
|
245
|
-
}
|
|
246
|
-
return utils.tryWrapperForImpl(esValue[implSymbol].delete(...args));
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
get(name) {
|
|
250
|
-
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
251
|
-
if (!exports.is(esValue)) {
|
|
252
|
-
throw new globalObject.TypeError("'get' called on an object that is not a valid instance of URLSearchParams.");
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
if (arguments.length < 1) {
|
|
256
|
-
throw new globalObject.TypeError(
|
|
257
|
-
`Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`
|
|
258
|
-
);
|
|
259
|
-
}
|
|
260
|
-
const args = [];
|
|
261
|
-
{
|
|
262
|
-
let curArg = arguments[0];
|
|
263
|
-
curArg = conversions["USVString"](curArg, {
|
|
264
|
-
context: "Failed to execute 'get' on 'URLSearchParams': parameter 1",
|
|
265
|
-
globals: globalObject
|
|
266
|
-
});
|
|
267
|
-
args.push(curArg);
|
|
268
|
-
}
|
|
269
|
-
return esValue[implSymbol].get(...args);
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
getAll(name) {
|
|
273
|
-
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
274
|
-
if (!exports.is(esValue)) {
|
|
275
|
-
throw new globalObject.TypeError(
|
|
276
|
-
"'getAll' called on an object that is not a valid instance of URLSearchParams."
|
|
277
|
-
);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
if (arguments.length < 1) {
|
|
281
|
-
throw new globalObject.TypeError(
|
|
282
|
-
`Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`
|
|
283
|
-
);
|
|
284
|
-
}
|
|
285
|
-
const args = [];
|
|
286
|
-
{
|
|
287
|
-
let curArg = arguments[0];
|
|
288
|
-
curArg = conversions["USVString"](curArg, {
|
|
289
|
-
context: "Failed to execute 'getAll' on 'URLSearchParams': parameter 1",
|
|
290
|
-
globals: globalObject
|
|
291
|
-
});
|
|
292
|
-
args.push(curArg);
|
|
293
|
-
}
|
|
294
|
-
return utils.tryWrapperForImpl(esValue[implSymbol].getAll(...args));
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
has(name) {
|
|
298
|
-
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
299
|
-
if (!exports.is(esValue)) {
|
|
300
|
-
throw new globalObject.TypeError("'has' called on an object that is not a valid instance of URLSearchParams.");
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
if (arguments.length < 1) {
|
|
304
|
-
throw new globalObject.TypeError(
|
|
305
|
-
`Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.`
|
|
306
|
-
);
|
|
307
|
-
}
|
|
308
|
-
const args = [];
|
|
309
|
-
{
|
|
310
|
-
let curArg = arguments[0];
|
|
311
|
-
curArg = conversions["USVString"](curArg, {
|
|
312
|
-
context: "Failed to execute 'has' on 'URLSearchParams': parameter 1",
|
|
313
|
-
globals: globalObject
|
|
314
|
-
});
|
|
315
|
-
args.push(curArg);
|
|
316
|
-
}
|
|
317
|
-
return esValue[implSymbol].has(...args);
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
set(name, value) {
|
|
321
|
-
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
322
|
-
if (!exports.is(esValue)) {
|
|
323
|
-
throw new globalObject.TypeError("'set' called on an object that is not a valid instance of URLSearchParams.");
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
if (arguments.length < 2) {
|
|
327
|
-
throw new globalObject.TypeError(
|
|
328
|
-
`Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.`
|
|
329
|
-
);
|
|
330
|
-
}
|
|
331
|
-
const args = [];
|
|
332
|
-
{
|
|
333
|
-
let curArg = arguments[0];
|
|
334
|
-
curArg = conversions["USVString"](curArg, {
|
|
335
|
-
context: "Failed to execute 'set' on 'URLSearchParams': parameter 1",
|
|
336
|
-
globals: globalObject
|
|
337
|
-
});
|
|
338
|
-
args.push(curArg);
|
|
339
|
-
}
|
|
340
|
-
{
|
|
341
|
-
let curArg = arguments[1];
|
|
342
|
-
curArg = conversions["USVString"](curArg, {
|
|
343
|
-
context: "Failed to execute 'set' on 'URLSearchParams': parameter 2",
|
|
344
|
-
globals: globalObject
|
|
345
|
-
});
|
|
346
|
-
args.push(curArg);
|
|
347
|
-
}
|
|
348
|
-
return utils.tryWrapperForImpl(esValue[implSymbol].set(...args));
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
sort() {
|
|
352
|
-
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
353
|
-
if (!exports.is(esValue)) {
|
|
354
|
-
throw new globalObject.TypeError("'sort' called on an object that is not a valid instance of URLSearchParams.");
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
return utils.tryWrapperForImpl(esValue[implSymbol].sort());
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
toString() {
|
|
361
|
-
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
362
|
-
if (!exports.is(esValue)) {
|
|
363
|
-
throw new globalObject.TypeError(
|
|
364
|
-
"'toString' called on an object that is not a valid instance of URLSearchParams."
|
|
365
|
-
);
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
return esValue[implSymbol].toString();
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
keys() {
|
|
372
|
-
if (!exports.is(this)) {
|
|
373
|
-
throw new globalObject.TypeError("'keys' called on an object that is not a valid instance of URLSearchParams.");
|
|
374
|
-
}
|
|
375
|
-
return exports.createDefaultIterator(globalObject, this, "key");
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
values() {
|
|
379
|
-
if (!exports.is(this)) {
|
|
380
|
-
throw new globalObject.TypeError(
|
|
381
|
-
"'values' called on an object that is not a valid instance of URLSearchParams."
|
|
382
|
-
);
|
|
383
|
-
}
|
|
384
|
-
return exports.createDefaultIterator(globalObject, this, "value");
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
entries() {
|
|
388
|
-
if (!exports.is(this)) {
|
|
389
|
-
throw new globalObject.TypeError(
|
|
390
|
-
"'entries' called on an object that is not a valid instance of URLSearchParams."
|
|
391
|
-
);
|
|
392
|
-
}
|
|
393
|
-
return exports.createDefaultIterator(globalObject, this, "key+value");
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
forEach(callback) {
|
|
397
|
-
if (!exports.is(this)) {
|
|
398
|
-
throw new globalObject.TypeError(
|
|
399
|
-
"'forEach' called on an object that is not a valid instance of URLSearchParams."
|
|
400
|
-
);
|
|
401
|
-
}
|
|
402
|
-
if (arguments.length < 1) {
|
|
403
|
-
throw new globalObject.TypeError(
|
|
404
|
-
"Failed to execute 'forEach' on 'iterable': 1 argument required, but only 0 present."
|
|
405
|
-
);
|
|
406
|
-
}
|
|
407
|
-
callback = Function.convert(globalObject, callback, {
|
|
408
|
-
context: "Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1"
|
|
409
|
-
});
|
|
410
|
-
const thisArg = arguments[1];
|
|
411
|
-
let pairs = Array.from(this[implSymbol]);
|
|
412
|
-
let i = 0;
|
|
413
|
-
while (i < pairs.length) {
|
|
414
|
-
const [key, value] = pairs[i].map(utils.tryWrapperForImpl);
|
|
415
|
-
callback.call(thisArg, value, key, this);
|
|
416
|
-
pairs = Array.from(this[implSymbol]);
|
|
417
|
-
i++;
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
Object.defineProperties(URLSearchParams.prototype, {
|
|
422
|
-
append: { enumerable: true },
|
|
423
|
-
delete: { enumerable: true },
|
|
424
|
-
get: { enumerable: true },
|
|
425
|
-
getAll: { enumerable: true },
|
|
426
|
-
has: { enumerable: true },
|
|
427
|
-
set: { enumerable: true },
|
|
428
|
-
sort: { enumerable: true },
|
|
429
|
-
toString: { enumerable: true },
|
|
430
|
-
keys: { enumerable: true },
|
|
431
|
-
values: { enumerable: true },
|
|
432
|
-
entries: { enumerable: true },
|
|
433
|
-
forEach: { enumerable: true },
|
|
434
|
-
[Symbol.toStringTag]: { value: "URLSearchParams", configurable: true },
|
|
435
|
-
[Symbol.iterator]: { value: URLSearchParams.prototype.entries, configurable: true, writable: true }
|
|
436
|
-
});
|
|
437
|
-
ctorRegistry[interfaceName] = URLSearchParams;
|
|
438
|
-
|
|
439
|
-
ctorRegistry["URLSearchParams Iterator"] = Object.create(ctorRegistry["%IteratorPrototype%"], {
|
|
440
|
-
[Symbol.toStringTag]: {
|
|
441
|
-
configurable: true,
|
|
442
|
-
value: "URLSearchParams Iterator"
|
|
443
|
-
}
|
|
444
|
-
});
|
|
445
|
-
utils.define(ctorRegistry["URLSearchParams Iterator"], {
|
|
446
|
-
next() {
|
|
447
|
-
const internal = this && this[utils.iterInternalSymbol];
|
|
448
|
-
if (!internal) {
|
|
449
|
-
throw new globalObject.TypeError("next() called on a value that is not a URLSearchParams iterator object");
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
const { target, kind, index } = internal;
|
|
453
|
-
const values = Array.from(target[implSymbol]);
|
|
454
|
-
const len = values.length;
|
|
455
|
-
if (index >= len) {
|
|
456
|
-
return newObjectInRealm(globalObject, { value: undefined, done: true });
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
const pair = values[index];
|
|
460
|
-
internal.index = index + 1;
|
|
461
|
-
return newObjectInRealm(globalObject, utils.iteratorResult(pair.map(utils.tryWrapperForImpl), kind));
|
|
462
|
-
}
|
|
463
|
-
});
|
|
464
|
-
|
|
465
|
-
Object.defineProperty(globalObject, interfaceName, {
|
|
466
|
-
configurable: true,
|
|
467
|
-
writable: true,
|
|
468
|
-
value: URLSearchParams
|
|
469
|
-
});
|
|
470
|
-
};
|
|
471
|
-
|
|
472
|
-
const Impl = require("./URLSearchParams-impl.js");
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const conversions = require("webidl-conversions");
|
|
4
|
-
const utils = require("./utils.js");
|
|
5
|
-
|
|
6
|
-
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
|
7
|
-
if (typeof value !== "function") {
|
|
8
|
-
throw new globalObject.TypeError(context + " is not a function");
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function invokeTheCallbackFunction() {
|
|
12
|
-
const thisArg = utils.tryWrapperForImpl(this);
|
|
13
|
-
let callResult;
|
|
14
|
-
|
|
15
|
-
callResult = Reflect.apply(value, thisArg, []);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
invokeTheCallbackFunction.construct = () => {
|
|
19
|
-
let callResult = Reflect.construct(value, []);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
invokeTheCallbackFunction[utils.wrapperSymbol] = value;
|
|
23
|
-
invokeTheCallbackFunction.objectReference = value;
|
|
24
|
-
|
|
25
|
-
return invokeTheCallbackFunction;
|
|
26
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const utf8Encoder = new TextEncoder();
|
|
3
|
-
const utf8Decoder = new TextDecoder("utf-8", { ignoreBOM: true });
|
|
4
|
-
|
|
5
|
-
function utf8Encode(string) {
|
|
6
|
-
return utf8Encoder.encode(string);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function utf8DecodeWithoutBOM(bytes) {
|
|
10
|
-
return utf8Decoder.decode(bytes);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
module.exports = {
|
|
14
|
-
utf8Encode,
|
|
15
|
-
utf8DecodeWithoutBOM
|
|
16
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// Note that we take code points as JS numbers, not JS strings.
|
|
4
|
-
|
|
5
|
-
function isASCIIDigit(c) {
|
|
6
|
-
return c >= 0x30 && c <= 0x39;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function isASCIIAlpha(c) {
|
|
10
|
-
return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function isASCIIAlphanumeric(c) {
|
|
14
|
-
return isASCIIAlpha(c) || isASCIIDigit(c);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function isASCIIHex(c) {
|
|
18
|
-
return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
module.exports = {
|
|
22
|
-
isASCIIDigit,
|
|
23
|
-
isASCIIAlpha,
|
|
24
|
-
isASCIIAlphanumeric,
|
|
25
|
-
isASCIIHex
|
|
26
|
-
};
|