@cfp-studio/iframe 18.4.0 → 18.4.2
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/README.md +6 -0
- package/dist/index.d.mts +1 -1
- package/package.json +5 -2
- package/preview/__previewjs_internal__/copy-cut-paste.ts +78 -72
- package/preview/__previewjs_internal__/error-message.ts +34 -34
- package/preview/__previewjs_internal__/index.ts +70 -71
- package/preview/__previewjs_internal__/links.ts +27 -27
- package/preview/__previewjs_internal__/logs.ts +94 -94
- package/preview/__previewjs_internal__/object-inspect.js +458 -540
- package/preview/__previewjs_internal__/overlay.spec.ts +86 -0
- package/preview/__previewjs_internal__/overlay.ts +197 -6
- package/preview/__previewjs_internal__/renderer/index.tsx +2 -2
- package/preview/__previewjs_internal__/run-renderer.ts +94 -97
- package/preview/__previewjs_internal__/runtime-bridge.spec.ts +79 -0
- package/preview/__previewjs_internal__/runtime-bridge.ts +168 -28
- package/preview/__previewjs_internal__/state.ts +2 -2
- package/preview/__previewjs_internal__/vite-hmr-listener.ts +67 -66
- package/preview/index.html +78 -79
|
@@ -4,23 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
var hasMap = typeof Map === "function" && Map.prototype;
|
|
6
6
|
var mapSizeDescriptor =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
: null;
|
|
10
|
-
var mapSize =
|
|
11
|
-
hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === "function"
|
|
12
|
-
? mapSizeDescriptor.get
|
|
13
|
-
: null;
|
|
7
|
+
Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null;
|
|
8
|
+
var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === "function" ? mapSizeDescriptor.get : null;
|
|
14
9
|
var mapForEach = hasMap && Map.prototype.forEach;
|
|
15
10
|
var hasSet = typeof Set === "function" && Set.prototype;
|
|
16
11
|
var setSizeDescriptor =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
: null;
|
|
20
|
-
var setSize =
|
|
21
|
-
hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === "function"
|
|
22
|
-
? setSizeDescriptor.get
|
|
23
|
-
: null;
|
|
12
|
+
Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null;
|
|
13
|
+
var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === "function" ? setSizeDescriptor.get : null;
|
|
24
14
|
var setForEach = hasSet && Set.prototype.forEach;
|
|
25
15
|
var hasWeakMap = typeof WeakMap === "function" && WeakMap.prototype;
|
|
26
16
|
var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
|
|
@@ -41,628 +31,556 @@ var $concat = Array.prototype.concat;
|
|
|
41
31
|
var $join = Array.prototype.join;
|
|
42
32
|
var $arrSlice = Array.prototype.slice;
|
|
43
33
|
var $floor = Math.floor;
|
|
44
|
-
var bigIntValueOf =
|
|
45
|
-
typeof BigInt === "function" ? BigInt.prototype.valueOf : null;
|
|
34
|
+
var bigIntValueOf = typeof BigInt === "function" ? BigInt.prototype.valueOf : null;
|
|
46
35
|
var gOPS = Object.getOwnPropertySymbols;
|
|
47
36
|
var symToString =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
: null;
|
|
51
|
-
var hasShammedSymbols =
|
|
52
|
-
typeof Symbol === "function" && typeof Symbol.iterator === "object";
|
|
37
|
+
typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? Symbol.prototype.toString : null;
|
|
38
|
+
var hasShammedSymbols = typeof Symbol === "function" && typeof Symbol.iterator === "object";
|
|
53
39
|
// ie, `has-tostringtag/shams
|
|
54
40
|
var toStringTag =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
41
|
+
typeof Symbol === "function" &&
|
|
42
|
+
Symbol.toStringTag &&
|
|
43
|
+
(typeof Symbol.toStringTag === hasShammedSymbols ? "object" : "symbol")
|
|
44
|
+
? Symbol.toStringTag
|
|
45
|
+
: null;
|
|
60
46
|
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
|
61
47
|
|
|
62
48
|
var gPO =
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
: null);
|
|
49
|
+
(typeof Reflect === "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) ||
|
|
50
|
+
([].__proto__ === Array.prototype // eslint-disable-line no-proto
|
|
51
|
+
? function (O) {
|
|
52
|
+
return O.__proto__; // eslint-disable-line no-proto
|
|
53
|
+
}
|
|
54
|
+
: null);
|
|
71
55
|
|
|
72
56
|
function addNumericSeparator(num, str) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
return $replace.call(str, sepRegex, "$&_");
|
|
57
|
+
if (
|
|
58
|
+
num === Infinity ||
|
|
59
|
+
num === -Infinity ||
|
|
60
|
+
num !== num ||
|
|
61
|
+
(num && num > -1000 && num < 1000) ||
|
|
62
|
+
$test.call(/e/, str)
|
|
63
|
+
) {
|
|
64
|
+
return str;
|
|
65
|
+
}
|
|
66
|
+
var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
|
|
67
|
+
if (typeof num === "number") {
|
|
68
|
+
var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
|
|
69
|
+
if (int !== num) {
|
|
70
|
+
var intStr = String(int);
|
|
71
|
+
var dec = $slice.call(str, intStr.length + 1);
|
|
72
|
+
return (
|
|
73
|
+
$replace.call(intStr, sepRegex, "$&_") + "." + $replace.call($replace.call(dec, /([0-9]{3})/g, "$&_"), /_$/, "")
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return $replace.call(str, sepRegex, "$&_");
|
|
96
78
|
}
|
|
97
79
|
|
|
98
80
|
export default function inspect_(obj, options, depth, seen) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
if (!isDate(obj) && !isRegExp(obj)) {
|
|
308
|
-
var ys = arrObjKeys(obj, inspect);
|
|
309
|
-
var isPlainObject = gPO
|
|
310
|
-
? gPO(obj) === Object.prototype
|
|
311
|
-
: obj instanceof Object || obj.constructor === Object;
|
|
312
|
-
var protoTag = obj instanceof Object ? "" : "null prototype";
|
|
313
|
-
var stringTag =
|
|
314
|
-
!isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj
|
|
315
|
-
? $slice.call(toStr(obj), 8, -1)
|
|
316
|
-
: protoTag
|
|
317
|
-
? "Object"
|
|
318
|
-
: "";
|
|
319
|
-
var constructorTag =
|
|
320
|
-
isPlainObject || typeof obj.constructor !== "function"
|
|
321
|
-
? ""
|
|
322
|
-
: obj.constructor.name
|
|
323
|
-
? obj.constructor.name + " "
|
|
324
|
-
: "";
|
|
325
|
-
var tag =
|
|
326
|
-
constructorTag +
|
|
327
|
-
(stringTag || protoTag
|
|
328
|
-
? "[" +
|
|
329
|
-
$join.call($concat.call([], stringTag || [], protoTag || []), ": ") +
|
|
330
|
-
"] "
|
|
331
|
-
: "");
|
|
332
|
-
if (ys.length === 0) {
|
|
333
|
-
return tag + "{}";
|
|
334
|
-
}
|
|
335
|
-
if (indent) {
|
|
336
|
-
return tag + "{" + indentedJoin(ys, indent) + "}";
|
|
337
|
-
}
|
|
338
|
-
return tag + "{ " + $join.call(ys, ", ") + " }";
|
|
339
|
-
}
|
|
340
|
-
return String(obj);
|
|
81
|
+
var opts = options || {};
|
|
82
|
+
|
|
83
|
+
if (has(opts, "quoteStyle") && opts.quoteStyle !== "single" && opts.quoteStyle !== "double") {
|
|
84
|
+
throw new TypeError('option "quoteStyle" must be "single" or "double"');
|
|
85
|
+
}
|
|
86
|
+
if (
|
|
87
|
+
has(opts, "maxStringLength") &&
|
|
88
|
+
(typeof opts.maxStringLength === "number"
|
|
89
|
+
? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
|
|
90
|
+
: opts.maxStringLength !== null)
|
|
91
|
+
) {
|
|
92
|
+
throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
|
|
93
|
+
}
|
|
94
|
+
var customInspect = has(opts, "customInspect") ? opts.customInspect : true;
|
|
95
|
+
if (typeof customInspect !== "boolean" && customInspect !== "symbol") {
|
|
96
|
+
throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (
|
|
100
|
+
has(opts, "indent") &&
|
|
101
|
+
opts.indent !== null &&
|
|
102
|
+
opts.indent !== "\t" &&
|
|
103
|
+
!(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
|
|
104
|
+
) {
|
|
105
|
+
throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
|
|
106
|
+
}
|
|
107
|
+
if (has(opts, "numericSeparator") && typeof opts.numericSeparator !== "boolean") {
|
|
108
|
+
throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
|
|
109
|
+
}
|
|
110
|
+
var numericSeparator = opts.numericSeparator;
|
|
111
|
+
|
|
112
|
+
if (typeof obj === "undefined") {
|
|
113
|
+
return "undefined";
|
|
114
|
+
}
|
|
115
|
+
if (obj === null) {
|
|
116
|
+
return "null";
|
|
117
|
+
}
|
|
118
|
+
if (typeof obj === "boolean") {
|
|
119
|
+
return obj ? "true" : "false";
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (typeof obj === "string") {
|
|
123
|
+
return inspectString(obj, opts);
|
|
124
|
+
}
|
|
125
|
+
if (typeof obj === "number") {
|
|
126
|
+
if (obj === 0) {
|
|
127
|
+
return Infinity / obj > 0 ? "0" : "-0";
|
|
128
|
+
}
|
|
129
|
+
var str = String(obj);
|
|
130
|
+
return numericSeparator ? addNumericSeparator(obj, str) : str;
|
|
131
|
+
}
|
|
132
|
+
if (typeof obj === "bigint") {
|
|
133
|
+
var bigIntStr = String(obj) + "n";
|
|
134
|
+
return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
var maxDepth = typeof opts.depth === "undefined" ? 5 : opts.depth;
|
|
138
|
+
if (typeof depth === "undefined") {
|
|
139
|
+
depth = 0;
|
|
140
|
+
}
|
|
141
|
+
if (depth >= maxDepth && maxDepth > 0 && typeof obj === "object") {
|
|
142
|
+
return isArray(obj) ? "[Array]" : "[Object]";
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
var indent = getIndent(opts, depth);
|
|
146
|
+
|
|
147
|
+
if (typeof seen === "undefined") {
|
|
148
|
+
seen = [];
|
|
149
|
+
} else if (indexOf(seen, obj) >= 0) {
|
|
150
|
+
return "[Circular]";
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function inspect(value, from, noIndent) {
|
|
154
|
+
if (from) {
|
|
155
|
+
seen = $arrSlice.call(seen);
|
|
156
|
+
seen.push(from);
|
|
157
|
+
}
|
|
158
|
+
if (noIndent) {
|
|
159
|
+
var newOpts = {
|
|
160
|
+
depth: opts.depth,
|
|
161
|
+
};
|
|
162
|
+
if (has(opts, "quoteStyle")) {
|
|
163
|
+
newOpts.quoteStyle = opts.quoteStyle;
|
|
164
|
+
}
|
|
165
|
+
return inspect_(value, newOpts, depth + 1, seen);
|
|
166
|
+
}
|
|
167
|
+
return inspect_(value, opts, depth + 1, seen);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (typeof obj === "function") {
|
|
171
|
+
var name = nameOf(obj);
|
|
172
|
+
var keys = arrObjKeys(obj, inspect);
|
|
173
|
+
return (
|
|
174
|
+
"[Function" +
|
|
175
|
+
(name ? ": " + name : " (anonymous)") +
|
|
176
|
+
"]" +
|
|
177
|
+
(keys.length > 0 ? " { " + $join.call(keys, ", ") + " }" : "")
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
if (isSymbol(obj)) {
|
|
181
|
+
var symString = hasShammedSymbols
|
|
182
|
+
? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, "$1")
|
|
183
|
+
: symToString.call(obj);
|
|
184
|
+
return typeof obj === "object" && !hasShammedSymbols ? markBoxed(symString) : symString;
|
|
185
|
+
}
|
|
186
|
+
if (isElement(obj)) {
|
|
187
|
+
var s = "<" + $toLowerCase.call(String(obj.nodeName));
|
|
188
|
+
var attrs = obj.attributes || [];
|
|
189
|
+
for (var i = 0; i < attrs.length; i++) {
|
|
190
|
+
s += " " + attrs[i].name + "=" + wrapQuotes(quote(attrs[i].value), "double", opts);
|
|
191
|
+
}
|
|
192
|
+
s += ">";
|
|
193
|
+
if (obj.childNodes && obj.childNodes.length) {
|
|
194
|
+
s += "...";
|
|
195
|
+
}
|
|
196
|
+
s += "</" + $toLowerCase.call(String(obj.nodeName)) + ">";
|
|
197
|
+
return s;
|
|
198
|
+
}
|
|
199
|
+
if (isArray(obj)) {
|
|
200
|
+
if (obj.length === 0) {
|
|
201
|
+
return "[]";
|
|
202
|
+
}
|
|
203
|
+
var xs = arrObjKeys(obj, inspect);
|
|
204
|
+
if (indent && !singleLineValues(xs)) {
|
|
205
|
+
return "[" + indentedJoin(xs, indent) + "]";
|
|
206
|
+
}
|
|
207
|
+
return "[ " + $join.call(xs, ", ") + " ]";
|
|
208
|
+
}
|
|
209
|
+
if (isError(obj)) {
|
|
210
|
+
var parts = arrObjKeys(obj, inspect);
|
|
211
|
+
if ("cause" in obj && !isEnumerable.call(obj, "cause")) {
|
|
212
|
+
return (
|
|
213
|
+
"{ [" + String(obj) + "] " + $join.call($concat.call("[cause]: " + inspect(obj.cause), parts), ", ") + " }"
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
if (parts.length === 0) {
|
|
217
|
+
return "[" + String(obj) + "]";
|
|
218
|
+
}
|
|
219
|
+
return "{ [" + String(obj) + "] " + $join.call(parts, ", ") + " }";
|
|
220
|
+
}
|
|
221
|
+
if (typeof obj === "object" && customInspect) {
|
|
222
|
+
if (customInspect !== "symbol" && typeof obj.inspect === "function") {
|
|
223
|
+
return obj.inspect();
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
if (isMap(obj)) {
|
|
227
|
+
var mapParts = [];
|
|
228
|
+
mapForEach.call(obj, function (value, key) {
|
|
229
|
+
mapParts.push(inspect(key, obj, true) + " => " + inspect(value, obj));
|
|
230
|
+
});
|
|
231
|
+
return collectionOf("Map", mapSize.call(obj), mapParts, indent);
|
|
232
|
+
}
|
|
233
|
+
if (isSet(obj)) {
|
|
234
|
+
var setParts = [];
|
|
235
|
+
setForEach.call(obj, function (value) {
|
|
236
|
+
setParts.push(inspect(value, obj));
|
|
237
|
+
});
|
|
238
|
+
return collectionOf("Set", setSize.call(obj), setParts, indent);
|
|
239
|
+
}
|
|
240
|
+
if (isWeakMap(obj)) {
|
|
241
|
+
return weakCollectionOf("WeakMap");
|
|
242
|
+
}
|
|
243
|
+
if (isWeakSet(obj)) {
|
|
244
|
+
return weakCollectionOf("WeakSet");
|
|
245
|
+
}
|
|
246
|
+
if (isWeakRef(obj)) {
|
|
247
|
+
return weakCollectionOf("WeakRef");
|
|
248
|
+
}
|
|
249
|
+
if (isNumber(obj)) {
|
|
250
|
+
return markBoxed(inspect(Number(obj)));
|
|
251
|
+
}
|
|
252
|
+
if (isBigInt(obj)) {
|
|
253
|
+
return markBoxed(inspect(bigIntValueOf.call(obj)));
|
|
254
|
+
}
|
|
255
|
+
if (isBoolean(obj)) {
|
|
256
|
+
return markBoxed(booleanValueOf.call(obj));
|
|
257
|
+
}
|
|
258
|
+
if (isString(obj)) {
|
|
259
|
+
return markBoxed(inspect(String(obj)));
|
|
260
|
+
}
|
|
261
|
+
if (!isDate(obj) && !isRegExp(obj)) {
|
|
262
|
+
var ys = arrObjKeys(obj, inspect);
|
|
263
|
+
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
|
264
|
+
var protoTag = obj instanceof Object ? "" : "null prototype";
|
|
265
|
+
var stringTag =
|
|
266
|
+
!isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj
|
|
267
|
+
? $slice.call(toStr(obj), 8, -1)
|
|
268
|
+
: protoTag
|
|
269
|
+
? "Object"
|
|
270
|
+
: "";
|
|
271
|
+
var constructorTag =
|
|
272
|
+
isPlainObject || typeof obj.constructor !== "function"
|
|
273
|
+
? ""
|
|
274
|
+
: obj.constructor.name
|
|
275
|
+
? obj.constructor.name + " "
|
|
276
|
+
: "";
|
|
277
|
+
var tag =
|
|
278
|
+
constructorTag +
|
|
279
|
+
(stringTag || protoTag ? "[" + $join.call($concat.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
|
|
280
|
+
if (ys.length === 0) {
|
|
281
|
+
return tag + "{}";
|
|
282
|
+
}
|
|
283
|
+
if (indent) {
|
|
284
|
+
return tag + "{" + indentedJoin(ys, indent) + "}";
|
|
285
|
+
}
|
|
286
|
+
return tag + "{ " + $join.call(ys, ", ") + " }";
|
|
287
|
+
}
|
|
288
|
+
return String(obj);
|
|
341
289
|
}
|
|
342
290
|
|
|
343
291
|
function wrapQuotes(s, defaultStyle, opts) {
|
|
344
|
-
|
|
345
|
-
|
|
292
|
+
var quoteChar = (opts.quoteStyle || defaultStyle) === "double" ? '"' : "'";
|
|
293
|
+
return quoteChar + s + quoteChar;
|
|
346
294
|
}
|
|
347
295
|
|
|
348
296
|
function quote(s) {
|
|
349
|
-
|
|
297
|
+
return $replace.call(String(s), /"/g, """);
|
|
350
298
|
}
|
|
351
299
|
|
|
352
300
|
function isArray(obj) {
|
|
353
|
-
|
|
354
|
-
toStr(obj) === "[object Array]" &&
|
|
355
|
-
(!toStringTag || !(typeof obj === "object" && toStringTag in obj))
|
|
356
|
-
);
|
|
301
|
+
return toStr(obj) === "[object Array]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
357
302
|
}
|
|
358
303
|
function isDate(obj) {
|
|
359
|
-
|
|
360
|
-
toStr(obj) === "[object Date]" &&
|
|
361
|
-
(!toStringTag || !(typeof obj === "object" && toStringTag in obj))
|
|
362
|
-
);
|
|
304
|
+
return toStr(obj) === "[object Date]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
363
305
|
}
|
|
364
306
|
function isRegExp(obj) {
|
|
365
|
-
|
|
366
|
-
toStr(obj) === "[object RegExp]" &&
|
|
367
|
-
(!toStringTag || !(typeof obj === "object" && toStringTag in obj))
|
|
368
|
-
);
|
|
307
|
+
return toStr(obj) === "[object RegExp]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
369
308
|
}
|
|
370
309
|
function isError(obj) {
|
|
371
|
-
|
|
372
|
-
toStr(obj) === "[object Error]" &&
|
|
373
|
-
(!toStringTag || !(typeof obj === "object" && toStringTag in obj))
|
|
374
|
-
);
|
|
310
|
+
return toStr(obj) === "[object Error]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
375
311
|
}
|
|
376
312
|
function isString(obj) {
|
|
377
|
-
|
|
378
|
-
toStr(obj) === "[object String]" &&
|
|
379
|
-
(!toStringTag || !(typeof obj === "object" && toStringTag in obj))
|
|
380
|
-
);
|
|
313
|
+
return toStr(obj) === "[object String]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
381
314
|
}
|
|
382
315
|
function isNumber(obj) {
|
|
383
|
-
|
|
384
|
-
toStr(obj) === "[object Number]" &&
|
|
385
|
-
(!toStringTag || !(typeof obj === "object" && toStringTag in obj))
|
|
386
|
-
);
|
|
316
|
+
return toStr(obj) === "[object Number]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
387
317
|
}
|
|
388
318
|
function isBoolean(obj) {
|
|
389
|
-
|
|
390
|
-
toStr(obj) === "[object Boolean]" &&
|
|
391
|
-
(!toStringTag || !(typeof obj === "object" && toStringTag in obj))
|
|
392
|
-
);
|
|
319
|
+
return toStr(obj) === "[object Boolean]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
393
320
|
}
|
|
394
321
|
|
|
395
322
|
// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
|
|
396
323
|
function isSymbol(obj) {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
324
|
+
if (hasShammedSymbols) {
|
|
325
|
+
return obj && typeof obj === "object" && obj instanceof Symbol;
|
|
326
|
+
}
|
|
327
|
+
if (typeof obj === "symbol") {
|
|
328
|
+
return true;
|
|
329
|
+
}
|
|
330
|
+
if (!obj || typeof obj !== "object" || !symToString) {
|
|
331
|
+
return false;
|
|
332
|
+
}
|
|
333
|
+
try {
|
|
334
|
+
symToString.call(obj);
|
|
335
|
+
return true;
|
|
336
|
+
} catch (e) {}
|
|
337
|
+
return false;
|
|
411
338
|
}
|
|
412
339
|
|
|
413
340
|
function isBigInt(obj) {
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
341
|
+
if (!obj || typeof obj !== "object" || !bigIntValueOf) {
|
|
342
|
+
return false;
|
|
343
|
+
}
|
|
344
|
+
try {
|
|
345
|
+
bigIntValueOf.call(obj);
|
|
346
|
+
return true;
|
|
347
|
+
} catch (e) {}
|
|
348
|
+
return false;
|
|
422
349
|
}
|
|
423
350
|
|
|
424
351
|
var hasOwn =
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
352
|
+
Object.prototype.hasOwnProperty ||
|
|
353
|
+
function (key) {
|
|
354
|
+
return key in this;
|
|
355
|
+
};
|
|
429
356
|
function has(obj, key) {
|
|
430
|
-
|
|
357
|
+
return hasOwn.call(obj, key);
|
|
431
358
|
}
|
|
432
359
|
|
|
433
360
|
function toStr(obj) {
|
|
434
|
-
|
|
361
|
+
return objectToString.call(obj);
|
|
435
362
|
}
|
|
436
363
|
|
|
437
364
|
function nameOf(f) {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
365
|
+
if (f.name) {
|
|
366
|
+
return f.name;
|
|
367
|
+
}
|
|
368
|
+
var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
|
|
369
|
+
if (m) {
|
|
370
|
+
return m[1];
|
|
371
|
+
}
|
|
372
|
+
return null;
|
|
446
373
|
}
|
|
447
374
|
|
|
448
375
|
function indexOf(xs, x) {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
376
|
+
if (xs.indexOf) {
|
|
377
|
+
return xs.indexOf(x);
|
|
378
|
+
}
|
|
379
|
+
for (var i = 0, l = xs.length; i < l; i++) {
|
|
380
|
+
if (xs[i] === x) {
|
|
381
|
+
return i;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return -1;
|
|
458
385
|
}
|
|
459
386
|
|
|
460
387
|
function isMap(x) {
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
388
|
+
if (!mapSize || !x || typeof x !== "object") {
|
|
389
|
+
return false;
|
|
390
|
+
}
|
|
391
|
+
try {
|
|
392
|
+
mapSize.call(x);
|
|
393
|
+
try {
|
|
394
|
+
setSize.call(x);
|
|
395
|
+
} catch (s) {
|
|
396
|
+
return true;
|
|
397
|
+
}
|
|
398
|
+
return x instanceof Map; // core-js workaround, pre-v2.5.0
|
|
399
|
+
} catch (e) {}
|
|
400
|
+
return false;
|
|
474
401
|
}
|
|
475
402
|
|
|
476
403
|
function isWeakMap(x) {
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
404
|
+
if (!weakMapHas || !x || typeof x !== "object") {
|
|
405
|
+
return false;
|
|
406
|
+
}
|
|
407
|
+
try {
|
|
408
|
+
weakMapHas.call(x, weakMapHas);
|
|
409
|
+
try {
|
|
410
|
+
weakSetHas.call(x, weakSetHas);
|
|
411
|
+
} catch (s) {
|
|
412
|
+
return true;
|
|
413
|
+
}
|
|
414
|
+
return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
|
|
415
|
+
} catch (e) {}
|
|
416
|
+
return false;
|
|
490
417
|
}
|
|
491
418
|
|
|
492
419
|
function isWeakRef(x) {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
420
|
+
if (!weakRefDeref || !x || typeof x !== "object") {
|
|
421
|
+
return false;
|
|
422
|
+
}
|
|
423
|
+
try {
|
|
424
|
+
weakRefDeref.call(x);
|
|
425
|
+
return true;
|
|
426
|
+
} catch (e) {}
|
|
427
|
+
return false;
|
|
501
428
|
}
|
|
502
429
|
|
|
503
430
|
function isSet(x) {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
431
|
+
if (!setSize || !x || typeof x !== "object") {
|
|
432
|
+
return false;
|
|
433
|
+
}
|
|
434
|
+
try {
|
|
435
|
+
setSize.call(x);
|
|
436
|
+
try {
|
|
437
|
+
mapSize.call(x);
|
|
438
|
+
} catch (m) {
|
|
439
|
+
return true;
|
|
440
|
+
}
|
|
441
|
+
return x instanceof Set; // core-js workaround, pre-v2.5.0
|
|
442
|
+
} catch (e) {}
|
|
443
|
+
return false;
|
|
517
444
|
}
|
|
518
445
|
|
|
519
446
|
function isWeakSet(x) {
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
447
|
+
if (!weakSetHas || !x || typeof x !== "object") {
|
|
448
|
+
return false;
|
|
449
|
+
}
|
|
450
|
+
try {
|
|
451
|
+
weakSetHas.call(x, weakSetHas);
|
|
452
|
+
try {
|
|
453
|
+
weakMapHas.call(x, weakMapHas);
|
|
454
|
+
} catch (s) {
|
|
455
|
+
return true;
|
|
456
|
+
}
|
|
457
|
+
return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
|
|
458
|
+
} catch (e) {}
|
|
459
|
+
return false;
|
|
533
460
|
}
|
|
534
461
|
|
|
535
462
|
function isElement(x) {
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
463
|
+
if (!x || typeof x !== "object") {
|
|
464
|
+
return false;
|
|
465
|
+
}
|
|
466
|
+
if (typeof HTMLElement !== "undefined" && x instanceof HTMLElement) {
|
|
467
|
+
return true;
|
|
468
|
+
}
|
|
469
|
+
return typeof x.nodeName === "string" && typeof x.getAttribute === "function";
|
|
543
470
|
}
|
|
544
471
|
|
|
545
472
|
function inspectString(str, opts) {
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
// eslint-disable-next-line no-control-regex
|
|
555
|
-
var s = $replace.call(
|
|
556
|
-
$replace.call(str, /(['\\])/g, "\\$1"),
|
|
557
|
-
/[\x00-\x1f]/g,
|
|
558
|
-
lowbyte
|
|
559
|
-
);
|
|
560
|
-
return wrapQuotes(s, "single", opts);
|
|
473
|
+
if (str.length > opts.maxStringLength) {
|
|
474
|
+
var remaining = str.length - opts.maxStringLength;
|
|
475
|
+
var trailer = "... " + remaining + " more character" + (remaining > 1 ? "s" : "");
|
|
476
|
+
return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
|
|
477
|
+
}
|
|
478
|
+
// eslint-disable-next-line no-control-regex
|
|
479
|
+
var s = $replace.call($replace.call(str, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, lowbyte);
|
|
480
|
+
return wrapQuotes(s, "single", opts);
|
|
561
481
|
}
|
|
562
482
|
|
|
563
483
|
function lowbyte(c) {
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
484
|
+
var n = c.charCodeAt(0);
|
|
485
|
+
var x = {
|
|
486
|
+
8: "b",
|
|
487
|
+
9: "t",
|
|
488
|
+
10: "n",
|
|
489
|
+
12: "f",
|
|
490
|
+
13: "r",
|
|
491
|
+
}[n];
|
|
492
|
+
if (x) {
|
|
493
|
+
return "\\" + x;
|
|
494
|
+
}
|
|
495
|
+
return "\\x" + (n < 0x10 ? "0" : "") + $toUpperCase.call(n.toString(16));
|
|
576
496
|
}
|
|
577
497
|
|
|
578
498
|
function markBoxed(str) {
|
|
579
|
-
|
|
499
|
+
return "Object(" + str + ")";
|
|
580
500
|
}
|
|
581
501
|
|
|
582
502
|
function weakCollectionOf(type) {
|
|
583
|
-
|
|
503
|
+
return type + " { ? }";
|
|
584
504
|
}
|
|
585
505
|
|
|
586
506
|
function collectionOf(type, size, entries, indent) {
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
: $join.call(entries, ", ");
|
|
590
|
-
return type + " (" + size + ") {" + joinedEntries + "}";
|
|
507
|
+
var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ", ");
|
|
508
|
+
return type + " (" + size + ") {" + joinedEntries + "}";
|
|
591
509
|
}
|
|
592
510
|
|
|
593
511
|
function singleLineValues(xs) {
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
512
|
+
for (var i = 0; i < xs.length; i++) {
|
|
513
|
+
if (indexOf(xs[i], "\n") >= 0) {
|
|
514
|
+
return false;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
return true;
|
|
600
518
|
}
|
|
601
519
|
|
|
602
520
|
function getIndent(opts, depth) {
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
521
|
+
var baseIndent;
|
|
522
|
+
if (opts.indent === "\t") {
|
|
523
|
+
baseIndent = "\t";
|
|
524
|
+
} else if (typeof opts.indent === "number" && opts.indent > 0) {
|
|
525
|
+
baseIndent = $join.call(Array(opts.indent + 1), " ");
|
|
526
|
+
} else {
|
|
527
|
+
return null;
|
|
528
|
+
}
|
|
529
|
+
return {
|
|
530
|
+
base: baseIndent,
|
|
531
|
+
prev: $join.call(Array(depth + 1), baseIndent),
|
|
532
|
+
};
|
|
615
533
|
}
|
|
616
534
|
|
|
617
535
|
function indentedJoin(xs, indent) {
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
536
|
+
if (xs.length === 0) {
|
|
537
|
+
return "";
|
|
538
|
+
}
|
|
539
|
+
var lineJoiner = "\n" + indent.prev + indent.base;
|
|
540
|
+
return lineJoiner + $join.call(xs, "," + lineJoiner) + "\n" + indent.prev;
|
|
623
541
|
}
|
|
624
542
|
|
|
625
543
|
function arrObjKeys(obj, inspect) {
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
544
|
+
var isArr = isArray(obj);
|
|
545
|
+
var xs = [];
|
|
546
|
+
if (isArr) {
|
|
547
|
+
xs.length = obj.length;
|
|
548
|
+
for (var i = 0; i < obj.length; i++) {
|
|
549
|
+
xs[i] = has(obj, i) ? inspect(obj[i], obj) : "";
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
var syms = typeof gOPS === "function" ? gOPS(obj) : [];
|
|
553
|
+
var symMap;
|
|
554
|
+
if (hasShammedSymbols) {
|
|
555
|
+
symMap = {};
|
|
556
|
+
for (var k = 0; k < syms.length; k++) {
|
|
557
|
+
symMap["$" + syms[k]] = syms[k];
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
for (var key in obj) {
|
|
562
|
+
// eslint-disable-line no-restricted-syntax
|
|
563
|
+
if (!has(obj, key)) {
|
|
564
|
+
continue;
|
|
565
|
+
} // eslint-disable-line no-restricted-syntax, no-continue
|
|
566
|
+
if (isArr && String(Number(key)) === key && key < obj.length) {
|
|
567
|
+
continue;
|
|
568
|
+
} // eslint-disable-line no-restricted-syntax, no-continue
|
|
569
|
+
if (hasShammedSymbols && symMap["$" + key] instanceof Symbol) {
|
|
570
|
+
// this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
|
|
571
|
+
continue; // eslint-disable-line no-restricted-syntax, no-continue
|
|
572
|
+
} else if ($test.call(/[^\w$]/, key)) {
|
|
573
|
+
xs.push(inspect(key, obj) + ": " + inspect(obj[key], obj));
|
|
574
|
+
} else {
|
|
575
|
+
xs.push(key + ": " + inspect(obj[key], obj));
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
if (typeof gOPS === "function") {
|
|
579
|
+
for (var j = 0; j < syms.length; j++) {
|
|
580
|
+
if (isEnumerable.call(obj, syms[j])) {
|
|
581
|
+
xs.push("[" + inspect(syms[j]) + "]: " + inspect(obj[syms[j]], obj));
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
return xs;
|
|
668
586
|
}
|