jodit 4.13.21 → 4.13.23
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/CHANGELOG.md +12 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +4 -4
- package/es2015/jodit.js +29 -34
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +4 -4
- package/es2015/plugins/debug/debug.css +1 -1
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +4 -4
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +4 -4
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +4 -4
- package/es2021/jodit.js +27 -34
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +4 -4
- package/es2021/plugins/debug/debug.css +1 -1
- package/es2021/plugins/debug/debug.js +1 -1
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021.en/jodit.css +1 -1
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +4 -4
- package/es2021.en/jodit.js +27 -34
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +4 -4
- package/es2021.en/plugins/debug/debug.css +1 -1
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +55 -34
- package/es5/jodit.min.css +3 -3
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/polyfills.fat.min.js +2 -2
- package/es5/polyfills.js +213 -87
- package/es5/polyfills.min.js +2 -2
- package/esm/core/constants.js +1 -1
- package/esm/modules/uploader/helpers/data-uri-to-blob.d.ts +3 -1
- package/esm/modules/uploader/helpers/data-uri-to-blob.js +7 -8
- package/esm/plugins/clean-html/helpers/visitor/filters/remove-empty-text-node.js +7 -1
- package/esm/plugins/clean-html/helpers/visitor/filters/remove-inv-text-nodes.js +4 -1
- package/esm/plugins/image-processor/image-processor.js +11 -19
- package/package.json +1 -1
- package/types/modules/uploader/helpers/data-uri-to-blob.d.ts +3 -1
package/es5/polyfills.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
4
|
-
* Version: v4.13.
|
|
4
|
+
* Version: v4.13.23
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1398,18 +1398,20 @@ var isConstructor = __webpack_require__(46119);
|
|
|
1398
1398
|
var lengthOfArrayLike = __webpack_require__(23832);
|
|
1399
1399
|
var createProperty = __webpack_require__(15526);
|
|
1400
1400
|
var setArrayLength = __webpack_require__(94465);
|
|
1401
|
-
var getIterator = __webpack_require__(
|
|
1402
|
-
var getIteratorMethod = __webpack_require__(
|
|
1401
|
+
var getIterator = __webpack_require__(46593);
|
|
1402
|
+
var getIteratorMethod = __webpack_require__(96003);
|
|
1403
|
+
var iteratorClose = __webpack_require__(73737);
|
|
1404
|
+
var doesNotExceedSafeInteger = __webpack_require__(59979);
|
|
1403
1405
|
var $Array = Array;
|
|
1404
1406
|
// `Array.from` method implementation
|
|
1405
1407
|
// https://tc39.es/ecma262/#sec-array.from
|
|
1406
1408
|
module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */ ) {
|
|
1407
|
-
var O = toObject(arrayLike);
|
|
1408
1409
|
var IS_CONSTRUCTOR = isConstructor(this);
|
|
1409
1410
|
var argumentsLength = arguments.length;
|
|
1410
1411
|
var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
|
|
1411
1412
|
var mapping = mapfn !== undefined;
|
|
1412
1413
|
if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
|
|
1414
|
+
var O = toObject(arrayLike);
|
|
1413
1415
|
var iteratorMethod = getIteratorMethod(O);
|
|
1414
1416
|
var index = 0;
|
|
1415
1417
|
var length, result, step, iterator, next, value;
|
|
@@ -1419,11 +1421,20 @@ module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undef
|
|
|
1419
1421
|
iterator = getIterator(O, iteratorMethod);
|
|
1420
1422
|
next = iterator.next;
|
|
1421
1423
|
for(; !(step = call(next, iterator)).done; index++){
|
|
1424
|
+
try {
|
|
1425
|
+
doesNotExceedSafeInteger(index);
|
|
1426
|
+
} catch (error) {
|
|
1427
|
+
iteratorClose(iterator, 'throw', error);
|
|
1428
|
+
}
|
|
1422
1429
|
value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [
|
|
1423
1430
|
step.value,
|
|
1424
1431
|
index
|
|
1425
1432
|
], true) : step.value;
|
|
1426
|
-
|
|
1433
|
+
try {
|
|
1434
|
+
createProperty(result, index, value);
|
|
1435
|
+
} catch (error) {
|
|
1436
|
+
iteratorClose(iterator, 'throw', error);
|
|
1437
|
+
}
|
|
1427
1438
|
}
|
|
1428
1439
|
} else {
|
|
1429
1440
|
length = lengthOfArrayLike(O);
|
|
@@ -2044,7 +2055,7 @@ module.exports = function(it) {
|
|
|
2044
2055
|
var $TypeError = TypeError;
|
|
2045
2056
|
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
|
|
2046
2057
|
module.exports = function(it) {
|
|
2047
|
-
if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
|
|
2058
|
+
if (it > MAX_SAFE_INTEGER) throw new $TypeError('Maximum allowed index exceeded');
|
|
2048
2059
|
return it;
|
|
2049
2060
|
};
|
|
2050
2061
|
|
|
@@ -2208,27 +2219,6 @@ module.exports = function(exec) {
|
|
|
2208
2219
|
};
|
|
2209
2220
|
|
|
2210
2221
|
|
|
2211
|
-
/***/ }),
|
|
2212
|
-
|
|
2213
|
-
/***/ 90003:
|
|
2214
|
-
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
2215
|
-
|
|
2216
|
-
"use strict";
|
|
2217
|
-
|
|
2218
|
-
function _type_of(obj) {
|
|
2219
|
-
"@swc/helpers - typeof";
|
|
2220
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
2221
|
-
}
|
|
2222
|
-
var NATIVE_BIND = __webpack_require__(37770);
|
|
2223
|
-
var FunctionPrototype = Function.prototype;
|
|
2224
|
-
var apply = FunctionPrototype.apply;
|
|
2225
|
-
var call = FunctionPrototype.call;
|
|
2226
|
-
// eslint-disable-next-line es/no-function-prototype-bind, es/no-reflect -- safe
|
|
2227
|
-
module.exports = (typeof Reflect === "undefined" ? "undefined" : _type_of(Reflect)) == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function() {
|
|
2228
|
-
return call.apply(apply, arguments);
|
|
2229
|
-
});
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
2222
|
/***/ }),
|
|
2233
2223
|
|
|
2234
2224
|
/***/ 71594:
|
|
@@ -2375,39 +2365,39 @@ module.exports = function(namespace, method) {
|
|
|
2375
2365
|
|
|
2376
2366
|
/***/ }),
|
|
2377
2367
|
|
|
2378
|
-
/***/
|
|
2368
|
+
/***/ 46593:
|
|
2379
2369
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
2380
2370
|
|
|
2381
2371
|
"use strict";
|
|
2382
2372
|
|
|
2383
|
-
var
|
|
2384
|
-
var
|
|
2385
|
-
var
|
|
2386
|
-
var
|
|
2387
|
-
var
|
|
2388
|
-
var
|
|
2389
|
-
module.exports = function(
|
|
2390
|
-
|
|
2373
|
+
var call = __webpack_require__(26919);
|
|
2374
|
+
var isCallable = __webpack_require__(14595);
|
|
2375
|
+
var anObject = __webpack_require__(30941);
|
|
2376
|
+
var tryToString = __webpack_require__(8465);
|
|
2377
|
+
var getIteratorMethod = __webpack_require__(96003);
|
|
2378
|
+
var $TypeError = TypeError;
|
|
2379
|
+
module.exports = function(argument, usingIterator) {
|
|
2380
|
+
var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
|
|
2381
|
+
if (isCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
|
|
2382
|
+
throw new $TypeError(tryToString(argument) + ' is not iterable');
|
|
2391
2383
|
};
|
|
2392
2384
|
|
|
2393
2385
|
|
|
2394
2386
|
/***/ }),
|
|
2395
2387
|
|
|
2396
|
-
/***/
|
|
2388
|
+
/***/ 96003:
|
|
2397
2389
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
2398
2390
|
|
|
2399
2391
|
"use strict";
|
|
2400
2392
|
|
|
2401
|
-
var
|
|
2402
|
-
var
|
|
2403
|
-
var
|
|
2404
|
-
var
|
|
2405
|
-
var
|
|
2406
|
-
var
|
|
2407
|
-
module.exports = function(
|
|
2408
|
-
|
|
2409
|
-
if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
|
|
2410
|
-
throw new $TypeError(tryToString(argument) + ' is not iterable');
|
|
2393
|
+
var classof = __webpack_require__(66310);
|
|
2394
|
+
var isNullOrUndefined = __webpack_require__(41943);
|
|
2395
|
+
var getMethod = __webpack_require__(57996);
|
|
2396
|
+
var wellKnownSymbol = __webpack_require__(50617);
|
|
2397
|
+
var ITERATOR = wellKnownSymbol('iterator');
|
|
2398
|
+
var ArrayPrototype = Array.prototype;
|
|
2399
|
+
module.exports = function(it) {
|
|
2400
|
+
if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR) || getMethod(it, '@@iterator') || (classof(it) === 'Arguments' ? ArrayPrototype[ITERATOR] : undefined);
|
|
2411
2401
|
};
|
|
2412
2402
|
|
|
2413
2403
|
|
|
@@ -3085,7 +3075,7 @@ module.exports = {
|
|
|
3085
3075
|
|
|
3086
3076
|
"use strict";
|
|
3087
3077
|
|
|
3088
|
-
module.exports = {};
|
|
3078
|
+
module.exports = Object.create ? Object.create(null) : {};
|
|
3089
3079
|
|
|
3090
3080
|
|
|
3091
3081
|
/***/ }),
|
|
@@ -3806,10 +3796,10 @@ var defineGlobalProperty = __webpack_require__(36759);
|
|
|
3806
3796
|
var SHARED = '__core-js_shared__';
|
|
3807
3797
|
var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
|
|
3808
3798
|
(store.versions || (store.versions = [])).push({
|
|
3809
|
-
version: '3.
|
|
3799
|
+
version: '3.50.0',
|
|
3810
3800
|
mode: IS_PURE ? 'pure' : 'global',
|
|
3811
3801
|
copyright: '© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.',
|
|
3812
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
3802
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE',
|
|
3813
3803
|
source: 'https://github.com/zloirock/core-js'
|
|
3814
3804
|
});
|
|
3815
3805
|
|
|
@@ -3822,8 +3812,10 @@ var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED,
|
|
|
3822
3812
|
"use strict";
|
|
3823
3813
|
|
|
3824
3814
|
var store = __webpack_require__(49567);
|
|
3815
|
+
// eslint-disable-next-line es/no-object-create -- safe
|
|
3816
|
+
var create = Object.create || Object;
|
|
3825
3817
|
module.exports = function(key, value) {
|
|
3826
|
-
return store[key] || (store[key] = value ||
|
|
3818
|
+
return store[key] || (store[key] = value || create(null));
|
|
3827
3819
|
};
|
|
3828
3820
|
|
|
3829
3821
|
|
|
@@ -3931,6 +3923,19 @@ var NATIVE_SYMBOL = __webpack_require__(74693);
|
|
|
3931
3923
|
/* eslint-disable es/no-symbol -- safe */ module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor;
|
|
3932
3924
|
|
|
3933
3925
|
|
|
3926
|
+
/***/ }),
|
|
3927
|
+
|
|
3928
|
+
/***/ 88710:
|
|
3929
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
3930
|
+
|
|
3931
|
+
"use strict";
|
|
3932
|
+
|
|
3933
|
+
var uncurryThis = __webpack_require__(46738);
|
|
3934
|
+
// `thisNumberValue` abstract operation
|
|
3935
|
+
// https://tc39.es/ecma262/#sec-thisnumbervalue
|
|
3936
|
+
module.exports = uncurryThis(1.1.valueOf);
|
|
3937
|
+
|
|
3938
|
+
|
|
3934
3939
|
/***/ }),
|
|
3935
3940
|
|
|
3936
3941
|
/***/ 56184:
|
|
@@ -4360,37 +4365,57 @@ $({
|
|
|
4360
4365
|
|
|
4361
4366
|
"use strict";
|
|
4362
4367
|
|
|
4368
|
+
function _type_of(obj) {
|
|
4369
|
+
"@swc/helpers - typeof";
|
|
4370
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
4371
|
+
}
|
|
4363
4372
|
var $ = __webpack_require__(50300);
|
|
4364
4373
|
var getBuiltIn = __webpack_require__(29833);
|
|
4365
|
-
var apply = __webpack_require__(90003);
|
|
4366
4374
|
var call = __webpack_require__(26919);
|
|
4367
4375
|
var uncurryThis = __webpack_require__(46738);
|
|
4368
4376
|
var fails = __webpack_require__(96673);
|
|
4369
4377
|
var isArray = __webpack_require__(40554);
|
|
4370
4378
|
var isCallable = __webpack_require__(14595);
|
|
4379
|
+
var isObject = __webpack_require__(78144);
|
|
4380
|
+
var create = __webpack_require__(99746);
|
|
4371
4381
|
var isRawJSON = __webpack_require__(91000);
|
|
4372
4382
|
var isSymbol = __webpack_require__(71975);
|
|
4373
4383
|
var classof = __webpack_require__(66310);
|
|
4384
|
+
var thisNumberValue = __webpack_require__(88710);
|
|
4385
|
+
var includes = (__webpack_require__(59299).includes);
|
|
4386
|
+
var hasOwn = __webpack_require__(26419);
|
|
4374
4387
|
var toString = __webpack_require__(13181);
|
|
4375
|
-
var arraySlice = __webpack_require__(13450);
|
|
4376
4388
|
var parseJSONString = __webpack_require__(26298);
|
|
4377
4389
|
var uid = __webpack_require__(18818);
|
|
4378
4390
|
var NATIVE_SYMBOL = __webpack_require__(74693);
|
|
4379
4391
|
var NATIVE_RAW_JSON = __webpack_require__(93413);
|
|
4380
4392
|
var $String = String;
|
|
4393
|
+
var $TypeError = TypeError;
|
|
4381
4394
|
var $stringify = getBuiltIn('JSON', 'stringify');
|
|
4395
|
+
var $BigInt = getBuiltIn('BigInt');
|
|
4396
|
+
var stringValueOf = uncurryThis(''.valueOf);
|
|
4397
|
+
var booleanValueOf = uncurryThis(true.valueOf);
|
|
4398
|
+
var bigIntValueOf = $BigInt && uncurryThis($BigInt.prototype.valueOf);
|
|
4382
4399
|
var exec = uncurryThis(/./.exec);
|
|
4383
4400
|
var charAt = uncurryThis(''.charAt);
|
|
4384
4401
|
var charCodeAt = uncurryThis(''.charCodeAt);
|
|
4385
4402
|
var replace = uncurryThis(''.replace);
|
|
4386
4403
|
var slice = uncurryThis(''.slice);
|
|
4387
4404
|
var push = uncurryThis([].push);
|
|
4405
|
+
var pop = uncurryThis([].pop);
|
|
4388
4406
|
var numberToString = uncurryThis(1.1.toString);
|
|
4389
4407
|
var surrogates = /[\uD800-\uDFFF]/g;
|
|
4390
|
-
var
|
|
4391
|
-
var
|
|
4392
|
-
var
|
|
4393
|
-
|
|
4408
|
+
var leadingSurrogates = /^[\uD800-\uDBFF]$/;
|
|
4409
|
+
var trailingSurrogates = /^[\uDC00-\uDFFF]$/;
|
|
4410
|
+
var digits = /^\d+$/;
|
|
4411
|
+
// a placeholder of a raw JSON value
|
|
4412
|
+
var RAW_MARK = uid();
|
|
4413
|
+
// a prefix of keys of a reordered object, see `createOrderedObject`
|
|
4414
|
+
var KEY_MARK = uid();
|
|
4415
|
+
// the last key of a reordered object, marks the end of its serialization
|
|
4416
|
+
var END_MARK = uid();
|
|
4417
|
+
var RAW_MARK_LENGTH = RAW_MARK.length;
|
|
4418
|
+
var KEY_MARK_LENGTH = KEY_MARK.length;
|
|
4394
4419
|
var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function() {
|
|
4395
4420
|
var symbol = getBuiltIn('Symbol')('stringify detection');
|
|
4396
4421
|
// MS Edge converts symbol values to JSON as {}
|
|
@@ -4404,46 +4429,101 @@ var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function() {
|
|
|
4404
4429
|
var ILL_FORMED_UNICODE = fails(function() {
|
|
4405
4430
|
return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"' || $stringify('\uDEAD') !== '"\\udead"';
|
|
4406
4431
|
});
|
|
4407
|
-
var
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
if (isCallable($replacer)) value = call($replacer, this, $String(key), value);
|
|
4414
|
-
if (!isSymbol(value)) return value;
|
|
4415
|
-
};
|
|
4416
|
-
return apply($stringify, null, args);
|
|
4432
|
+
var isRawJSONValue = NATIVE_RAW_JSON ? getBuiltIn('JSON', 'isRawJSON') : isRawJSON;
|
|
4433
|
+
var stringifyWithProperSymbolsConversion = WRONG_SYMBOLS_CONVERSION ? function(it, replacer, space) {
|
|
4434
|
+
return $stringify(it, function(key, value) {
|
|
4435
|
+
var replaced = call(replacer, this, key, value);
|
|
4436
|
+
if (!isSymbol(replaced)) return replaced;
|
|
4437
|
+
}, space);
|
|
4417
4438
|
} : $stringify;
|
|
4418
4439
|
var fixIllFormedJSON = function fixIllFormedJSON(match, offset, string) {
|
|
4419
4440
|
var prev = charAt(string, offset - 1);
|
|
4420
4441
|
var next = charAt(string, offset + 1);
|
|
4421
|
-
if (exec(
|
|
4442
|
+
if (exec(leadingSurrogates, match) && !exec(trailingSurrogates, next) || exec(trailingSurrogates, match) && !exec(leadingSurrogates, prev)) {
|
|
4422
4443
|
return '\\u' + numberToString(charCodeAt(match, 0), 16);
|
|
4423
4444
|
}
|
|
4424
4445
|
return match;
|
|
4425
4446
|
};
|
|
4426
|
-
|
|
4427
|
-
|
|
4447
|
+
// `PropertyList` of `JSON.stringify`
|
|
4448
|
+
// https://tc39.es/ecma262/#sec-json.stringify
|
|
4449
|
+
var getPropertyList = function getPropertyList(replacer) {
|
|
4428
4450
|
if (!isArray(replacer)) return;
|
|
4429
4451
|
var rawLength = replacer.length;
|
|
4430
|
-
var
|
|
4452
|
+
var propertyList = [];
|
|
4453
|
+
// a null prototype object is used as a set of already added keys to keep the deduplication linear
|
|
4454
|
+
var addedKeys = create(null);
|
|
4431
4455
|
for(var i = 0; i < rawLength; i++){
|
|
4432
4456
|
var element = replacer[i];
|
|
4433
|
-
|
|
4434
|
-
|
|
4457
|
+
var key;
|
|
4458
|
+
if (typeof element == 'string') key = element;
|
|
4459
|
+
else if (typeof element == 'number' || classof(element) === 'Number' || classof(element) === 'String') key = toString(element);
|
|
4460
|
+
else continue;
|
|
4461
|
+
if (!hasOwn(addedKeys, key)) {
|
|
4462
|
+
addedKeys[key] = true;
|
|
4463
|
+
push(propertyList, key);
|
|
4464
|
+
}
|
|
4435
4465
|
}
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4466
|
+
return propertyList;
|
|
4467
|
+
};
|
|
4468
|
+
// values with such an internal slot are unwrapped by `SerializeJSONProperty` instead of being serialized as objects
|
|
4469
|
+
var hasInternalSlot = function hasInternalSlot(valueOf, it) {
|
|
4470
|
+
try {
|
|
4471
|
+
valueOf(it);
|
|
4472
|
+
return true;
|
|
4473
|
+
} catch (error) {
|
|
4474
|
+
return false;
|
|
4475
|
+
}
|
|
4476
|
+
};
|
|
4477
|
+
// the slot check is expensive, so it's performed only for the kind reported by the value itself -
|
|
4478
|
+
// a value lying about its kind via `Symbol.toStringTag` is serialized as an ordinary object
|
|
4479
|
+
var isBoxedPrimitive = function isBoxedPrimitive(it) {
|
|
4480
|
+
var kind = classof(it);
|
|
4481
|
+
return kind === 'Number' && hasInternalSlot(thisNumberValue, it) || kind === 'String' && hasInternalSlot(stringValueOf, it) || kind === 'Boolean' && hasInternalSlot(booleanValueOf, it) || !!bigIntValueOf && kind === 'BigInt' && hasInternalSlot(bigIntValueOf, it);
|
|
4482
|
+
};
|
|
4483
|
+
// only objects serialized by `SerializeJSONObject` are affected by the property list
|
|
4484
|
+
var isSerializedAsObject = function isSerializedAsObject(it) {
|
|
4485
|
+
if (!isObject(it) || isCallable(it) || isArray(it)) return false;
|
|
4486
|
+
try {
|
|
4487
|
+
return !isBoxedPrimitive(it);
|
|
4488
|
+
// `classof` reads `Symbol.toStringTag`, so a proxy could throw - it has no internal slots anyway
|
|
4489
|
+
} catch (error) {
|
|
4490
|
+
return true;
|
|
4491
|
+
}
|
|
4492
|
+
};
|
|
4493
|
+
// the engine unwraps it in the same order as it would read the original property,
|
|
4494
|
+
// so the property is read lazily and `toJSON` is called once and with the original key
|
|
4495
|
+
var createElementHolder = function createElementHolder(holder, key) {
|
|
4496
|
+
return {
|
|
4497
|
+
toJSON: function toJSON() {
|
|
4498
|
+
var element = holder[key];
|
|
4499
|
+
if (isObject(element) || (typeof element === "undefined" ? "undefined" : _type_of(element)) == 'bigint') {
|
|
4500
|
+
var elementToJSON = element.toJSON;
|
|
4501
|
+
if (isCallable(elementToJSON)) element = call(elementToJSON, element, key);
|
|
4502
|
+
}
|
|
4503
|
+
return element;
|
|
4442
4504
|
}
|
|
4443
|
-
if (isArray(this)) return value;
|
|
4444
|
-
for(var j = 0; j < keysLength; j++)if (keys[j] === key) return value;
|
|
4445
4505
|
};
|
|
4446
4506
|
};
|
|
4507
|
+
// own keys of objects are sorted - integer-like keys are moved to the beginning,
|
|
4508
|
+
// so such keys should be marked and restored in the serialized string
|
|
4509
|
+
var getKeyPrefix = function getKeyPrefix(propertyList) {
|
|
4510
|
+
for(var i = 0, length = propertyList.length; i < length; i++){
|
|
4511
|
+
if (exec(digits, propertyList[i])) return KEY_MARK;
|
|
4512
|
+
}
|
|
4513
|
+
return '';
|
|
4514
|
+
};
|
|
4515
|
+
// `SerializeJSONObject` iterates the property list, so the value is replaced with an object with keys in this order
|
|
4516
|
+
var createOrderedObject = function createOrderedObject(value, propertyList, keyPrefix) {
|
|
4517
|
+
// keys are not marked if the property list has no integer-like keys, so `Object.prototype`
|
|
4518
|
+
// with a setter, a non-writable property or `__proto__` should not intercept the assignment
|
|
4519
|
+
var ordered = create(null);
|
|
4520
|
+
for(var i = 0, length = propertyList.length; i < length; i++){
|
|
4521
|
+
var key = propertyList[i];
|
|
4522
|
+
ordered[keyPrefix + key] = createElementHolder(value, key);
|
|
4523
|
+
}
|
|
4524
|
+
ordered[END_MARK] = null;
|
|
4525
|
+
return ordered;
|
|
4526
|
+
};
|
|
4447
4527
|
// `JSON.stringify` method
|
|
4448
4528
|
// https://tc39.es/ecma262/#sec-json.stringify
|
|
4449
4529
|
// https://github.com/tc39/proposal-json-parse-with-source
|
|
@@ -4454,16 +4534,47 @@ if ($stringify) $({
|
|
|
4454
4534
|
forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE || !NATIVE_RAW_JSON
|
|
4455
4535
|
}, {
|
|
4456
4536
|
stringify: function stringify(text, replacer, space) {
|
|
4457
|
-
var replacerFunction =
|
|
4537
|
+
var replacerFunction = isCallable(replacer) ? replacer : undefined;
|
|
4538
|
+
var propertyList = replacerFunction ? undefined : getPropertyList(replacer);
|
|
4539
|
+
var keyPrefix = propertyList && getKeyPrefix(propertyList);
|
|
4458
4540
|
var rawStrings = [];
|
|
4541
|
+
var openObjects = [];
|
|
4542
|
+
var parentOrdered = [];
|
|
4543
|
+
var currentOrdered;
|
|
4544
|
+
var marked = false;
|
|
4545
|
+
var root = true;
|
|
4459
4546
|
var json = stringifyWithProperSymbolsConversion(text, function(key, value) {
|
|
4460
4547
|
// some old implementations (like WebKit) could pass numbers as keys
|
|
4461
|
-
|
|
4462
|
-
|
|
4548
|
+
key = $String(key);
|
|
4549
|
+
if (propertyList) {
|
|
4550
|
+
if (key === END_MARK) {
|
|
4551
|
+
pop(openObjects);
|
|
4552
|
+
currentOrdered = pop(parentOrdered);
|
|
4553
|
+
return;
|
|
4554
|
+
}
|
|
4555
|
+
if (root) root = false;
|
|
4556
|
+
else if (this !== currentOrdered && !isArray(this) && !includes(propertyList, key)) return;
|
|
4557
|
+
} else if (replacerFunction) value = call(replacerFunction, this, key, value);
|
|
4558
|
+
if (isRawJSONValue(value)) {
|
|
4559
|
+
if (NATIVE_RAW_JSON) return value;
|
|
4560
|
+
marked = true;
|
|
4561
|
+
return RAW_MARK + (push(rawStrings, value.rawJSON) - 1);
|
|
4562
|
+
}
|
|
4563
|
+
if (propertyList && isSerializedAsObject(value)) {
|
|
4564
|
+
// reordered objects are new each time, so cycles should be detected before the engine does it
|
|
4565
|
+
if (includes(openObjects, value)) throw new $TypeError('Converting circular structure to JSON');
|
|
4566
|
+
var ordered = createOrderedObject(value, propertyList, keyPrefix);
|
|
4567
|
+
push(openObjects, value);
|
|
4568
|
+
push(parentOrdered, currentOrdered);
|
|
4569
|
+
currentOrdered = ordered;
|
|
4570
|
+
if (keyPrefix) marked = true;
|
|
4571
|
+
return ordered;
|
|
4572
|
+
}
|
|
4573
|
+
return value;
|
|
4463
4574
|
}, space);
|
|
4464
4575
|
if (typeof json != 'string') return json;
|
|
4465
4576
|
if (ILL_FORMED_UNICODE) json = replace(json, surrogates, fixIllFormedJSON);
|
|
4466
|
-
if (
|
|
4577
|
+
if (!marked) return json;
|
|
4467
4578
|
var result = '';
|
|
4468
4579
|
var length = json.length;
|
|
4469
4580
|
for(var i = 0; i < length; i++){
|
|
@@ -4471,7 +4582,9 @@ if ($stringify) $({
|
|
|
4471
4582
|
if (chr === '"') {
|
|
4472
4583
|
var end = parseJSONString(json, ++i).end - 1;
|
|
4473
4584
|
var string = slice(json, i, end);
|
|
4474
|
-
|
|
4585
|
+
if (slice(string, 0, RAW_MARK_LENGTH) === RAW_MARK) result += rawStrings[slice(string, RAW_MARK_LENGTH)];
|
|
4586
|
+
else if (slice(string, 0, KEY_MARK_LENGTH) === KEY_MARK) result += '"' + slice(string, KEY_MARK_LENGTH) + '"';
|
|
4587
|
+
else result += '"' + string + '"';
|
|
4475
4588
|
i = end;
|
|
4476
4589
|
} else result += chr;
|
|
4477
4590
|
}
|
|
@@ -4737,6 +4850,7 @@ var fallbackDefineProperty = function fallbackDefineProperty(O, P, Attributes) {
|
|
|
4737
4850
|
if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
|
|
4738
4851
|
nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
|
|
4739
4852
|
}
|
|
4853
|
+
return O;
|
|
4740
4854
|
};
|
|
4741
4855
|
var setSymbolDescriptor = DESCRIPTORS && fails(function() {
|
|
4742
4856
|
return nativeObjectCreate(nativeDefineProperty({}, 'a', {
|
|
@@ -4763,7 +4877,8 @@ var $defineProperty = function defineProperty(O, P, Attributes) {
|
|
|
4763
4877
|
var key = toPropertyKey(P);
|
|
4764
4878
|
anObject(Attributes);
|
|
4765
4879
|
if (hasOwn(AllSymbols, key)) {
|
|
4766
|
-
|
|
4880
|
+
// first definition - default non-enumerable; redefinition - preserve existing state
|
|
4881
|
+
if (!('enumerable' in Attributes) ? !hasOwn(O, key) || hasOwn(O, HIDDEN) && O[HIDDEN][key] : !Attributes.enumerable) {
|
|
4767
4882
|
if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, nativeObjectCreate(null)));
|
|
4768
4883
|
O[HIDDEN][key] = true;
|
|
4769
4884
|
} else {
|
|
@@ -4952,6 +5067,7 @@ hiddenKeys[HIDDEN] = true;
|
|
|
4952
5067
|
var $ = __webpack_require__(50300);
|
|
4953
5068
|
var DESCRIPTORS = __webpack_require__(17158);
|
|
4954
5069
|
var globalThis = __webpack_require__(75058);
|
|
5070
|
+
var call = __webpack_require__(26919);
|
|
4955
5071
|
var uncurryThis = __webpack_require__(46738);
|
|
4956
5072
|
var hasOwn = __webpack_require__(26419);
|
|
4957
5073
|
var isCallable = __webpack_require__(14595);
|
|
@@ -4972,6 +5088,16 @@ NativeSymbol().description !== undefined)) {
|
|
|
4972
5088
|
return result;
|
|
4973
5089
|
};
|
|
4974
5090
|
copyConstructorProperties(SymbolWrapper, NativeSymbol);
|
|
5091
|
+
// wrap Symbol.for for correct handling of empty string descriptions
|
|
5092
|
+
var nativeFor = SymbolWrapper['for'];
|
|
5093
|
+
SymbolWrapper['for'] = ({
|
|
5094
|
+
'for': function(key) {
|
|
5095
|
+
var stringKey = toString(key);
|
|
5096
|
+
var symbol = call(nativeFor, this, stringKey);
|
|
5097
|
+
if (stringKey === '') EmptyStringDescriptionStore[symbol] = true;
|
|
5098
|
+
return symbol;
|
|
5099
|
+
}
|
|
5100
|
+
})['for'];
|
|
4975
5101
|
SymbolWrapper.prototype = SymbolPrototype;
|
|
4976
5102
|
SymbolPrototype.constructor = SymbolWrapper;
|
|
4977
5103
|
var NATIVE_SYMBOL = String(NativeSymbol('description detection')) === 'Symbol(description detection)';
|