Edit File by line
/home/barbar84/public_h.../wp-inclu.../js/dist
File: rich-text.js
this["wp"] = this["wp"] || {}; this["wp"]["richText"] =
[0] Fix | Delete
/******/ (function(modules) { // webpackBootstrap
[1] Fix | Delete
/******/ // The module cache
[2] Fix | Delete
/******/ var installedModules = {};
[3] Fix | Delete
/******/
[4] Fix | Delete
/******/ // The require function
[5] Fix | Delete
/******/ function __webpack_require__(moduleId) {
[6] Fix | Delete
/******/
[7] Fix | Delete
/******/ // Check if module is in cache
[8] Fix | Delete
/******/ if(installedModules[moduleId]) {
[9] Fix | Delete
/******/ return installedModules[moduleId].exports;
[10] Fix | Delete
/******/ }
[11] Fix | Delete
/******/ // Create a new module (and put it into the cache)
[12] Fix | Delete
/******/ var module = installedModules[moduleId] = {
[13] Fix | Delete
/******/ i: moduleId,
[14] Fix | Delete
/******/ l: false,
[15] Fix | Delete
/******/ exports: {}
[16] Fix | Delete
/******/ };
[17] Fix | Delete
/******/
[18] Fix | Delete
/******/ // Execute the module function
[19] Fix | Delete
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
[20] Fix | Delete
/******/
[21] Fix | Delete
/******/ // Flag the module as loaded
[22] Fix | Delete
/******/ module.l = true;
[23] Fix | Delete
/******/
[24] Fix | Delete
/******/ // Return the exports of the module
[25] Fix | Delete
/******/ return module.exports;
[26] Fix | Delete
/******/ }
[27] Fix | Delete
/******/
[28] Fix | Delete
/******/
[29] Fix | Delete
/******/ // expose the modules object (__webpack_modules__)
[30] Fix | Delete
/******/ __webpack_require__.m = modules;
[31] Fix | Delete
/******/
[32] Fix | Delete
/******/ // expose the module cache
[33] Fix | Delete
/******/ __webpack_require__.c = installedModules;
[34] Fix | Delete
/******/
[35] Fix | Delete
/******/ // define getter function for harmony exports
[36] Fix | Delete
/******/ __webpack_require__.d = function(exports, name, getter) {
[37] Fix | Delete
/******/ if(!__webpack_require__.o(exports, name)) {
[38] Fix | Delete
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
[39] Fix | Delete
/******/ }
[40] Fix | Delete
/******/ };
[41] Fix | Delete
/******/
[42] Fix | Delete
/******/ // define __esModule on exports
[43] Fix | Delete
/******/ __webpack_require__.r = function(exports) {
[44] Fix | Delete
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
[45] Fix | Delete
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
[46] Fix | Delete
/******/ }
[47] Fix | Delete
/******/ Object.defineProperty(exports, '__esModule', { value: true });
[48] Fix | Delete
/******/ };
[49] Fix | Delete
/******/
[50] Fix | Delete
/******/ // create a fake namespace object
[51] Fix | Delete
/******/ // mode & 1: value is a module id, require it
[52] Fix | Delete
/******/ // mode & 2: merge all properties of value into the ns
[53] Fix | Delete
/******/ // mode & 4: return value when already ns object
[54] Fix | Delete
/******/ // mode & 8|1: behave like require
[55] Fix | Delete
/******/ __webpack_require__.t = function(value, mode) {
[56] Fix | Delete
/******/ if(mode & 1) value = __webpack_require__(value);
[57] Fix | Delete
/******/ if(mode & 8) return value;
[58] Fix | Delete
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
[59] Fix | Delete
/******/ var ns = Object.create(null);
[60] Fix | Delete
/******/ __webpack_require__.r(ns);
[61] Fix | Delete
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
[62] Fix | Delete
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
[63] Fix | Delete
/******/ return ns;
[64] Fix | Delete
/******/ };
[65] Fix | Delete
/******/
[66] Fix | Delete
/******/ // getDefaultExport function for compatibility with non-harmony modules
[67] Fix | Delete
/******/ __webpack_require__.n = function(module) {
[68] Fix | Delete
/******/ var getter = module && module.__esModule ?
[69] Fix | Delete
/******/ function getDefault() { return module['default']; } :
[70] Fix | Delete
/******/ function getModuleExports() { return module; };
[71] Fix | Delete
/******/ __webpack_require__.d(getter, 'a', getter);
[72] Fix | Delete
/******/ return getter;
[73] Fix | Delete
/******/ };
[74] Fix | Delete
/******/
[75] Fix | Delete
/******/ // Object.prototype.hasOwnProperty.call
[76] Fix | Delete
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
[77] Fix | Delete
/******/
[78] Fix | Delete
/******/ // __webpack_public_path__
[79] Fix | Delete
/******/ __webpack_require__.p = "";
[80] Fix | Delete
/******/
[81] Fix | Delete
/******/
[82] Fix | Delete
/******/ // Load entry module and return exports
[83] Fix | Delete
/******/ return __webpack_require__(__webpack_require__.s = "yyEc");
[84] Fix | Delete
/******/ })
[85] Fix | Delete
/************************************************************************/
[86] Fix | Delete
/******/ ({
[87] Fix | Delete
[88] Fix | Delete
/***/ "1CF3":
[89] Fix | Delete
/***/ (function(module, exports) {
[90] Fix | Delete
[91] Fix | Delete
(function() { module.exports = window["wp"]["dom"]; }());
[92] Fix | Delete
[93] Fix | Delete
/***/ }),
[94] Fix | Delete
[95] Fix | Delete
/***/ "1ZqX":
[96] Fix | Delete
/***/ (function(module, exports) {
[97] Fix | Delete
[98] Fix | Delete
(function() { module.exports = window["wp"]["data"]; }());
[99] Fix | Delete
[100] Fix | Delete
/***/ }),
[101] Fix | Delete
[102] Fix | Delete
/***/ "25BE":
[103] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[104] Fix | Delete
[105] Fix | Delete
"use strict";
[106] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
[107] Fix | Delete
function _iterableToArray(iter) {
[108] Fix | Delete
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
[109] Fix | Delete
}
[110] Fix | Delete
[111] Fix | Delete
/***/ }),
[112] Fix | Delete
[113] Fix | Delete
/***/ "BsWD":
[114] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[115] Fix | Delete
[116] Fix | Delete
"use strict";
[117] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; });
[118] Fix | Delete
/* harmony import */ var _babel_runtime_helpers_esm_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("a3WO");
[119] Fix | Delete
[120] Fix | Delete
function _unsupportedIterableToArray(o, minLen) {
[121] Fix | Delete
if (!o) return;
[122] Fix | Delete
if (typeof o === "string") return Object(_babel_runtime_helpers_esm_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
[123] Fix | Delete
var n = Object.prototype.toString.call(o).slice(8, -1);
[124] Fix | Delete
if (n === "Object" && o.constructor) n = o.constructor.name;
[125] Fix | Delete
if (n === "Map" || n === "Set") return Array.from(o);
[126] Fix | Delete
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_babel_runtime_helpers_esm_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
[127] Fix | Delete
}
[128] Fix | Delete
[129] Fix | Delete
/***/ }),
[130] Fix | Delete
[131] Fix | Delete
/***/ "DSFK":
[132] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[133] Fix | Delete
[134] Fix | Delete
"use strict";
[135] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; });
[136] Fix | Delete
function _arrayWithHoles(arr) {
[137] Fix | Delete
if (Array.isArray(arr)) return arr;
[138] Fix | Delete
}
[139] Fix | Delete
[140] Fix | Delete
/***/ }),
[141] Fix | Delete
[142] Fix | Delete
/***/ "GRId":
[143] Fix | Delete
/***/ (function(module, exports) {
[144] Fix | Delete
[145] Fix | Delete
(function() { module.exports = window["wp"]["element"]; }());
[146] Fix | Delete
[147] Fix | Delete
/***/ }),
[148] Fix | Delete
[149] Fix | Delete
/***/ "KQm4":
[150] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[151] Fix | Delete
[152] Fix | Delete
"use strict";
[153] Fix | Delete
[154] Fix | Delete
// EXPORTS
[155] Fix | Delete
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; });
[156] Fix | Delete
[157] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
[158] Fix | Delete
var arrayLikeToArray = __webpack_require__("a3WO");
[159] Fix | Delete
[160] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
[161] Fix | Delete
[162] Fix | Delete
function _arrayWithoutHoles(arr) {
[163] Fix | Delete
if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr);
[164] Fix | Delete
}
[165] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
[166] Fix | Delete
var iterableToArray = __webpack_require__("25BE");
[167] Fix | Delete
[168] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
[169] Fix | Delete
var unsupportedIterableToArray = __webpack_require__("BsWD");
[170] Fix | Delete
[171] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
[172] Fix | Delete
function _nonIterableSpread() {
[173] Fix | Delete
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
[174] Fix | Delete
}
[175] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
[176] Fix | Delete
[177] Fix | Delete
[178] Fix | Delete
[179] Fix | Delete
[180] Fix | Delete
function _toConsumableArray(arr) {
[181] Fix | Delete
return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread();
[182] Fix | Delete
}
[183] Fix | Delete
[184] Fix | Delete
/***/ }),
[185] Fix | Delete
[186] Fix | Delete
/***/ "NMb1":
[187] Fix | Delete
/***/ (function(module, exports) {
[188] Fix | Delete
[189] Fix | Delete
(function() { module.exports = window["wp"]["deprecated"]; }());
[190] Fix | Delete
[191] Fix | Delete
/***/ }),
[192] Fix | Delete
[193] Fix | Delete
/***/ "ODXe":
[194] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[195] Fix | Delete
[196] Fix | Delete
"use strict";
[197] Fix | Delete
[198] Fix | Delete
// EXPORTS
[199] Fix | Delete
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; });
[200] Fix | Delete
[201] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
[202] Fix | Delete
var arrayWithHoles = __webpack_require__("DSFK");
[203] Fix | Delete
[204] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
[205] Fix | Delete
function _iterableToArrayLimit(arr, i) {
[206] Fix | Delete
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
[207] Fix | Delete
var _arr = [];
[208] Fix | Delete
var _n = true;
[209] Fix | Delete
var _d = false;
[210] Fix | Delete
var _e = undefined;
[211] Fix | Delete
[212] Fix | Delete
try {
[213] Fix | Delete
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
[214] Fix | Delete
_arr.push(_s.value);
[215] Fix | Delete
[216] Fix | Delete
if (i && _arr.length === i) break;
[217] Fix | Delete
}
[218] Fix | Delete
} catch (err) {
[219] Fix | Delete
_d = true;
[220] Fix | Delete
_e = err;
[221] Fix | Delete
} finally {
[222] Fix | Delete
try {
[223] Fix | Delete
if (!_n && _i["return"] != null) _i["return"]();
[224] Fix | Delete
} finally {
[225] Fix | Delete
if (_d) throw _e;
[226] Fix | Delete
}
[227] Fix | Delete
}
[228] Fix | Delete
[229] Fix | Delete
return _arr;
[230] Fix | Delete
}
[231] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
[232] Fix | Delete
var unsupportedIterableToArray = __webpack_require__("BsWD");
[233] Fix | Delete
[234] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
[235] Fix | Delete
var nonIterableRest = __webpack_require__("PYwp");
[236] Fix | Delete
[237] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
[238] Fix | Delete
[239] Fix | Delete
[240] Fix | Delete
[241] Fix | Delete
[242] Fix | Delete
function _slicedToArray(arr, i) {
[243] Fix | Delete
return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])();
[244] Fix | Delete
}
[245] Fix | Delete
[246] Fix | Delete
/***/ }),
[247] Fix | Delete
[248] Fix | Delete
/***/ "PYwp":
[249] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[250] Fix | Delete
[251] Fix | Delete
"use strict";
[252] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; });
[253] Fix | Delete
function _nonIterableRest() {
[254] Fix | Delete
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
[255] Fix | Delete
}
[256] Fix | Delete
[257] Fix | Delete
/***/ }),
[258] Fix | Delete
[259] Fix | Delete
/***/ "RxS6":
[260] Fix | Delete
/***/ (function(module, exports) {
[261] Fix | Delete
[262] Fix | Delete
(function() { module.exports = window["wp"]["keycodes"]; }());
[263] Fix | Delete
[264] Fix | Delete
/***/ }),
[265] Fix | Delete
[266] Fix | Delete
/***/ "U8pU":
[267] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[268] Fix | Delete
[269] Fix | Delete
"use strict";
[270] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; });
[271] Fix | Delete
function _typeof(obj) {
[272] Fix | Delete
"@babel/helpers - typeof";
[273] Fix | Delete
[274] Fix | Delete
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
[275] Fix | Delete
_typeof = function _typeof(obj) {
[276] Fix | Delete
return typeof obj;
[277] Fix | Delete
};
[278] Fix | Delete
} else {
[279] Fix | Delete
_typeof = function _typeof(obj) {
[280] Fix | Delete
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
[281] Fix | Delete
};
[282] Fix | Delete
}
[283] Fix | Delete
[284] Fix | Delete
return _typeof(obj);
[285] Fix | Delete
}
[286] Fix | Delete
[287] Fix | Delete
/***/ }),
[288] Fix | Delete
[289] Fix | Delete
/***/ "Vx3V":
[290] Fix | Delete
/***/ (function(module, exports) {
[291] Fix | Delete
[292] Fix | Delete
(function() { module.exports = window["wp"]["escapeHtml"]; }());
[293] Fix | Delete
[294] Fix | Delete
/***/ }),
[295] Fix | Delete
[296] Fix | Delete
/***/ "YLtl":
[297] Fix | Delete
/***/ (function(module, exports) {
[298] Fix | Delete
[299] Fix | Delete
(function() { module.exports = window["lodash"]; }());
[300] Fix | Delete
[301] Fix | Delete
/***/ }),
[302] Fix | Delete
[303] Fix | Delete
/***/ "a3WO":
[304] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[305] Fix | Delete
[306] Fix | Delete
"use strict";
[307] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; });
[308] Fix | Delete
function _arrayLikeToArray(arr, len) {
[309] Fix | Delete
if (len == null || len > arr.length) len = arr.length;
[310] Fix | Delete
[311] Fix | Delete
for (var i = 0, arr2 = new Array(len); i < len; i++) {
[312] Fix | Delete
arr2[i] = arr[i];
[313] Fix | Delete
}
[314] Fix | Delete
[315] Fix | Delete
return arr2;
[316] Fix | Delete
}
[317] Fix | Delete
[318] Fix | Delete
/***/ }),
[319] Fix | Delete
[320] Fix | Delete
/***/ "pPDe":
[321] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[322] Fix | Delete
[323] Fix | Delete
"use strict";
[324] Fix | Delete
[325] Fix | Delete
[326] Fix | Delete
var LEAF_KEY, hasWeakMap;
[327] Fix | Delete
[328] Fix | Delete
/**
[329] Fix | Delete
* Arbitrary value used as key for referencing cache object in WeakMap tree.
[330] Fix | Delete
*
[331] Fix | Delete
* @type {Object}
[332] Fix | Delete
*/
[333] Fix | Delete
LEAF_KEY = {};
[334] Fix | Delete
[335] Fix | Delete
/**
[336] Fix | Delete
* Whether environment supports WeakMap.
[337] Fix | Delete
*
[338] Fix | Delete
* @type {boolean}
[339] Fix | Delete
*/
[340] Fix | Delete
hasWeakMap = typeof WeakMap !== 'undefined';
[341] Fix | Delete
[342] Fix | Delete
/**
[343] Fix | Delete
* Returns the first argument as the sole entry in an array.
[344] Fix | Delete
*
[345] Fix | Delete
* @param {*} value Value to return.
[346] Fix | Delete
*
[347] Fix | Delete
* @return {Array} Value returned as entry in array.
[348] Fix | Delete
*/
[349] Fix | Delete
function arrayOf( value ) {
[350] Fix | Delete
return [ value ];
[351] Fix | Delete
}
[352] Fix | Delete
[353] Fix | Delete
/**
[354] Fix | Delete
* Returns true if the value passed is object-like, or false otherwise. A value
[355] Fix | Delete
* is object-like if it can support property assignment, e.g. object or array.
[356] Fix | Delete
*
[357] Fix | Delete
* @param {*} value Value to test.
[358] Fix | Delete
*
[359] Fix | Delete
* @return {boolean} Whether value is object-like.
[360] Fix | Delete
*/
[361] Fix | Delete
function isObjectLike( value ) {
[362] Fix | Delete
return !! value && 'object' === typeof value;
[363] Fix | Delete
}
[364] Fix | Delete
[365] Fix | Delete
/**
[366] Fix | Delete
* Creates and returns a new cache object.
[367] Fix | Delete
*
[368] Fix | Delete
* @return {Object} Cache object.
[369] Fix | Delete
*/
[370] Fix | Delete
function createCache() {
[371] Fix | Delete
var cache = {
[372] Fix | Delete
clear: function() {
[373] Fix | Delete
cache.head = null;
[374] Fix | Delete
},
[375] Fix | Delete
};
[376] Fix | Delete
[377] Fix | Delete
return cache;
[378] Fix | Delete
}
[379] Fix | Delete
[380] Fix | Delete
/**
[381] Fix | Delete
* Returns true if entries within the two arrays are strictly equal by
[382] Fix | Delete
* reference from a starting index.
[383] Fix | Delete
*
[384] Fix | Delete
* @param {Array} a First array.
[385] Fix | Delete
* @param {Array} b Second array.
[386] Fix | Delete
* @param {number} fromIndex Index from which to start comparison.
[387] Fix | Delete
*
[388] Fix | Delete
* @return {boolean} Whether arrays are shallowly equal.
[389] Fix | Delete
*/
[390] Fix | Delete
function isShallowEqual( a, b, fromIndex ) {
[391] Fix | Delete
var i;
[392] Fix | Delete
[393] Fix | Delete
if ( a.length !== b.length ) {
[394] Fix | Delete
return false;
[395] Fix | Delete
}
[396] Fix | Delete
[397] Fix | Delete
for ( i = fromIndex; i < a.length; i++ ) {
[398] Fix | Delete
if ( a[ i ] !== b[ i ] ) {
[399] Fix | Delete
return false;
[400] Fix | Delete
}
[401] Fix | Delete
}
[402] Fix | Delete
[403] Fix | Delete
return true;
[404] Fix | Delete
}
[405] Fix | Delete
[406] Fix | Delete
/**
[407] Fix | Delete
* Returns a memoized selector function. The getDependants function argument is
[408] Fix | Delete
* called before the memoized selector and is expected to return an immutable
[409] Fix | Delete
* reference or array of references on which the selector depends for computing
[410] Fix | Delete
* its own return value. The memoize cache is preserved only as long as those
[411] Fix | Delete
* dependant references remain the same. If getDependants returns a different
[412] Fix | Delete
* reference(s), the cache is cleared and the selector value regenerated.
[413] Fix | Delete
*
[414] Fix | Delete
* @param {Function} selector Selector function.
[415] Fix | Delete
* @param {Function} getDependants Dependant getter returning an immutable
[416] Fix | Delete
* reference or array of reference used in
[417] Fix | Delete
* cache bust consideration.
[418] Fix | Delete
*
[419] Fix | Delete
* @return {Function} Memoized selector.
[420] Fix | Delete
*/
[421] Fix | Delete
/* harmony default export */ __webpack_exports__["a"] = (function( selector, getDependants ) {
[422] Fix | Delete
var rootCache, getCache;
[423] Fix | Delete
[424] Fix | Delete
// Use object source as dependant if getter not provided
[425] Fix | Delete
if ( ! getDependants ) {
[426] Fix | Delete
getDependants = arrayOf;
[427] Fix | Delete
}
[428] Fix | Delete
[429] Fix | Delete
/**
[430] Fix | Delete
* Returns the root cache. If WeakMap is supported, this is assigned to the
[431] Fix | Delete
* root WeakMap cache set, otherwise it is a shared instance of the default
[432] Fix | Delete
* cache object.
[433] Fix | Delete
*
[434] Fix | Delete
* @return {(WeakMap|Object)} Root cache object.
[435] Fix | Delete
*/
[436] Fix | Delete
function getRootCache() {
[437] Fix | Delete
return rootCache;
[438] Fix | Delete
}
[439] Fix | Delete
[440] Fix | Delete
/**
[441] Fix | Delete
* Returns the cache for a given dependants array. When possible, a WeakMap
[442] Fix | Delete
* will be used to create a unique cache for each set of dependants. This
[443] Fix | Delete
* is feasible due to the nature of WeakMap in allowing garbage collection
[444] Fix | Delete
* to occur on entries where the key object is no longer referenced. Since
[445] Fix | Delete
* WeakMap requires the key to be an object, this is only possible when the
[446] Fix | Delete
* dependant is object-like. The root cache is created as a hierarchy where
[447] Fix | Delete
* each top-level key is the first entry in a dependants set, the value a
[448] Fix | Delete
* WeakMap where each key is the next dependant, and so on. This continues
[449] Fix | Delete
* so long as the dependants are object-like. If no dependants are object-
[450] Fix | Delete
* like, then the cache is shared across all invocations.
[451] Fix | Delete
*
[452] Fix | Delete
* @see isObjectLike
[453] Fix | Delete
*
[454] Fix | Delete
* @param {Array} dependants Selector dependants.
[455] Fix | Delete
*
[456] Fix | Delete
* @return {Object} Cache object.
[457] Fix | Delete
*/
[458] Fix | Delete
function getWeakMapCache( dependants ) {
[459] Fix | Delete
var caches = rootCache,
[460] Fix | Delete
isUniqueByDependants = true,
[461] Fix | Delete
i, dependant, map, cache;
[462] Fix | Delete
[463] Fix | Delete
for ( i = 0; i < dependants.length; i++ ) {
[464] Fix | Delete
dependant = dependants[ i ];
[465] Fix | Delete
[466] Fix | Delete
// Can only compose WeakMap from object-like key.
[467] Fix | Delete
if ( ! isObjectLike( dependant ) ) {
[468] Fix | Delete
isUniqueByDependants = false;
[469] Fix | Delete
break;
[470] Fix | Delete
}
[471] Fix | Delete
[472] Fix | Delete
// Does current segment of cache already have a WeakMap?
[473] Fix | Delete
if ( caches.has( dependant ) ) {
[474] Fix | Delete
// Traverse into nested WeakMap.
[475] Fix | Delete
caches = caches.get( dependant );
[476] Fix | Delete
} else {
[477] Fix | Delete
// Create, set, and traverse into a new one.
[478] Fix | Delete
map = new WeakMap();
[479] Fix | Delete
caches.set( dependant, map );
[480] Fix | Delete
caches = map;
[481] Fix | Delete
}
[482] Fix | Delete
}
[483] Fix | Delete
[484] Fix | Delete
// We use an arbitrary (but consistent) object as key for the last item
[485] Fix | Delete
// in the WeakMap to serve as our running cache.
[486] Fix | Delete
if ( ! caches.has( LEAF_KEY ) ) {
[487] Fix | Delete
cache = createCache();
[488] Fix | Delete
cache.isUniqueByDependants = isUniqueByDependants;
[489] Fix | Delete
caches.set( LEAF_KEY, cache );
[490] Fix | Delete
}
[491] Fix | Delete
[492] Fix | Delete
return caches.get( LEAF_KEY );
[493] Fix | Delete
}
[494] Fix | Delete
[495] Fix | Delete
// Assign cache handler by availability of WeakMap
[496] Fix | Delete
getCache = hasWeakMap ? getWeakMapCache : getRootCache;
[497] Fix | Delete
[498] Fix | Delete
/**
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function