@zipify/wysiwyg 1.1.0-2 → 1.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/dist/cli.js +1 -1
- package/dist/wysiwyg.mjs +10 -17
- package/lib/extensions/Alignment.js +10 -8
- package/lib/extensions/FontSize.js +8 -3
- package/lib/extensions/LineHeight.js +10 -4
- package/lib/extensions/__tests__/__snapshots__/Alignment.test.js.snap +3 -3
- package/lib/extensions/__tests__/__snapshots__/FontSize.test.js.snap +9 -9
- package/lib/extensions/__tests__/__snapshots__/LineHeight.test.js.snap +5 -5
- package/lib/services/NodeFactory.js +4 -1
- package/node_modules_lambda/acorn-globals/node_modules/.bin/acorn +4 -0
- package/node_modules_lambda/acorn-globals/node_modules/acorn/CHANGELOG.md +620 -0
- package/node_modules_lambda/acorn-globals/node_modules/acorn/LICENSE +21 -0
- package/node_modules_lambda/acorn-globals/node_modules/acorn/README.md +269 -0
- package/node_modules_lambda/acorn-globals/node_modules/acorn/bin/acorn +4 -0
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.d.ts +209 -0
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.js +5186 -0
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.js.map +1 -0
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.mjs +5155 -0
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.mjs.d.ts +2 -0
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.mjs.map +1 -0
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/bin.js +64 -0
- package/node_modules_lambda/acorn-globals/node_modules/acorn/package.json +35 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/LICENSE.txt +20 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/README.mdown +67 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSDocumentRule.js +39 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSFontFaceRule.js +36 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSHostRule.js +37 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSImportRule.js +132 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSKeyframeRule.js +37 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSKeyframesRule.js +39 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSMediaRule.js +41 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSOM.js +3 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSRule.js +43 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSStyleDeclaration.js +148 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSStyleRule.js +190 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSStyleSheet.js +88 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSSupportsRule.js +36 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSValue.js +43 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSValueExpression.js +344 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/MatcherList.js +62 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/MediaList.js +61 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/StyleSheet.js +17 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/clone.js +82 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/index.js +21 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/parse.js +464 -0
- package/node_modules_lambda/cssstyle/node_modules/cssom/package.json +18 -0
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/LICENSE.txt +21 -0
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/README.md +106 -0
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/index.js +27 -0
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/Function.js +42 -0
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URL-impl.js +209 -0
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URL.js +442 -0
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URLSearchParams-impl.js +130 -0
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URLSearchParams.js +472 -0
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/VoidFunction.js +26 -0
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/encoding.js +16 -0
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/infra.js +26 -0
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/percent-encoding.js +142 -0
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/url-state-machine.js +1244 -0
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/urlencoded.js +106 -0
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/utils.js +190 -0
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/package.json +58 -0
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/webidl2js-wrapper.js +7 -0
- package/node_modules_lambda/escodegen/node_modules/estraverse/.jshintrc +16 -0
- package/node_modules_lambda/escodegen/node_modules/estraverse/LICENSE.BSD +19 -0
- package/node_modules_lambda/escodegen/node_modules/estraverse/README.md +153 -0
- package/node_modules_lambda/escodegen/node_modules/estraverse/estraverse.js +805 -0
- package/node_modules_lambda/escodegen/node_modules/estraverse/gulpfile.js +70 -0
- package/node_modules_lambda/escodegen/node_modules/estraverse/package.json +40 -0
- package/node_modules_lambda/escodegen/node_modules/levn/LICENSE +22 -0
- package/node_modules_lambda/escodegen/node_modules/levn/README.md +196 -0
- package/node_modules_lambda/escodegen/node_modules/levn/lib/cast.js +298 -0
- package/node_modules_lambda/escodegen/node_modules/levn/lib/coerce.js +285 -0
- package/node_modules_lambda/escodegen/node_modules/levn/lib/index.js +22 -0
- package/node_modules_lambda/escodegen/node_modules/levn/lib/parse-string.js +113 -0
- package/node_modules_lambda/escodegen/node_modules/levn/lib/parse.js +102 -0
- package/node_modules_lambda/escodegen/node_modules/levn/package.json +47 -0
- package/node_modules_lambda/escodegen/node_modules/optionator/CHANGELOG.md +56 -0
- package/node_modules_lambda/escodegen/node_modules/optionator/LICENSE +22 -0
- package/node_modules_lambda/escodegen/node_modules/optionator/README.md +238 -0
- package/node_modules_lambda/escodegen/node_modules/optionator/lib/help.js +260 -0
- package/node_modules_lambda/escodegen/node_modules/optionator/lib/index.js +465 -0
- package/node_modules_lambda/escodegen/node_modules/optionator/lib/util.js +54 -0
- package/node_modules_lambda/escodegen/node_modules/optionator/package.json +44 -0
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/CHANGELOG.md +99 -0
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/LICENSE +22 -0
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/README.md +15 -0
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Func.js +65 -0
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/List.js +686 -0
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Num.js +130 -0
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Obj.js +154 -0
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Str.js +92 -0
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/index.js +178 -0
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/package.json +52 -0
- package/node_modules_lambda/escodegen/node_modules/source-map/CHANGELOG.md +301 -0
- package/node_modules_lambda/escodegen/node_modules/source-map/LICENSE +28 -0
- package/node_modules_lambda/escodegen/node_modules/source-map/README.md +742 -0
- package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.debug.js +3234 -0
- package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.js +3233 -0
- package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.min.js +2 -0
- package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.min.js.map +1 -0
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/array-set.js +121 -0
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/base64-vlq.js +140 -0
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/base64.js +67 -0
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/binary-search.js +111 -0
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/mapping-list.js +79 -0
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/quick-sort.js +114 -0
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/source-map-consumer.js +1145 -0
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/source-map-generator.js +425 -0
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/source-node.js +413 -0
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/util.js +488 -0
- package/node_modules_lambda/escodegen/node_modules/source-map/package.json +73 -0
- package/node_modules_lambda/escodegen/node_modules/source-map/source-map.d.ts +98 -0
- package/node_modules_lambda/escodegen/node_modules/source-map/source-map.js +8 -0
- package/node_modules_lambda/escodegen/node_modules/type-check/LICENSE +22 -0
- package/node_modules_lambda/escodegen/node_modules/type-check/README.md +210 -0
- package/node_modules_lambda/escodegen/node_modules/type-check/lib/check.js +126 -0
- package/node_modules_lambda/escodegen/node_modules/type-check/lib/index.js +16 -0
- package/node_modules_lambda/escodegen/node_modules/type-check/lib/parse-type.js +196 -0
- package/node_modules_lambda/escodegen/node_modules/type-check/package.json +40 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/.github/dependabot.yml +11 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/Changelog.md +212 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/LICENSE +21 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/README.md +130 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/dbcs-codec.js +597 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/dbcs-data.js +188 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/index.js +23 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/internal.js +198 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-data.js +179 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/utf16.js +197 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/utf32.js +319 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/utf7.js +290 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/bom-handling.js +52 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/index.d.ts +41 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/index.js +180 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/streams.js +109 -0
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/package.json +44 -0
- package/package.json +1 -1
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const { utf8Encode, utf8DecodeWithoutBOM } = require("./encoding");
|
|
3
|
+
const { percentDecodeBytes, utf8PercentEncodeString, isURLEncodedPercentEncode } = require("./percent-encoding");
|
|
4
|
+
|
|
5
|
+
function p(char) {
|
|
6
|
+
return char.codePointAt(0);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// https://url.spec.whatwg.org/#concept-urlencoded-parser
|
|
10
|
+
function parseUrlencoded(input) {
|
|
11
|
+
const sequences = strictlySplitByteSequence(input, p("&"));
|
|
12
|
+
const output = [];
|
|
13
|
+
for (const bytes of sequences) {
|
|
14
|
+
if (bytes.length === 0) {
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let name, value;
|
|
19
|
+
const indexOfEqual = bytes.indexOf(p("="));
|
|
20
|
+
|
|
21
|
+
if (indexOfEqual >= 0) {
|
|
22
|
+
name = bytes.slice(0, indexOfEqual);
|
|
23
|
+
value = bytes.slice(indexOfEqual + 1);
|
|
24
|
+
} else {
|
|
25
|
+
name = bytes;
|
|
26
|
+
value = new Uint8Array(0);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
name = replaceByteInByteSequence(name, 0x2B, 0x20);
|
|
30
|
+
value = replaceByteInByteSequence(value, 0x2B, 0x20);
|
|
31
|
+
|
|
32
|
+
const nameString = utf8DecodeWithoutBOM(percentDecodeBytes(name));
|
|
33
|
+
const valueString = utf8DecodeWithoutBOM(percentDecodeBytes(value));
|
|
34
|
+
|
|
35
|
+
output.push([nameString, valueString]);
|
|
36
|
+
}
|
|
37
|
+
return output;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// https://url.spec.whatwg.org/#concept-urlencoded-string-parser
|
|
41
|
+
function parseUrlencodedString(input) {
|
|
42
|
+
return parseUrlencoded(utf8Encode(input));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// https://url.spec.whatwg.org/#concept-urlencoded-serializer
|
|
46
|
+
function serializeUrlencoded(tuples, encodingOverride = undefined) {
|
|
47
|
+
let encoding = "utf-8";
|
|
48
|
+
if (encodingOverride !== undefined) {
|
|
49
|
+
// TODO "get the output encoding", i.e. handle encoding labels vs. names.
|
|
50
|
+
encoding = encodingOverride;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
let output = "";
|
|
54
|
+
for (const [i, tuple] of tuples.entries()) {
|
|
55
|
+
// TODO: handle encoding override
|
|
56
|
+
|
|
57
|
+
const name = utf8PercentEncodeString(tuple[0], isURLEncodedPercentEncode, true);
|
|
58
|
+
|
|
59
|
+
let value = tuple[1];
|
|
60
|
+
if (tuple.length > 2 && tuple[2] !== undefined) {
|
|
61
|
+
if (tuple[2] === "hidden" && name === "_charset_") {
|
|
62
|
+
value = encoding;
|
|
63
|
+
} else if (tuple[2] === "file") {
|
|
64
|
+
// value is a File object
|
|
65
|
+
value = value.name;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
value = utf8PercentEncodeString(value, isURLEncodedPercentEncode, true);
|
|
70
|
+
|
|
71
|
+
if (i !== 0) {
|
|
72
|
+
output += "&";
|
|
73
|
+
}
|
|
74
|
+
output += `${name}=${value}`;
|
|
75
|
+
}
|
|
76
|
+
return output;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function strictlySplitByteSequence(buf, cp) {
|
|
80
|
+
const list = [];
|
|
81
|
+
let last = 0;
|
|
82
|
+
let i = buf.indexOf(cp);
|
|
83
|
+
while (i >= 0) {
|
|
84
|
+
list.push(buf.slice(last, i));
|
|
85
|
+
last = i + 1;
|
|
86
|
+
i = buf.indexOf(cp, last);
|
|
87
|
+
}
|
|
88
|
+
if (last !== buf.length) {
|
|
89
|
+
list.push(buf.slice(last));
|
|
90
|
+
}
|
|
91
|
+
return list;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function replaceByteInByteSequence(buf, from, to) {
|
|
95
|
+
let i = buf.indexOf(from);
|
|
96
|
+
while (i >= 0) {
|
|
97
|
+
buf[i] = to;
|
|
98
|
+
i = buf.indexOf(from, i + 1);
|
|
99
|
+
}
|
|
100
|
+
return buf;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
module.exports = {
|
|
104
|
+
parseUrlencodedString,
|
|
105
|
+
serializeUrlencoded
|
|
106
|
+
};
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Returns "Type(value) is Object" in ES terminology.
|
|
4
|
+
function isObject(value) {
|
|
5
|
+
return (typeof value === "object" && value !== null) || typeof value === "function";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty);
|
|
9
|
+
|
|
10
|
+
// Like `Object.assign`, but using `[[GetOwnProperty]]` and `[[DefineOwnProperty]]`
|
|
11
|
+
// instead of `[[Get]]` and `[[Set]]` and only allowing objects
|
|
12
|
+
function define(target, source) {
|
|
13
|
+
for (const key of Reflect.ownKeys(source)) {
|
|
14
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(source, key);
|
|
15
|
+
if (descriptor && !Reflect.defineProperty(target, key, descriptor)) {
|
|
16
|
+
throw new TypeError(`Cannot redefine property: ${String(key)}`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function newObjectInRealm(globalObject, object) {
|
|
22
|
+
const ctorRegistry = initCtorRegistry(globalObject);
|
|
23
|
+
return Object.defineProperties(
|
|
24
|
+
Object.create(ctorRegistry["%Object.prototype%"]),
|
|
25
|
+
Object.getOwnPropertyDescriptors(object)
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const wrapperSymbol = Symbol("wrapper");
|
|
30
|
+
const implSymbol = Symbol("impl");
|
|
31
|
+
const sameObjectCaches = Symbol("SameObject caches");
|
|
32
|
+
const ctorRegistrySymbol = Symbol.for("[webidl2js] constructor registry");
|
|
33
|
+
|
|
34
|
+
const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(async function* () {}).prototype);
|
|
35
|
+
|
|
36
|
+
function initCtorRegistry(globalObject) {
|
|
37
|
+
if (hasOwn(globalObject, ctorRegistrySymbol)) {
|
|
38
|
+
return globalObject[ctorRegistrySymbol];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const ctorRegistry = Object.create(null);
|
|
42
|
+
|
|
43
|
+
// In addition to registering all the WebIDL2JS-generated types in the constructor registry,
|
|
44
|
+
// we also register a few intrinsics that we make use of in generated code, since they are not
|
|
45
|
+
// easy to grab from the globalObject variable.
|
|
46
|
+
ctorRegistry["%Object.prototype%"] = globalObject.Object.prototype;
|
|
47
|
+
ctorRegistry["%IteratorPrototype%"] = Object.getPrototypeOf(
|
|
48
|
+
Object.getPrototypeOf(new globalObject.Array()[Symbol.iterator]())
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
try {
|
|
52
|
+
ctorRegistry["%AsyncIteratorPrototype%"] = Object.getPrototypeOf(
|
|
53
|
+
Object.getPrototypeOf(
|
|
54
|
+
globalObject.eval("(async function* () {})").prototype
|
|
55
|
+
)
|
|
56
|
+
);
|
|
57
|
+
} catch {
|
|
58
|
+
ctorRegistry["%AsyncIteratorPrototype%"] = AsyncIteratorPrototype;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
globalObject[ctorRegistrySymbol] = ctorRegistry;
|
|
62
|
+
return ctorRegistry;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function getSameObject(wrapper, prop, creator) {
|
|
66
|
+
if (!wrapper[sameObjectCaches]) {
|
|
67
|
+
wrapper[sameObjectCaches] = Object.create(null);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (prop in wrapper[sameObjectCaches]) {
|
|
71
|
+
return wrapper[sameObjectCaches][prop];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
wrapper[sameObjectCaches][prop] = creator();
|
|
75
|
+
return wrapper[sameObjectCaches][prop];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function wrapperForImpl(impl) {
|
|
79
|
+
return impl ? impl[wrapperSymbol] : null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function implForWrapper(wrapper) {
|
|
83
|
+
return wrapper ? wrapper[implSymbol] : null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function tryWrapperForImpl(impl) {
|
|
87
|
+
const wrapper = wrapperForImpl(impl);
|
|
88
|
+
return wrapper ? wrapper : impl;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function tryImplForWrapper(wrapper) {
|
|
92
|
+
const impl = implForWrapper(wrapper);
|
|
93
|
+
return impl ? impl : wrapper;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const iterInternalSymbol = Symbol("internal");
|
|
97
|
+
|
|
98
|
+
function isArrayIndexPropName(P) {
|
|
99
|
+
if (typeof P !== "string") {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
const i = P >>> 0;
|
|
103
|
+
if (i === 2 ** 32 - 1) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
const s = `${i}`;
|
|
107
|
+
if (P !== s) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const byteLengthGetter =
|
|
114
|
+
Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get;
|
|
115
|
+
function isArrayBuffer(value) {
|
|
116
|
+
try {
|
|
117
|
+
byteLengthGetter.call(value);
|
|
118
|
+
return true;
|
|
119
|
+
} catch (e) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function iteratorResult([key, value], kind) {
|
|
125
|
+
let result;
|
|
126
|
+
switch (kind) {
|
|
127
|
+
case "key":
|
|
128
|
+
result = key;
|
|
129
|
+
break;
|
|
130
|
+
case "value":
|
|
131
|
+
result = value;
|
|
132
|
+
break;
|
|
133
|
+
case "key+value":
|
|
134
|
+
result = [key, value];
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
return { value: result, done: false };
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const supportsPropertyIndex = Symbol("supports property index");
|
|
141
|
+
const supportedPropertyIndices = Symbol("supported property indices");
|
|
142
|
+
const supportsPropertyName = Symbol("supports property name");
|
|
143
|
+
const supportedPropertyNames = Symbol("supported property names");
|
|
144
|
+
const indexedGet = Symbol("indexed property get");
|
|
145
|
+
const indexedSetNew = Symbol("indexed property set new");
|
|
146
|
+
const indexedSetExisting = Symbol("indexed property set existing");
|
|
147
|
+
const namedGet = Symbol("named property get");
|
|
148
|
+
const namedSetNew = Symbol("named property set new");
|
|
149
|
+
const namedSetExisting = Symbol("named property set existing");
|
|
150
|
+
const namedDelete = Symbol("named property delete");
|
|
151
|
+
|
|
152
|
+
const asyncIteratorNext = Symbol("async iterator get the next iteration result");
|
|
153
|
+
const asyncIteratorReturn = Symbol("async iterator return steps");
|
|
154
|
+
const asyncIteratorInit = Symbol("async iterator initialization steps");
|
|
155
|
+
const asyncIteratorEOI = Symbol("async iterator end of iteration");
|
|
156
|
+
|
|
157
|
+
module.exports = exports = {
|
|
158
|
+
isObject,
|
|
159
|
+
hasOwn,
|
|
160
|
+
define,
|
|
161
|
+
newObjectInRealm,
|
|
162
|
+
wrapperSymbol,
|
|
163
|
+
implSymbol,
|
|
164
|
+
getSameObject,
|
|
165
|
+
ctorRegistrySymbol,
|
|
166
|
+
initCtorRegistry,
|
|
167
|
+
wrapperForImpl,
|
|
168
|
+
implForWrapper,
|
|
169
|
+
tryWrapperForImpl,
|
|
170
|
+
tryImplForWrapper,
|
|
171
|
+
iterInternalSymbol,
|
|
172
|
+
isArrayBuffer,
|
|
173
|
+
isArrayIndexPropName,
|
|
174
|
+
supportsPropertyIndex,
|
|
175
|
+
supportedPropertyIndices,
|
|
176
|
+
supportsPropertyName,
|
|
177
|
+
supportedPropertyNames,
|
|
178
|
+
indexedGet,
|
|
179
|
+
indexedSetNew,
|
|
180
|
+
indexedSetExisting,
|
|
181
|
+
namedGet,
|
|
182
|
+
namedSetNew,
|
|
183
|
+
namedSetExisting,
|
|
184
|
+
namedDelete,
|
|
185
|
+
asyncIteratorNext,
|
|
186
|
+
asyncIteratorReturn,
|
|
187
|
+
asyncIteratorInit,
|
|
188
|
+
asyncIteratorEOI,
|
|
189
|
+
iteratorResult
|
|
190
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "whatwg-url",
|
|
3
|
+
"version": "11.0.0",
|
|
4
|
+
"description": "An implementation of the WHATWG URL Standard's URL API and parsing machinery",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"index.js",
|
|
8
|
+
"webidl2js-wrapper.js",
|
|
9
|
+
"lib/*.js"
|
|
10
|
+
],
|
|
11
|
+
"author": "Sebastian Mayr <github@smayr.name>",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"repository": "jsdom/whatwg-url",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"tr46": "^3.0.0",
|
|
16
|
+
"webidl-conversions": "^7.0.0"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@domenic/eslint-config": "^1.4.0",
|
|
20
|
+
"benchmark": "^2.1.4",
|
|
21
|
+
"browserify": "^17.0.0",
|
|
22
|
+
"domexception": "^4.0.0",
|
|
23
|
+
"eslint": "^7.32.0",
|
|
24
|
+
"got": "^11.8.2",
|
|
25
|
+
"jest": "^27.2.4",
|
|
26
|
+
"webidl2js": "^17.0.0"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=12"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"coverage": "jest --coverage",
|
|
33
|
+
"lint": "eslint .",
|
|
34
|
+
"prepare": "node scripts/transform.js",
|
|
35
|
+
"pretest": "node scripts/get-latest-platform-tests.js && node scripts/transform.js",
|
|
36
|
+
"build-live-viewer": "browserify index.js --standalone whatwgURL > live-viewer/whatwg-url.js",
|
|
37
|
+
"test": "jest"
|
|
38
|
+
},
|
|
39
|
+
"jest": {
|
|
40
|
+
"collectCoverageFrom": [
|
|
41
|
+
"lib/**/*.js",
|
|
42
|
+
"!lib/utils.js"
|
|
43
|
+
],
|
|
44
|
+
"coverageDirectory": "coverage",
|
|
45
|
+
"coverageReporters": [
|
|
46
|
+
"lcov",
|
|
47
|
+
"text-summary"
|
|
48
|
+
],
|
|
49
|
+
"testEnvironment": "node",
|
|
50
|
+
"testMatch": [
|
|
51
|
+
"<rootDir>/test/**/*.js"
|
|
52
|
+
],
|
|
53
|
+
"testPathIgnorePatterns": [
|
|
54
|
+
"^<rootDir>/test/testharness.js$",
|
|
55
|
+
"^<rootDir>/test/web-platform-tests/"
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"curly": true,
|
|
3
|
+
"eqeqeq": true,
|
|
4
|
+
"immed": true,
|
|
5
|
+
"eqnull": true,
|
|
6
|
+
"latedef": true,
|
|
7
|
+
"noarg": true,
|
|
8
|
+
"noempty": true,
|
|
9
|
+
"quotmark": "single",
|
|
10
|
+
"undef": true,
|
|
11
|
+
"unused": true,
|
|
12
|
+
"strict": true,
|
|
13
|
+
"trailing": true,
|
|
14
|
+
|
|
15
|
+
"node": true
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Redistribution and use in source and binary forms, with or without
|
|
2
|
+
modification, are permitted provided that the following conditions are met:
|
|
3
|
+
|
|
4
|
+
* Redistributions of source code must retain the above copyright
|
|
5
|
+
notice, this list of conditions and the following disclaimer.
|
|
6
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
7
|
+
notice, this list of conditions and the following disclaimer in the
|
|
8
|
+
documentation and/or other materials provided with the distribution.
|
|
9
|
+
|
|
10
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
11
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
12
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
13
|
+
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
|
14
|
+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
15
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
16
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
17
|
+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
18
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
19
|
+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
### Estraverse [](http://travis-ci.org/estools/estraverse)
|
|
2
|
+
|
|
3
|
+
Estraverse ([estraverse](http://github.com/estools/estraverse)) is
|
|
4
|
+
[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)
|
|
5
|
+
traversal functions from [esmangle project](http://github.com/estools/esmangle).
|
|
6
|
+
|
|
7
|
+
### Documentation
|
|
8
|
+
|
|
9
|
+
You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage).
|
|
10
|
+
|
|
11
|
+
### Example Usage
|
|
12
|
+
|
|
13
|
+
The following code will output all variables declared at the root of a file.
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
estraverse.traverse(ast, {
|
|
17
|
+
enter: function (node, parent) {
|
|
18
|
+
if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration')
|
|
19
|
+
return estraverse.VisitorOption.Skip;
|
|
20
|
+
},
|
|
21
|
+
leave: function (node, parent) {
|
|
22
|
+
if (node.type == 'VariableDeclarator')
|
|
23
|
+
console.log(node.id.name);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break.
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
estraverse.traverse(ast, {
|
|
32
|
+
enter: function (node) {
|
|
33
|
+
this.break();
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it.
|
|
39
|
+
|
|
40
|
+
```javascript
|
|
41
|
+
result = estraverse.replace(tree, {
|
|
42
|
+
enter: function (node) {
|
|
43
|
+
// Replace it with replaced.
|
|
44
|
+
if (node.type === 'Literal')
|
|
45
|
+
return replaced;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
By passing `visitor.keys` mapping, we can extend estraverse traversing functionality.
|
|
51
|
+
|
|
52
|
+
```javascript
|
|
53
|
+
// This tree contains a user-defined `TestExpression` node.
|
|
54
|
+
var tree = {
|
|
55
|
+
type: 'TestExpression',
|
|
56
|
+
|
|
57
|
+
// This 'argument' is the property containing the other **node**.
|
|
58
|
+
argument: {
|
|
59
|
+
type: 'Literal',
|
|
60
|
+
value: 20
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
// This 'extended' is the property not containing the other **node**.
|
|
64
|
+
extended: true
|
|
65
|
+
};
|
|
66
|
+
estraverse.traverse(tree, {
|
|
67
|
+
enter: function (node) { },
|
|
68
|
+
|
|
69
|
+
// Extending the existing traversing rules.
|
|
70
|
+
keys: {
|
|
71
|
+
// TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ]
|
|
72
|
+
TestExpression: ['argument']
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes.
|
|
78
|
+
|
|
79
|
+
```javascript
|
|
80
|
+
// This tree contains a user-defined `TestExpression` node.
|
|
81
|
+
var tree = {
|
|
82
|
+
type: 'TestExpression',
|
|
83
|
+
|
|
84
|
+
// This 'argument' is the property containing the other **node**.
|
|
85
|
+
argument: {
|
|
86
|
+
type: 'Literal',
|
|
87
|
+
value: 20
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
// This 'extended' is the property not containing the other **node**.
|
|
91
|
+
extended: true
|
|
92
|
+
};
|
|
93
|
+
estraverse.traverse(tree, {
|
|
94
|
+
enter: function (node) { },
|
|
95
|
+
|
|
96
|
+
// Iterating the child **nodes** of unknown nodes.
|
|
97
|
+
fallback: 'iteration'
|
|
98
|
+
});
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
When `visitor.fallback` is a function, we can determine which keys to visit on each node.
|
|
102
|
+
|
|
103
|
+
```javascript
|
|
104
|
+
// This tree contains a user-defined `TestExpression` node.
|
|
105
|
+
var tree = {
|
|
106
|
+
type: 'TestExpression',
|
|
107
|
+
|
|
108
|
+
// This 'argument' is the property containing the other **node**.
|
|
109
|
+
argument: {
|
|
110
|
+
type: 'Literal',
|
|
111
|
+
value: 20
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
// This 'extended' is the property not containing the other **node**.
|
|
115
|
+
extended: true
|
|
116
|
+
};
|
|
117
|
+
estraverse.traverse(tree, {
|
|
118
|
+
enter: function (node) { },
|
|
119
|
+
|
|
120
|
+
// Skip the `argument` property of each node
|
|
121
|
+
fallback: function(node) {
|
|
122
|
+
return Object.keys(node).filter(function(key) {
|
|
123
|
+
return key !== 'argument';
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### License
|
|
130
|
+
|
|
131
|
+
Copyright (C) 2012-2016 [Yusuke Suzuki](http://github.com/Constellation)
|
|
132
|
+
(twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors.
|
|
133
|
+
|
|
134
|
+
Redistribution and use in source and binary forms, with or without
|
|
135
|
+
modification, are permitted provided that the following conditions are met:
|
|
136
|
+
|
|
137
|
+
* Redistributions of source code must retain the above copyright
|
|
138
|
+
notice, this list of conditions and the following disclaimer.
|
|
139
|
+
|
|
140
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
141
|
+
notice, this list of conditions and the following disclaimer in the
|
|
142
|
+
documentation and/or other materials provided with the distribution.
|
|
143
|
+
|
|
144
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
145
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
146
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
147
|
+
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
|
148
|
+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
149
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
150
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
151
|
+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
152
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
153
|
+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|