8
0
Просмотр исходного кода

Merge pull request #31 from ckeditor/t/15

Extended lodash build.
Piotrek Koszuliński 9 лет назад
Родитель
Сommit
3b4012175b
100 измененных файлов с 2405 добавлено и 104 удалено
  1. 0 1
      packages/ckeditor5-utils/dev/tasks/lodash/tasks.js
  2. 7 0
      packages/ckeditor5-utils/src/lib/lodash/_DataView.js
  3. 23 9
      packages/ckeditor5-utils/src/lib/lodash/_Hash.js
  4. 28 0
      packages/ckeditor5-utils/src/lib/lodash/_LazyWrapper.js
  5. 32 0
      packages/ckeditor5-utils/src/lib/lodash/_ListCache.js
  6. 22 0
      packages/ckeditor5-utils/src/lib/lodash/_LodashWrapper.js
  7. 15 15
      packages/ckeditor5-utils/src/lib/lodash/_MapCache.js
  8. 7 0
      packages/ckeditor5-utils/src/lib/lodash/_Promise.js
  9. 27 0
      packages/ckeditor5-utils/src/lib/lodash/_SetCache.js
  10. 5 11
      packages/ckeditor5-utils/src/lib/lodash/_Stack.js
  11. 1 1
      packages/ckeditor5-utils/src/lib/lodash/_apply.js
  12. 22 0
      packages/ckeditor5-utils/src/lib/lodash/_arrayAggregator.js
  13. 21 0
      packages/ckeditor5-utils/src/lib/lodash/_arrayEachRight.js
  14. 23 0
      packages/ckeditor5-utils/src/lib/lodash/_arrayEvery.js
  15. 25 0
      packages/ckeditor5-utils/src/lib/lodash/_arrayFilter.js
  16. 16 0
      packages/ckeditor5-utils/src/lib/lodash/_arrayIncludes.js
  17. 22 0
      packages/ckeditor5-utils/src/lib/lodash/_arrayIncludesWith.js
  18. 21 0
      packages/ckeditor5-utils/src/lib/lodash/_arrayMap.js
  19. 20 0
      packages/ckeditor5-utils/src/lib/lodash/_arrayPush.js
  20. 2 1
      packages/ckeditor5-utils/src/lib/lodash/_arrayReduce.js
  21. 24 0
      packages/ckeditor5-utils/src/lib/lodash/_arrayReduceRight.js
  22. 2 1
      packages/ckeditor5-utils/src/lib/lodash/_arraySome.js
  23. 27 0
      packages/ckeditor5-utils/src/lib/lodash/_assignInDefaults.js
  24. 19 0
      packages/ckeditor5-utils/src/lib/lodash/_assignMergeValue.js
  25. 0 16
      packages/ckeditor5-utils/src/lib/lodash/_assocGet.js
  26. 1 2
      packages/ckeditor5-utils/src/lib/lodash/_assocIndexOf.js
  27. 0 20
      packages/ckeditor5-utils/src/lib/lodash/_assocSet.js
  28. 21 0
      packages/ckeditor5-utils/src/lib/lodash/_baseAggregator.js
  29. 23 0
      packages/ckeditor5-utils/src/lib/lodash/_baseAt.js
  30. 22 0
      packages/ckeditor5-utils/src/lib/lodash/_baseClamp.js
  31. 24 16
      packages/ckeditor5-utils/src/lib/lodash/_baseClone.js
  32. 33 0
      packages/ckeditor5-utils/src/lib/lodash/_baseConforms.js
  33. 21 0
      packages/ckeditor5-utils/src/lib/lodash/_baseDelay.js
  34. 67 0
      packages/ckeditor5-utils/src/lib/lodash/_baseDifference.js
  35. 14 0
      packages/ckeditor5-utils/src/lib/lodash/_baseEach.js
  36. 14 0
      packages/ckeditor5-utils/src/lib/lodash/_baseEachRight.js
  37. 21 0
      packages/ckeditor5-utils/src/lib/lodash/_baseEvery.js
  38. 32 0
      packages/ckeditor5-utils/src/lib/lodash/_baseExtremum.js
  39. 32 0
      packages/ckeditor5-utils/src/lib/lodash/_baseFill.js
  40. 21 0
      packages/ckeditor5-utils/src/lib/lodash/_baseFilter.js
  41. 25 0
      packages/ckeditor5-utils/src/lib/lodash/_baseFind.js
  42. 23 0
      packages/ckeditor5-utils/src/lib/lodash/_baseFindIndex.js
  43. 38 0
      packages/ckeditor5-utils/src/lib/lodash/_baseFlatten.js
  44. 3 4
      packages/ckeditor5-utils/src/lib/lodash/_baseFor.js
  45. 16 0
      packages/ckeditor5-utils/src/lib/lodash/_baseForOwnRight.js
  46. 15 0
      packages/ckeditor5-utils/src/lib/lodash/_baseForRight.js
  47. 19 0
      packages/ckeditor5-utils/src/lib/lodash/_baseFunctions.js
  48. 25 0
      packages/ckeditor5-utils/src/lib/lodash/_baseGet.js
  49. 20 0
      packages/ckeditor5-utils/src/lib/lodash/_baseGetAllKeys.js
  50. 14 0
      packages/ckeditor5-utils/src/lib/lodash/_baseGt.js
  51. 3 4
      packages/ckeditor5-utils/src/lib/lodash/_baseHas.js
  52. 13 0
      packages/ckeditor5-utils/src/lib/lodash/_baseHasIn.js
  53. 18 0
      packages/ckeditor5-utils/src/lib/lodash/_baseInRange.js
  54. 27 0
      packages/ckeditor5-utils/src/lib/lodash/_baseIndexOf.js
  55. 23 0
      packages/ckeditor5-utils/src/lib/lodash/_baseIndexOfWith.js
  56. 74 0
      packages/ckeditor5-utils/src/lib/lodash/_baseIntersection.js
  57. 21 0
      packages/ckeditor5-utils/src/lib/lodash/_baseInverter.js
  58. 28 0
      packages/ckeditor5-utils/src/lib/lodash/_baseInvoke.js
  59. 6 2
      packages/ckeditor5-utils/src/lib/lodash/_baseIsEqualDeep.js
  60. 62 0
      packages/ckeditor5-utils/src/lib/lodash/_baseIsMatch.js
  61. 31 0
      packages/ckeditor5-utils/src/lib/lodash/_baseIteratee.js
  62. 10 0
      packages/ckeditor5-utils/src/lib/lodash/_baseLodash.js
  63. 14 0
      packages/ckeditor5-utils/src/lib/lodash/_baseLt.js
  64. 22 0
      packages/ckeditor5-utils/src/lib/lodash/_baseMap.js
  65. 22 0
      packages/ckeditor5-utils/src/lib/lodash/_baseMatches.js
  66. 33 0
      packages/ckeditor5-utils/src/lib/lodash/_baseMatchesProperty.js
  67. 20 0
      packages/ckeditor5-utils/src/lib/lodash/_baseMean.js
  68. 50 0
      packages/ckeditor5-utils/src/lib/lodash/_baseMerge.js
  69. 83 0
      packages/ckeditor5-utils/src/lib/lodash/_baseMergeDeep.js
  70. 20 0
      packages/ckeditor5-utils/src/lib/lodash/_baseNth.js
  71. 34 0
      packages/ckeditor5-utils/src/lib/lodash/_baseOrderBy.js
  72. 22 0
      packages/ckeditor5-utils/src/lib/lodash/_basePick.js
  73. 28 0
      packages/ckeditor5-utils/src/lib/lodash/_basePickBy.js
  74. 1 1
      packages/ckeditor5-utils/src/lib/lodash/_baseProperty.js
  75. 16 0
      packages/ckeditor5-utils/src/lib/lodash/_basePropertyDeep.js
  76. 47 0
      packages/ckeditor5-utils/src/lib/lodash/_basePullAll.js
  77. 50 0
      packages/ckeditor5-utils/src/lib/lodash/_basePullAt.js
  78. 18 0
      packages/ckeditor5-utils/src/lib/lodash/_baseRandom.js
  79. 28 0
      packages/ckeditor5-utils/src/lib/lodash/_baseRange.js
  80. 23 0
      packages/ckeditor5-utils/src/lib/lodash/_baseReduce.js
  81. 35 0
      packages/ckeditor5-utils/src/lib/lodash/_baseRepeat.js
  82. 46 0
      packages/ckeditor5-utils/src/lib/lodash/_baseSet.js
  83. 17 0
      packages/ckeditor5-utils/src/lib/lodash/_baseSetData.js
  84. 31 0
      packages/ckeditor5-utils/src/lib/lodash/_baseSlice.js
  85. 22 0
      packages/ckeditor5-utils/src/lib/lodash/_baseSome.js
  86. 21 0
      packages/ckeditor5-utils/src/lib/lodash/_baseSortBy.js
  87. 42 0
      packages/ckeditor5-utils/src/lib/lodash/_baseSortedIndex.js
  88. 64 0
      packages/ckeditor5-utils/src/lib/lodash/_baseSortedIndexBy.js
  89. 30 0
      packages/ckeditor5-utils/src/lib/lodash/_baseSortedUniq.js
  90. 24 0
      packages/ckeditor5-utils/src/lib/lodash/_baseSum.js
  91. 24 0
      packages/ckeditor5-utils/src/lib/lodash/_baseToNumber.js
  92. 18 0
      packages/ckeditor5-utils/src/lib/lodash/_baseToPairs.js
  93. 31 0
      packages/ckeditor5-utils/src/lib/lodash/_baseToString.js
  94. 14 0
      packages/ckeditor5-utils/src/lib/lodash/_baseUnary.js
  95. 72 0
      packages/ckeditor5-utils/src/lib/lodash/_baseUniq.js
  96. 24 0
      packages/ckeditor5-utils/src/lib/lodash/_baseUnset.js
  97. 18 0
      packages/ckeditor5-utils/src/lib/lodash/_baseUpdate.js
  98. 19 0
      packages/ckeditor5-utils/src/lib/lodash/_baseValues.js
  99. 26 0
      packages/ckeditor5-utils/src/lib/lodash/_baseWhile.js
  100. 25 0
      packages/ckeditor5-utils/src/lib/lodash/_baseWrapperValue.js

+ 0 - 1
packages/ckeditor5-utils/dev/tasks/lodash/tasks.js

@@ -26,7 +26,6 @@ function buildLodash() {
 		build( [
 			'modularize',
 			'exports=es',
-			'include=clone,extend,isPlainObject,isObject,isArray,isArrayLike,last,isEqual',
 			'--development',
 			'--output', DEST_PATH
 		], ( err ) => {

+ 7 - 0
packages/ckeditor5-utils/src/lib/lodash/_DataView.js

@@ -0,0 +1,7 @@
+import getNative from './_getNative';
+import root from './_root';
+
+/* Built-in method references that are verified to be native. */
+var DataView = getNative(root, 'DataView');
+
+export default DataView;

+ 23 - 9
packages/ckeditor5-utils/src/lib/lodash/_Hash.js

@@ -1,18 +1,32 @@
-import nativeCreate from './_nativeCreate';
-
-/** Used for built-in method references. */
-var objectProto = Object.prototype;
+import hashClear from './_hashClear';
+import hashDelete from './_hashDelete';
+import hashGet from './_hashGet';
+import hashHas from './_hashHas';
+import hashSet from './_hashSet';
 
 /**
- * Creates an hash object.
+ * Creates a hash object.
  *
  * @private
  * @constructor
- * @returns {Object} Returns the new hash object.
+ * @param {Array} [entries] The key-value pairs to cache.
  */
-function Hash() {}
+function Hash(entries) {
+  var index = -1,
+      length = entries ? entries.length : 0;
+
+  this.clear();
+  while (++index < length) {
+    var entry = entries[index];
+    this.set(entry[0], entry[1]);
+  }
+}
 
-// Avoid inheriting from `Object.prototype` when possible.
-Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto;
+// Add methods to `Hash`.
+Hash.prototype.clear = hashClear;
+Hash.prototype['delete'] = hashDelete;
+Hash.prototype.get = hashGet;
+Hash.prototype.has = hashHas;
+Hash.prototype.set = hashSet;
 
 export default Hash;

+ 28 - 0
packages/ckeditor5-utils/src/lib/lodash/_LazyWrapper.js

@@ -0,0 +1,28 @@
+import baseCreate from './_baseCreate';
+import baseLodash from './_baseLodash';
+
+/** Used as references for the maximum length and index of an array. */
+var MAX_ARRAY_LENGTH = 4294967295;
+
+/**
+ * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
+ *
+ * @private
+ * @constructor
+ * @param {*} value The value to wrap.
+ */
+function LazyWrapper(value) {
+  this.__wrapped__ = value;
+  this.__actions__ = [];
+  this.__dir__ = 1;
+  this.__filtered__ = false;
+  this.__iteratees__ = [];
+  this.__takeCount__ = MAX_ARRAY_LENGTH;
+  this.__views__ = [];
+}
+
+// Ensure `LazyWrapper` is an instance of `baseLodash`.
+LazyWrapper.prototype = baseCreate(baseLodash.prototype);
+LazyWrapper.prototype.constructor = LazyWrapper;
+
+export default LazyWrapper;

+ 32 - 0
packages/ckeditor5-utils/src/lib/lodash/_ListCache.js

@@ -0,0 +1,32 @@
+import listCacheClear from './_listCacheClear';
+import listCacheDelete from './_listCacheDelete';
+import listCacheGet from './_listCacheGet';
+import listCacheHas from './_listCacheHas';
+import listCacheSet from './_listCacheSet';
+
+/**
+ * Creates an list cache object.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
+ */
+function ListCache(entries) {
+  var index = -1,
+      length = entries ? entries.length : 0;
+
+  this.clear();
+  while (++index < length) {
+    var entry = entries[index];
+    this.set(entry[0], entry[1]);
+  }
+}
+
+// Add methods to `ListCache`.
+ListCache.prototype.clear = listCacheClear;
+ListCache.prototype['delete'] = listCacheDelete;
+ListCache.prototype.get = listCacheGet;
+ListCache.prototype.has = listCacheHas;
+ListCache.prototype.set = listCacheSet;
+
+export default ListCache;

+ 22 - 0
packages/ckeditor5-utils/src/lib/lodash/_LodashWrapper.js

@@ -0,0 +1,22 @@
+import baseCreate from './_baseCreate';
+import baseLodash from './_baseLodash';
+
+/**
+ * The base constructor for creating `lodash` wrapper objects.
+ *
+ * @private
+ * @param {*} value The value to wrap.
+ * @param {boolean} [chainAll] Enable explicit method chain sequences.
+ */
+function LodashWrapper(value, chainAll) {
+  this.__wrapped__ = value;
+  this.__actions__ = [];
+  this.__chain__ = !!chainAll;
+  this.__index__ = 0;
+  this.__values__ = undefined;
+}
+
+LodashWrapper.prototype = baseCreate(baseLodash.prototype);
+LodashWrapper.prototype.constructor = LodashWrapper;
+
+export default LodashWrapper;

+ 15 - 15
packages/ckeditor5-utils/src/lib/lodash/_MapCache.js

@@ -1,32 +1,32 @@
-import mapClear from './_mapClear';
-import mapDelete from './_mapDelete';
-import mapGet from './_mapGet';
-import mapHas from './_mapHas';
-import mapSet from './_mapSet';
+import mapCacheClear from './_mapCacheClear';
+import mapCacheDelete from './_mapCacheDelete';
+import mapCacheGet from './_mapCacheGet';
+import mapCacheHas from './_mapCacheHas';
+import mapCacheSet from './_mapCacheSet';
 
 /**
  * Creates a map cache object to store key-value pairs.
  *
  * @private
  * @constructor
- * @param {Array} [values] The values to cache.
+ * @param {Array} [entries] The key-value pairs to cache.
  */
-function MapCache(values) {
+function MapCache(entries) {
   var index = -1,
-      length = values ? values.length : 0;
+      length = entries ? entries.length : 0;
 
   this.clear();
   while (++index < length) {
-    var entry = values[index];
+    var entry = entries[index];
     this.set(entry[0], entry[1]);
   }
 }
 
-// Add functions to the `MapCache`.
-MapCache.prototype.clear = mapClear;
-MapCache.prototype['delete'] = mapDelete;
-MapCache.prototype.get = mapGet;
-MapCache.prototype.has = mapHas;
-MapCache.prototype.set = mapSet;
+// Add methods to `MapCache`.
+MapCache.prototype.clear = mapCacheClear;
+MapCache.prototype['delete'] = mapCacheDelete;
+MapCache.prototype.get = mapCacheGet;
+MapCache.prototype.has = mapCacheHas;
+MapCache.prototype.set = mapCacheSet;
 
 export default MapCache;

+ 7 - 0
packages/ckeditor5-utils/src/lib/lodash/_Promise.js

@@ -0,0 +1,7 @@
+import getNative from './_getNative';
+import root from './_root';
+
+/* Built-in method references that are verified to be native. */
+var Promise = getNative(root, 'Promise');
+
+export default Promise;

+ 27 - 0
packages/ckeditor5-utils/src/lib/lodash/_SetCache.js

@@ -0,0 +1,27 @@
+import MapCache from './_MapCache';
+import setCacheAdd from './_setCacheAdd';
+import setCacheHas from './_setCacheHas';
+
+/**
+ *
+ * Creates an array cache object to store unique values.
+ *
+ * @private
+ * @constructor
+ * @param {Array} [values] The values to cache.
+ */
+function SetCache(values) {
+  var index = -1,
+      length = values ? values.length : 0;
+
+  this.__data__ = new MapCache;
+  while (++index < length) {
+    this.add(values[index]);
+  }
+}
+
+// Add methods to `SetCache`.
+SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
+SetCache.prototype.has = setCacheHas;
+
+export default SetCache;

+ 5 - 11
packages/ckeditor5-utils/src/lib/lodash/_Stack.js

@@ -1,3 +1,4 @@
+import ListCache from './_ListCache';
 import stackClear from './_stackClear';
 import stackDelete from './_stackDelete';
 import stackGet from './_stackGet';
@@ -9,20 +10,13 @@ import stackSet from './_stackSet';
  *
  * @private
  * @constructor
- * @param {Array} [values] The values to cache.
+ * @param {Array} [entries] The key-value pairs to cache.
  */
-function Stack(values) {
-  var index = -1,
-      length = values ? values.length : 0;
-
-  this.clear();
-  while (++index < length) {
-    var entry = values[index];
-    this.set(entry[0], entry[1]);
-  }
+function Stack(entries) {
+  this.__data__ = new ListCache(entries);
 }
 
-// Add functions to the `Stack` cache.
+// Add methods to `Stack`.
 Stack.prototype.clear = stackClear;
 Stack.prototype['delete'] = stackDelete;
 Stack.prototype.get = stackGet;

+ 1 - 1
packages/ckeditor5-utils/src/lib/lodash/_apply.js

@@ -5,7 +5,7 @@
  * @private
  * @param {Function} func The function to invoke.
  * @param {*} thisArg The `this` binding of `func`.
- * @param {...*} args The arguments to invoke `func` with.
+ * @param {Array} args The arguments to invoke `func` with.
  * @returns {*} Returns the result of `func`.
  */
 function apply(func, thisArg, args) {

+ 22 - 0
packages/ckeditor5-utils/src/lib/lodash/_arrayAggregator.js

@@ -0,0 +1,22 @@
+/**
+ * A specialized version of `baseAggregator` for arrays.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} setter The function to set `accumulator` values.
+ * @param {Function} iteratee The iteratee to transform keys.
+ * @param {Object} accumulator The initial aggregated object.
+ * @returns {Function} Returns `accumulator`.
+ */
+function arrayAggregator(array, setter, iteratee, accumulator) {
+  var index = -1,
+      length = array.length;
+
+  while (++index < length) {
+    var value = array[index];
+    setter(accumulator, value, iteratee(value), array);
+  }
+  return accumulator;
+}
+
+export default arrayAggregator;

+ 21 - 0
packages/ckeditor5-utils/src/lib/lodash/_arrayEachRight.js

@@ -0,0 +1,21 @@
+/**
+ * A specialized version of `_.forEachRight` for arrays without support for
+ * iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns `array`.
+ */
+function arrayEachRight(array, iteratee) {
+  var length = array.length;
+
+  while (length--) {
+    if (iteratee(array[length], length, array) === false) {
+      break;
+    }
+  }
+  return array;
+}
+
+export default arrayEachRight;

+ 23 - 0
packages/ckeditor5-utils/src/lib/lodash/_arrayEvery.js

@@ -0,0 +1,23 @@
+/**
+ * A specialized version of `_.every` for arrays without support for
+ * iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ *  else `false`.
+ */
+function arrayEvery(array, predicate) {
+  var index = -1,
+      length = array.length;
+
+  while (++index < length) {
+    if (!predicate(array[index], index, array)) {
+      return false;
+    }
+  }
+  return true;
+}
+
+export default arrayEvery;

+ 25 - 0
packages/ckeditor5-utils/src/lib/lodash/_arrayFilter.js

@@ -0,0 +1,25 @@
+/**
+ * A specialized version of `_.filter` for arrays without support for
+ * iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Array} Returns the new filtered array.
+ */
+function arrayFilter(array, predicate) {
+  var index = -1,
+      length = array.length,
+      resIndex = 0,
+      result = [];
+
+  while (++index < length) {
+    var value = array[index];
+    if (predicate(value, index, array)) {
+      result[resIndex++] = value;
+    }
+  }
+  return result;
+}
+
+export default arrayFilter;

+ 16 - 0
packages/ckeditor5-utils/src/lib/lodash/_arrayIncludes.js

@@ -0,0 +1,16 @@
+import baseIndexOf from './_baseIndexOf';
+
+/**
+ * A specialized version of `_.includes` for arrays without support for
+ * specifying an index to search from.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {*} target The value to search for.
+ * @returns {boolean} Returns `true` if `target` is found, else `false`.
+ */
+function arrayIncludes(array, value) {
+  return !!array.length && baseIndexOf(array, value, 0) > -1;
+}
+
+export default arrayIncludes;

+ 22 - 0
packages/ckeditor5-utils/src/lib/lodash/_arrayIncludesWith.js

@@ -0,0 +1,22 @@
+/**
+ * This function is like `arrayIncludes` except that it accepts a comparator.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {*} target The value to search for.
+ * @param {Function} comparator The comparator invoked per element.
+ * @returns {boolean} Returns `true` if `target` is found, else `false`.
+ */
+function arrayIncludesWith(array, value, comparator) {
+  var index = -1,
+      length = array.length;
+
+  while (++index < length) {
+    if (comparator(value, array[index])) {
+      return true;
+    }
+  }
+  return false;
+}
+
+export default arrayIncludesWith;

+ 21 - 0
packages/ckeditor5-utils/src/lib/lodash/_arrayMap.js

@@ -0,0 +1,21 @@
+/**
+ * A specialized version of `_.map` for arrays without support for iteratee
+ * shorthands.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+function arrayMap(array, iteratee) {
+  var index = -1,
+      length = array.length,
+      result = Array(length);
+
+  while (++index < length) {
+    result[index] = iteratee(array[index], index, array);
+  }
+  return result;
+}
+
+export default arrayMap;

+ 20 - 0
packages/ckeditor5-utils/src/lib/lodash/_arrayPush.js

@@ -0,0 +1,20 @@
+/**
+ * Appends the elements of `values` to `array`.
+ *
+ * @private
+ * @param {Array} array The array to modify.
+ * @param {Array} values The values to append.
+ * @returns {Array} Returns `array`.
+ */
+function arrayPush(array, values) {
+  var index = -1,
+      length = values.length,
+      offset = array.length;
+
+  while (++index < length) {
+    array[offset + index] = values[index];
+  }
+  return array;
+}
+
+export default arrayPush;

+ 2 - 1
packages/ckeditor5-utils/src/lib/lodash/_arrayReduce.js

@@ -6,7 +6,8 @@
  * @param {Array} array The array to iterate over.
  * @param {Function} iteratee The function invoked per iteration.
  * @param {*} [accumulator] The initial value.
- * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value.
+ * @param {boolean} [initAccum] Specify using the first element of `array` as
+ *  the initial value.
  * @returns {*} Returns the accumulated value.
  */
 function arrayReduce(array, iteratee, accumulator, initAccum) {

+ 24 - 0
packages/ckeditor5-utils/src/lib/lodash/_arrayReduceRight.js

@@ -0,0 +1,24 @@
+/**
+ * A specialized version of `_.reduceRight` for arrays without support for
+ * iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @param {boolean} [initAccum] Specify using the last element of `array` as
+ *  the initial value.
+ * @returns {*} Returns the accumulated value.
+ */
+function arrayReduceRight(array, iteratee, accumulator, initAccum) {
+  var length = array.length;
+  if (initAccum && length) {
+    accumulator = array[--length];
+  }
+  while (length--) {
+    accumulator = iteratee(accumulator, array[length], length, array);
+  }
+  return accumulator;
+}
+
+export default arrayReduceRight;

+ 2 - 1
packages/ckeditor5-utils/src/lib/lodash/_arraySome.js

@@ -5,7 +5,8 @@
  * @private
  * @param {Array} array The array to iterate over.
  * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ *  else `false`.
  */
 function arraySome(array, predicate) {
   var index = -1,

+ 27 - 0
packages/ckeditor5-utils/src/lib/lodash/_assignInDefaults.js

@@ -0,0 +1,27 @@
+import eq from './eq';
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used by `_.defaults` to customize its `_.assignIn` use.
+ *
+ * @private
+ * @param {*} objValue The destination value.
+ * @param {*} srcValue The source value.
+ * @param {string} key The key of the property to assign.
+ * @param {Object} object The parent object of `objValue`.
+ * @returns {*} Returns the value to assign.
+ */
+function assignInDefaults(objValue, srcValue, key, object) {
+  if (objValue === undefined ||
+      (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
+    return srcValue;
+  }
+  return objValue;
+}
+
+export default assignInDefaults;

+ 19 - 0
packages/ckeditor5-utils/src/lib/lodash/_assignMergeValue.js

@@ -0,0 +1,19 @@
+import eq from './eq';
+
+/**
+ * This function is like `assignValue` except that it doesn't assign
+ * `undefined` values.
+ *
+ * @private
+ * @param {Object} object The object to modify.
+ * @param {string} key The key of the property to assign.
+ * @param {*} value The value to assign.
+ */
+function assignMergeValue(object, key, value) {
+  if ((value !== undefined && !eq(object[key], value)) ||
+      (typeof key == 'number' && value === undefined && !(key in object))) {
+    object[key] = value;
+  }
+}
+
+export default assignMergeValue;

+ 0 - 16
packages/ckeditor5-utils/src/lib/lodash/_assocGet.js

@@ -1,16 +0,0 @@
-import assocIndexOf from './_assocIndexOf';
-
-/**
- * Gets the associative array value for `key`.
- *
- * @private
- * @param {Array} array The array to query.
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
-function assocGet(array, key) {
-  var index = assocIndexOf(array, key);
-  return index < 0 ? undefined : array[index][1];
-}
-
-export default assocGet;

+ 1 - 2
packages/ckeditor5-utils/src/lib/lodash/_assocIndexOf.js

@@ -1,8 +1,7 @@
 import eq from './eq';
 
 /**
- * Gets the index at which the first occurrence of `key` is found in `array`
- * of key-value pairs.
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
  *
  * @private
  * @param {Array} array The array to search.

+ 0 - 20
packages/ckeditor5-utils/src/lib/lodash/_assocSet.js

@@ -1,20 +0,0 @@
-import assocIndexOf from './_assocIndexOf';
-
-/**
- * Sets the associative array `key` to `value`.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- */
-function assocSet(array, key, value) {
-  var index = assocIndexOf(array, key);
-  if (index < 0) {
-    array.push([key, value]);
-  } else {
-    array[index][1] = value;
-  }
-}
-
-export default assocSet;

+ 21 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseAggregator.js

@@ -0,0 +1,21 @@
+import baseEach from './_baseEach';
+
+/**
+ * Aggregates elements of `collection` on `accumulator` with keys transformed
+ * by `iteratee` and values set by `setter`.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} setter The function to set `accumulator` values.
+ * @param {Function} iteratee The iteratee to transform keys.
+ * @param {Object} accumulator The initial aggregated object.
+ * @returns {Function} Returns `accumulator`.
+ */
+function baseAggregator(collection, setter, iteratee, accumulator) {
+  baseEach(collection, function(value, key, collection) {
+    setter(accumulator, value, iteratee(value), collection);
+  });
+  return accumulator;
+}
+
+export default baseAggregator;

+ 23 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseAt.js

@@ -0,0 +1,23 @@
+import get from './get';
+
+/**
+ * The base implementation of `_.at` without support for individual paths.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {string[]} paths The property paths of elements to pick.
+ * @returns {Array} Returns the picked elements.
+ */
+function baseAt(object, paths) {
+  var index = -1,
+      isNil = object == null,
+      length = paths.length,
+      result = Array(length);
+
+  while (++index < length) {
+    result[index] = isNil ? undefined : get(object, paths[index]);
+  }
+  return result;
+}
+
+export default baseAt;

+ 22 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseClamp.js

@@ -0,0 +1,22 @@
+/**
+ * The base implementation of `_.clamp` which doesn't coerce arguments to numbers.
+ *
+ * @private
+ * @param {number} number The number to clamp.
+ * @param {number} [lower] The lower bound.
+ * @param {number} upper The upper bound.
+ * @returns {number} Returns the clamped number.
+ */
+function baseClamp(number, lower, upper) {
+  if (number === number) {
+    if (upper !== undefined) {
+      number = number <= upper ? number : upper;
+    }
+    if (lower !== undefined) {
+      number = number >= lower ? number : lower;
+    }
+  }
+  return number;
+}
+
+export default baseClamp;

+ 24 - 16
packages/ckeditor5-utils/src/lib/lodash/_baseClone.js

@@ -2,10 +2,10 @@ import Stack from './_Stack';
 import arrayEach from './_arrayEach';
 import assignValue from './_assignValue';
 import baseAssign from './_baseAssign';
-import baseForOwn from './_baseForOwn';
 import cloneBuffer from './_cloneBuffer';
 import copyArray from './_copyArray';
 import copySymbols from './_copySymbols';
+import getAllKeys from './_getAllKeys';
 import getTag from './_getTag';
 import initCloneArray from './_initCloneArray';
 import initCloneByTag from './_initCloneByTag';
@@ -14,6 +14,7 @@ import isArray from './isArray';
 import isBuffer from './isBuffer';
 import isHostObject from './_isHostObject';
 import isObject from './isObject';
+import keys from './keys';
 
 /** `Object#toString` result references. */
 var argsTag = '[object Arguments]',
@@ -33,6 +34,7 @@ var argsTag = '[object Arguments]',
     weakMapTag = '[object WeakMap]';
 
 var arrayBufferTag = '[object ArrayBuffer]',
+    dataViewTag = '[object DataView]',
     float32Tag = '[object Float32Array]',
     float64Tag = '[object Float64Array]',
     int8Tag = '[object Int8Array]',
@@ -46,16 +48,16 @@ var arrayBufferTag = '[object ArrayBuffer]',
 /** Used to identify `toStringTag` values supported by `_.clone`. */
 var cloneableTags = {};
 cloneableTags[argsTag] = cloneableTags[arrayTag] =
-cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =
-cloneableTags[dateTag] = cloneableTags[float32Tag] =
-cloneableTags[float64Tag] = cloneableTags[int8Tag] =
-cloneableTags[int16Tag] = cloneableTags[int32Tag] =
-cloneableTags[mapTag] = cloneableTags[numberTag] =
-cloneableTags[objectTag] = cloneableTags[regexpTag] =
-cloneableTags[setTag] = cloneableTags[stringTag] =
-cloneableTags[symbolTag] = cloneableTags[uint8Tag] =
-cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] =
-cloneableTags[uint32Tag] = true;
+cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
+cloneableTags[boolTag] = cloneableTags[dateTag] =
+cloneableTags[float32Tag] = cloneableTags[float64Tag] =
+cloneableTags[int8Tag] = cloneableTags[int16Tag] =
+cloneableTags[int32Tag] = cloneableTags[mapTag] =
+cloneableTags[numberTag] = cloneableTags[objectTag] =
+cloneableTags[regexpTag] = cloneableTags[setTag] =
+cloneableTags[stringTag] = cloneableTags[symbolTag] =
+cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
+cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
 cloneableTags[errorTag] = cloneableTags[funcTag] =
 cloneableTags[weakMapTag] = false;
 
@@ -103,14 +105,13 @@ function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
       }
       result = initCloneObject(isFunc ? {} : value);
       if (!isDeep) {
-        result = baseAssign(result, value);
-        return isFull ? copySymbols(value, result) : result;
+        return copySymbols(value, baseAssign(result, value));
       }
     } else {
       if (!cloneableTags[tag]) {
         return object ? value : {};
       }
-      result = initCloneByTag(value, tag, isDeep);
+      result = initCloneByTag(value, tag, baseClone, isDeep);
     }
   }
   // Check for circular references and return its corresponding clone.
@@ -121,11 +122,18 @@ function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
   }
   stack.set(value, result);
 
+  if (!isArr) {
+    var props = isFull ? getAllKeys(value) : keys(value);
+  }
   // Recursively populate clone (susceptible to call stack limits).
-  (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
+  arrayEach(props || value, function(subValue, key) {
+    if (props) {
+      key = subValue;
+      subValue = value[key];
+    }
     assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
   });
-  return (isFull && !isArr) ? copySymbols(value, result) : result;
+  return result;
 }
 
 export default baseClone;

+ 33 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseConforms.js

@@ -0,0 +1,33 @@
+import keys from './keys';
+
+/**
+ * The base implementation of `_.conforms` which doesn't clone `source`.
+ *
+ * @private
+ * @param {Object} source The object of property predicates to conform to.
+ * @returns {Function} Returns the new spec function.
+ */
+function baseConforms(source) {
+  var props = keys(source),
+      length = props.length;
+
+  return function(object) {
+    if (object == null) {
+      return !length;
+    }
+    var index = length;
+    while (index--) {
+      var key = props[index],
+          predicate = source[key],
+          value = object[key];
+
+      if ((value === undefined &&
+          !(key in Object(object))) || !predicate(value)) {
+        return false;
+      }
+    }
+    return true;
+  };
+}
+
+export default baseConforms;

+ 21 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseDelay.js

@@ -0,0 +1,21 @@
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/**
+ * The base implementation of `_.delay` and `_.defer` which accepts an array
+ * of `func` arguments.
+ *
+ * @private
+ * @param {Function} func The function to delay.
+ * @param {number} wait The number of milliseconds to delay invocation.
+ * @param {Object} args The arguments to provide to `func`.
+ * @returns {number} Returns the timer id.
+ */
+function baseDelay(func, wait, args) {
+  if (typeof func != 'function') {
+    throw new TypeError(FUNC_ERROR_TEXT);
+  }
+  return setTimeout(function() { func.apply(undefined, args); }, wait);
+}
+
+export default baseDelay;

+ 67 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseDifference.js

@@ -0,0 +1,67 @@
+import SetCache from './_SetCache';
+import arrayIncludes from './_arrayIncludes';
+import arrayIncludesWith from './_arrayIncludesWith';
+import arrayMap from './_arrayMap';
+import baseUnary from './_baseUnary';
+import cacheHas from './_cacheHas';
+
+/** Used as the size to enable large array optimizations. */
+var LARGE_ARRAY_SIZE = 200;
+
+/**
+ * The base implementation of methods like `_.difference` without support
+ * for excluding multiple arrays or iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Array} values The values to exclude.
+ * @param {Function} [iteratee] The iteratee invoked per element.
+ * @param {Function} [comparator] The comparator invoked per element.
+ * @returns {Array} Returns the new array of filtered values.
+ */
+function baseDifference(array, values, iteratee, comparator) {
+  var index = -1,
+      includes = arrayIncludes,
+      isCommon = true,
+      length = array.length,
+      result = [],
+      valuesLength = values.length;
+
+  if (!length) {
+    return result;
+  }
+  if (iteratee) {
+    values = arrayMap(values, baseUnary(iteratee));
+  }
+  if (comparator) {
+    includes = arrayIncludesWith;
+    isCommon = false;
+  }
+  else if (values.length >= LARGE_ARRAY_SIZE) {
+    includes = cacheHas;
+    isCommon = false;
+    values = new SetCache(values);
+  }
+  outer:
+  while (++index < length) {
+    var value = array[index],
+        computed = iteratee ? iteratee(value) : value;
+
+    value = (comparator || value !== 0) ? value : 0;
+    if (isCommon && computed === computed) {
+      var valuesIndex = valuesLength;
+      while (valuesIndex--) {
+        if (values[valuesIndex] === computed) {
+          continue outer;
+        }
+      }
+      result.push(value);
+    }
+    else if (!includes(values, computed, comparator)) {
+      result.push(value);
+    }
+  }
+  return result;
+}
+
+export default baseDifference;

+ 14 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseEach.js

@@ -0,0 +1,14 @@
+import baseForOwn from './_baseForOwn';
+import createBaseEach from './_createBaseEach';
+
+/**
+ * The base implementation of `_.forEach` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array|Object} Returns `collection`.
+ */
+var baseEach = createBaseEach(baseForOwn);
+
+export default baseEach;

+ 14 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseEachRight.js

@@ -0,0 +1,14 @@
+import baseForOwnRight from './_baseForOwnRight';
+import createBaseEach from './_createBaseEach';
+
+/**
+ * The base implementation of `_.forEachRight` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array|Object} Returns `collection`.
+ */
+var baseEachRight = createBaseEach(baseForOwnRight, true);
+
+export default baseEachRight;

+ 21 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseEvery.js

@@ -0,0 +1,21 @@
+import baseEach from './_baseEach';
+
+/**
+ * The base implementation of `_.every` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ *  else `false`
+ */
+function baseEvery(collection, predicate) {
+  var result = true;
+  baseEach(collection, function(value, index, collection) {
+    result = !!predicate(value, index, collection);
+    return result;
+  });
+  return result;
+}
+
+export default baseEvery;

+ 32 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseExtremum.js

@@ -0,0 +1,32 @@
+import isSymbol from './isSymbol';
+
+/**
+ * The base implementation of methods like `_.max` and `_.min` which accepts a
+ * `comparator` to determine the extremum value.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The iteratee invoked per iteration.
+ * @param {Function} comparator The comparator used to compare values.
+ * @returns {*} Returns the extremum value.
+ */
+function baseExtremum(array, iteratee, comparator) {
+  var index = -1,
+      length = array.length;
+
+  while (++index < length) {
+    var value = array[index],
+        current = iteratee(value);
+
+    if (current != null && (computed === undefined
+          ? (current === current && !isSymbol(current))
+          : comparator(current, computed)
+        )) {
+      var computed = current,
+          result = value;
+    }
+  }
+  return result;
+}
+
+export default baseExtremum;

+ 32 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseFill.js

@@ -0,0 +1,32 @@
+import toInteger from './toInteger';
+import toLength from './toLength';
+
+/**
+ * The base implementation of `_.fill` without an iteratee call guard.
+ *
+ * @private
+ * @param {Array} array The array to fill.
+ * @param {*} value The value to fill `array` with.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns `array`.
+ */
+function baseFill(array, value, start, end) {
+  var length = array.length;
+
+  start = toInteger(start);
+  if (start < 0) {
+    start = -start > length ? 0 : (length + start);
+  }
+  end = (end === undefined || end > length) ? length : toInteger(end);
+  if (end < 0) {
+    end += length;
+  }
+  end = start > end ? 0 : toLength(end);
+  while (start < end) {
+    array[start++] = value;
+  }
+  return array;
+}
+
+export default baseFill;

+ 21 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseFilter.js

@@ -0,0 +1,21 @@
+import baseEach from './_baseEach';
+
+/**
+ * The base implementation of `_.filter` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Array} Returns the new filtered array.
+ */
+function baseFilter(collection, predicate) {
+  var result = [];
+  baseEach(collection, function(value, index, collection) {
+    if (predicate(value, index, collection)) {
+      result.push(value);
+    }
+  });
+  return result;
+}
+
+export default baseFilter;

+ 25 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseFind.js

@@ -0,0 +1,25 @@
+/**
+ * The base implementation of methods like `_.find` and `_.findKey`, without
+ * support for iteratee shorthands, which iterates over `collection` using
+ * `eachFunc`.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to search.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {Function} eachFunc The function to iterate over `collection`.
+ * @param {boolean} [retKey] Specify returning the key of the found element
+ *  instead of the element itself.
+ * @returns {*} Returns the found element or its key, else `undefined`.
+ */
+function baseFind(collection, predicate, eachFunc, retKey) {
+  var result;
+  eachFunc(collection, function(value, key, collection) {
+    if (predicate(value, key, collection)) {
+      result = retKey ? key : value;
+      return false;
+    }
+  });
+  return result;
+}
+
+export default baseFind;

+ 23 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseFindIndex.js

@@ -0,0 +1,23 @@
+/**
+ * The base implementation of `_.findIndex` and `_.findLastIndex` without
+ * support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function baseFindIndex(array, predicate, fromRight) {
+  var length = array.length,
+      index = fromRight ? length : -1;
+
+  while ((fromRight ? index-- : ++index < length)) {
+    if (predicate(array[index], index, array)) {
+      return index;
+    }
+  }
+  return -1;
+}
+
+export default baseFindIndex;

+ 38 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseFlatten.js

@@ -0,0 +1,38 @@
+import arrayPush from './_arrayPush';
+import isFlattenable from './_isFlattenable';
+
+/**
+ * The base implementation of `_.flatten` with support for restricting flattening.
+ *
+ * @private
+ * @param {Array} array The array to flatten.
+ * @param {number} depth The maximum recursion depth.
+ * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
+ * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
+ * @param {Array} [result=[]] The initial result value.
+ * @returns {Array} Returns the new flattened array.
+ */
+function baseFlatten(array, depth, predicate, isStrict, result) {
+  var index = -1,
+      length = array.length;
+
+  predicate || (predicate = isFlattenable);
+  result || (result = []);
+
+  while (++index < length) {
+    var value = array[index];
+    if (depth > 0 && predicate(value)) {
+      if (depth > 1) {
+        // Recursively flatten arrays (susceptible to call stack limits).
+        baseFlatten(value, depth - 1, predicate, isStrict, result);
+      } else {
+        arrayPush(result, value);
+      }
+    } else if (!isStrict) {
+      result[result.length] = value;
+    }
+  }
+  return result;
+}
+
+export default baseFlatten;

+ 3 - 4
packages/ckeditor5-utils/src/lib/lodash/_baseFor.js

@@ -1,10 +1,9 @@
 import createBaseFor from './_createBaseFor';
 
 /**
- * The base implementation of `baseForIn` and `baseForOwn` which iterates
- * over `object` properties returned by `keysFunc` invoking `iteratee` for
- * each property. Iteratee functions may exit iteration early by explicitly
- * returning `false`.
+ * The base implementation of `baseForOwn` which iterates over `object`
+ * properties returned by `keysFunc` and invokes `iteratee` for each property.
+ * Iteratee functions may exit iteration early by explicitly returning `false`.
  *
  * @private
  * @param {Object} object The object to iterate over.

+ 16 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseForOwnRight.js

@@ -0,0 +1,16 @@
+import baseForRight from './_baseForRight';
+import keys from './keys';
+
+/**
+ * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+function baseForOwnRight(object, iteratee) {
+  return object && baseForRight(object, iteratee, keys);
+}
+
+export default baseForOwnRight;

+ 15 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseForRight.js

@@ -0,0 +1,15 @@
+import createBaseFor from './_createBaseFor';
+
+/**
+ * This function is like `baseFor` except that it iterates over properties
+ * in the opposite order.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @returns {Object} Returns `object`.
+ */
+var baseForRight = createBaseFor(true);
+
+export default baseForRight;

+ 19 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseFunctions.js

@@ -0,0 +1,19 @@
+import arrayFilter from './_arrayFilter';
+import isFunction from './isFunction';
+
+/**
+ * The base implementation of `_.functions` which creates an array of
+ * `object` function property names filtered from `props`.
+ *
+ * @private
+ * @param {Object} object The object to inspect.
+ * @param {Array} props The property names to filter.
+ * @returns {Array} Returns the function names.
+ */
+function baseFunctions(object, props) {
+  return arrayFilter(props, function(key) {
+    return isFunction(object[key]);
+  });
+}
+
+export default baseFunctions;

+ 25 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseGet.js

@@ -0,0 +1,25 @@
+import castPath from './_castPath';
+import isKey from './_isKey';
+import toKey from './_toKey';
+
+/**
+ * The base implementation of `_.get` without support for default values.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the property to get.
+ * @returns {*} Returns the resolved value.
+ */
+function baseGet(object, path) {
+  path = isKey(path, object) ? [path] : castPath(path);
+
+  var index = 0,
+      length = path.length;
+
+  while (object != null && index < length) {
+    object = object[toKey(path[index++])];
+  }
+  return (index && index == length) ? object : undefined;
+}
+
+export default baseGet;

+ 20 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseGetAllKeys.js

@@ -0,0 +1,20 @@
+import arrayPush from './_arrayPush';
+import isArray from './isArray';
+
+/**
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
+ * symbols of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
+ * @returns {Array} Returns the array of property names and symbols.
+ */
+function baseGetAllKeys(object, keysFunc, symbolsFunc) {
+  var result = keysFunc(object);
+  return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
+}
+
+export default baseGetAllKeys;

+ 14 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseGt.js

@@ -0,0 +1,14 @@
+/**
+ * The base implementation of `_.gt` which doesn't coerce arguments to numbers.
+ *
+ * @private
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is greater than `other`,
+ *  else `false`.
+ */
+function baseGt(value, other) {
+  return value > other;
+}
+
+export default baseGt;

+ 3 - 4
packages/ckeditor5-utils/src/lib/lodash/_baseHas.js

@@ -1,12 +1,11 @@
+import getPrototype from './_getPrototype';
+
 /** Used for built-in method references. */
 var objectProto = Object.prototype;
 
 /** Used to check objects for own properties. */
 var hasOwnProperty = objectProto.hasOwnProperty;
 
-/** Built-in value references. */
-var getPrototypeOf = Object.getPrototypeOf;
-
 /**
  * The base implementation of `_.has` without support for deep paths.
  *
@@ -20,7 +19,7 @@ function baseHas(object, key) {
   // that are composed entirely of index properties, return `false` for
   // `hasOwnProperty` checks of them.
   return hasOwnProperty.call(object, key) ||
-    (typeof object == 'object' && key in object && getPrototypeOf(object) === null);
+    (typeof object == 'object' && key in object && getPrototype(object) === null);
 }
 
 export default baseHas;

+ 13 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseHasIn.js

@@ -0,0 +1,13 @@
+/**
+ * The base implementation of `_.hasIn` without support for deep paths.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array|string} key The key to check.
+ * @returns {boolean} Returns `true` if `key` exists, else `false`.
+ */
+function baseHasIn(object, key) {
+  return key in Object(object);
+}
+
+export default baseHasIn;

+ 18 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseInRange.js

@@ -0,0 +1,18 @@
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max,
+    nativeMin = Math.min;
+
+/**
+ * The base implementation of `_.inRange` which doesn't coerce arguments to numbers.
+ *
+ * @private
+ * @param {number} number The number to check.
+ * @param {number} start The start of the range.
+ * @param {number} end The end of the range.
+ * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
+ */
+function baseInRange(number, start, end) {
+  return number >= nativeMin(start, end) && number < nativeMax(start, end);
+}
+
+export default baseInRange;

+ 27 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseIndexOf.js

@@ -0,0 +1,27 @@
+import indexOfNaN from './_indexOfNaN';
+
+/**
+ * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {*} value The value to search for.
+ * @param {number} fromIndex The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function baseIndexOf(array, value, fromIndex) {
+  if (value !== value) {
+    return indexOfNaN(array, fromIndex);
+  }
+  var index = fromIndex - 1,
+      length = array.length;
+
+  while (++index < length) {
+    if (array[index] === value) {
+      return index;
+    }
+  }
+  return -1;
+}
+
+export default baseIndexOf;

+ 23 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseIndexOfWith.js

@@ -0,0 +1,23 @@
+/**
+ * This function is like `baseIndexOf` except that it accepts a comparator.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {*} value The value to search for.
+ * @param {number} fromIndex The index to search from.
+ * @param {Function} comparator The comparator invoked per element.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function baseIndexOfWith(array, value, fromIndex, comparator) {
+  var index = fromIndex - 1,
+      length = array.length;
+
+  while (++index < length) {
+    if (comparator(array[index], value)) {
+      return index;
+    }
+  }
+  return -1;
+}
+
+export default baseIndexOfWith;

+ 74 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseIntersection.js

@@ -0,0 +1,74 @@
+import SetCache from './_SetCache';
+import arrayIncludes from './_arrayIncludes';
+import arrayIncludesWith from './_arrayIncludesWith';
+import arrayMap from './_arrayMap';
+import baseUnary from './_baseUnary';
+import cacheHas from './_cacheHas';
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeMin = Math.min;
+
+/**
+ * The base implementation of methods like `_.intersection`, without support
+ * for iteratee shorthands, that accepts an array of arrays to inspect.
+ *
+ * @private
+ * @param {Array} arrays The arrays to inspect.
+ * @param {Function} [iteratee] The iteratee invoked per element.
+ * @param {Function} [comparator] The comparator invoked per element.
+ * @returns {Array} Returns the new array of shared values.
+ */
+function baseIntersection(arrays, iteratee, comparator) {
+  var includes = comparator ? arrayIncludesWith : arrayIncludes,
+      length = arrays[0].length,
+      othLength = arrays.length,
+      othIndex = othLength,
+      caches = Array(othLength),
+      maxLength = Infinity,
+      result = [];
+
+  while (othIndex--) {
+    var array = arrays[othIndex];
+    if (othIndex && iteratee) {
+      array = arrayMap(array, baseUnary(iteratee));
+    }
+    maxLength = nativeMin(array.length, maxLength);
+    caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
+      ? new SetCache(othIndex && array)
+      : undefined;
+  }
+  array = arrays[0];
+
+  var index = -1,
+      seen = caches[0];
+
+  outer:
+  while (++index < length && result.length < maxLength) {
+    var value = array[index],
+        computed = iteratee ? iteratee(value) : value;
+
+    value = (comparator || value !== 0) ? value : 0;
+    if (!(seen
+          ? cacheHas(seen, computed)
+          : includes(result, computed, comparator)
+        )) {
+      othIndex = othLength;
+      while (--othIndex) {
+        var cache = caches[othIndex];
+        if (!(cache
+              ? cacheHas(cache, computed)
+              : includes(arrays[othIndex], computed, comparator))
+            ) {
+          continue outer;
+        }
+      }
+      if (seen) {
+        seen.push(computed);
+      }
+      result.push(value);
+    }
+  }
+  return result;
+}
+
+export default baseIntersection;

+ 21 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseInverter.js

@@ -0,0 +1,21 @@
+import baseForOwn from './_baseForOwn';
+
+/**
+ * The base implementation of `_.invert` and `_.invertBy` which inverts
+ * `object` with values transformed by `iteratee` and set by `setter`.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} setter The function to set `accumulator` values.
+ * @param {Function} iteratee The iteratee to transform values.
+ * @param {Object} accumulator The initial inverted object.
+ * @returns {Function} Returns `accumulator`.
+ */
+function baseInverter(object, setter, iteratee, accumulator) {
+  baseForOwn(object, function(value, key, object) {
+    setter(accumulator, iteratee(value), key, object);
+  });
+  return accumulator;
+}
+
+export default baseInverter;

+ 28 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseInvoke.js

@@ -0,0 +1,28 @@
+import apply from './_apply';
+import castPath from './_castPath';
+import isKey from './_isKey';
+import last from './last';
+import parent from './_parent';
+import toKey from './_toKey';
+
+/**
+ * The base implementation of `_.invoke` without support for individual
+ * method arguments.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the method to invoke.
+ * @param {Array} args The arguments to invoke the method with.
+ * @returns {*} Returns the result of the invoked method.
+ */
+function baseInvoke(object, path, args) {
+  if (!isKey(path, object)) {
+    path = castPath(path);
+    object = parent(object, path);
+    path = last(path);
+  }
+  var func = object == null ? object : object[toKey(path)];
+  return func == null ? undefined : apply(func, object, args);
+}
+
+export default baseInvoke;

+ 6 - 2
packages/ckeditor5-utils/src/lib/lodash/_baseIsEqualDeep.js

@@ -31,7 +31,8 @@ var hasOwnProperty = objectProto.hasOwnProperty;
  * @param {Object} other The other object to compare.
  * @param {Function} equalFunc The function to determine equivalents of values.
  * @param {Function} [customizer] The function to customize comparisons.
- * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details.
+ * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`
+ *  for more details.
  * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  */
@@ -64,8 +65,11 @@ function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
         othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
 
     if (objIsWrapped || othIsWrapped) {
+      var objUnwrapped = objIsWrapped ? object.value() : object,
+          othUnwrapped = othIsWrapped ? other.value() : other;
+
       stack || (stack = new Stack);
-      return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, bitmask, stack);
+      return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
     }
   }
   if (!isSameTag) {

+ 62 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseIsMatch.js

@@ -0,0 +1,62 @@
+import Stack from './_Stack';
+import baseIsEqual from './_baseIsEqual';
+
+/** Used to compose bitmasks for comparison styles. */
+var UNORDERED_COMPARE_FLAG = 1,
+    PARTIAL_COMPARE_FLAG = 2;
+
+/**
+ * The base implementation of `_.isMatch` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Object} object The object to inspect.
+ * @param {Object} source The object of property values to match.
+ * @param {Array} matchData The property names, values, and compare flags to match.
+ * @param {Function} [customizer] The function to customize comparisons.
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
+ */
+function baseIsMatch(object, source, matchData, customizer) {
+  var index = matchData.length,
+      length = index,
+      noCustomizer = !customizer;
+
+  if (object == null) {
+    return !length;
+  }
+  object = Object(object);
+  while (index--) {
+    var data = matchData[index];
+    if ((noCustomizer && data[2])
+          ? data[1] !== object[data[0]]
+          : !(data[0] in object)
+        ) {
+      return false;
+    }
+  }
+  while (++index < length) {
+    data = matchData[index];
+    var key = data[0],
+        objValue = object[key],
+        srcValue = data[1];
+
+    if (noCustomizer && data[2]) {
+      if (objValue === undefined && !(key in object)) {
+        return false;
+      }
+    } else {
+      var stack = new Stack;
+      if (customizer) {
+        var result = customizer(objValue, srcValue, key, object, source, stack);
+      }
+      if (!(result === undefined
+            ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)
+            : result
+          )) {
+        return false;
+      }
+    }
+  }
+  return true;
+}
+
+export default baseIsMatch;

+ 31 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseIteratee.js

@@ -0,0 +1,31 @@
+import baseMatches from './_baseMatches';
+import baseMatchesProperty from './_baseMatchesProperty';
+import identity from './identity';
+import isArray from './isArray';
+import property from './property';
+
+/**
+ * The base implementation of `_.iteratee`.
+ *
+ * @private
+ * @param {*} [value=_.identity] The value to convert to an iteratee.
+ * @returns {Function} Returns the iteratee.
+ */
+function baseIteratee(value) {
+  // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
+  // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
+  if (typeof value == 'function') {
+    return value;
+  }
+  if (value == null) {
+    return identity;
+  }
+  if (typeof value == 'object') {
+    return isArray(value)
+      ? baseMatchesProperty(value[0], value[1])
+      : baseMatches(value);
+  }
+  return property(value);
+}
+
+export default baseIteratee;

+ 10 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseLodash.js

@@ -0,0 +1,10 @@
+/**
+ * The function whose prototype chain sequence wrappers inherit from.
+ *
+ * @private
+ */
+function baseLodash() {
+  // No operation performed.
+}
+
+export default baseLodash;

+ 14 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseLt.js

@@ -0,0 +1,14 @@
+/**
+ * The base implementation of `_.lt` which doesn't coerce arguments to numbers.
+ *
+ * @private
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is less than `other`,
+ *  else `false`.
+ */
+function baseLt(value, other) {
+  return value < other;
+}
+
+export default baseLt;

+ 22 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseMap.js

@@ -0,0 +1,22 @@
+import baseEach from './_baseEach';
+import isArrayLike from './isArrayLike';
+
+/**
+ * The base implementation of `_.map` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+function baseMap(collection, iteratee) {
+  var index = -1,
+      result = isArrayLike(collection) ? Array(collection.length) : [];
+
+  baseEach(collection, function(value, key, collection) {
+    result[++index] = iteratee(value, key, collection);
+  });
+  return result;
+}
+
+export default baseMap;

+ 22 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseMatches.js

@@ -0,0 +1,22 @@
+import baseIsMatch from './_baseIsMatch';
+import getMatchData from './_getMatchData';
+import matchesStrictComparable from './_matchesStrictComparable';
+
+/**
+ * The base implementation of `_.matches` which doesn't clone `source`.
+ *
+ * @private
+ * @param {Object} source The object of property values to match.
+ * @returns {Function} Returns the new spec function.
+ */
+function baseMatches(source) {
+  var matchData = getMatchData(source);
+  if (matchData.length == 1 && matchData[0][2]) {
+    return matchesStrictComparable(matchData[0][0], matchData[0][1]);
+  }
+  return function(object) {
+    return object === source || baseIsMatch(object, source, matchData);
+  };
+}
+
+export default baseMatches;

+ 33 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseMatchesProperty.js

@@ -0,0 +1,33 @@
+import baseIsEqual from './_baseIsEqual';
+import get from './get';
+import hasIn from './hasIn';
+import isKey from './_isKey';
+import isStrictComparable from './_isStrictComparable';
+import matchesStrictComparable from './_matchesStrictComparable';
+import toKey from './_toKey';
+
+/** Used to compose bitmasks for comparison styles. */
+var UNORDERED_COMPARE_FLAG = 1,
+    PARTIAL_COMPARE_FLAG = 2;
+
+/**
+ * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
+ *
+ * @private
+ * @param {string} path The path of the property to get.
+ * @param {*} srcValue The value to match.
+ * @returns {Function} Returns the new spec function.
+ */
+function baseMatchesProperty(path, srcValue) {
+  if (isKey(path) && isStrictComparable(srcValue)) {
+    return matchesStrictComparable(toKey(path), srcValue);
+  }
+  return function(object) {
+    var objValue = get(object, path);
+    return (objValue === undefined && objValue === srcValue)
+      ? hasIn(object, path)
+      : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
+  };
+}
+
+export default baseMatchesProperty;

+ 20 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseMean.js

@@ -0,0 +1,20 @@
+import baseSum from './_baseSum';
+
+/** Used as references for various `Number` constants. */
+var NAN = 0 / 0;
+
+/**
+ * The base implementation of `_.mean` and `_.meanBy` without support for
+ * iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {number} Returns the mean.
+ */
+function baseMean(array, iteratee) {
+  var length = array ? array.length : 0;
+  return length ? (baseSum(array, iteratee) / length) : NAN;
+}
+
+export default baseMean;

+ 50 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseMerge.js

@@ -0,0 +1,50 @@
+import Stack from './_Stack';
+import arrayEach from './_arrayEach';
+import assignMergeValue from './_assignMergeValue';
+import baseMergeDeep from './_baseMergeDeep';
+import isArray from './isArray';
+import isObject from './isObject';
+import isTypedArray from './isTypedArray';
+import keysIn from './keysIn';
+
+/**
+ * The base implementation of `_.merge` without support for multiple sources.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {number} srcIndex The index of `source`.
+ * @param {Function} [customizer] The function to customize merged values.
+ * @param {Object} [stack] Tracks traversed source values and their merged
+ *  counterparts.
+ */
+function baseMerge(object, source, srcIndex, customizer, stack) {
+  if (object === source) {
+    return;
+  }
+  if (!(isArray(source) || isTypedArray(source))) {
+    var props = keysIn(source);
+  }
+  arrayEach(props || source, function(srcValue, key) {
+    if (props) {
+      key = srcValue;
+      srcValue = source[key];
+    }
+    if (isObject(srcValue)) {
+      stack || (stack = new Stack);
+      baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
+    }
+    else {
+      var newValue = customizer
+        ? customizer(object[key], srcValue, (key + ''), object, source, stack)
+        : undefined;
+
+      if (newValue === undefined) {
+        newValue = srcValue;
+      }
+      assignMergeValue(object, key, newValue);
+    }
+  });
+}
+
+export default baseMerge;

+ 83 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseMergeDeep.js

@@ -0,0 +1,83 @@
+import assignMergeValue from './_assignMergeValue';
+import baseClone from './_baseClone';
+import copyArray from './_copyArray';
+import isArguments from './isArguments';
+import isArray from './isArray';
+import isArrayLikeObject from './isArrayLikeObject';
+import isFunction from './isFunction';
+import isObject from './isObject';
+import isPlainObject from './isPlainObject';
+import isTypedArray from './isTypedArray';
+import toPlainObject from './toPlainObject';
+
+/**
+ * A specialized version of `baseMerge` for arrays and objects which performs
+ * deep merges and tracks traversed objects enabling objects with circular
+ * references to be merged.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {string} key The key of the value to merge.
+ * @param {number} srcIndex The index of `source`.
+ * @param {Function} mergeFunc The function to merge values.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @param {Object} [stack] Tracks traversed source values and their merged
+ *  counterparts.
+ */
+function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
+  var objValue = object[key],
+      srcValue = source[key],
+      stacked = stack.get(srcValue);
+
+  if (stacked) {
+    assignMergeValue(object, key, stacked);
+    return;
+  }
+  var newValue = customizer
+    ? customizer(objValue, srcValue, (key + ''), object, source, stack)
+    : undefined;
+
+  var isCommon = newValue === undefined;
+
+  if (isCommon) {
+    newValue = srcValue;
+    if (isArray(srcValue) || isTypedArray(srcValue)) {
+      if (isArray(objValue)) {
+        newValue = objValue;
+      }
+      else if (isArrayLikeObject(objValue)) {
+        newValue = copyArray(objValue);
+      }
+      else {
+        isCommon = false;
+        newValue = baseClone(srcValue, true);
+      }
+    }
+    else if (isPlainObject(srcValue) || isArguments(srcValue)) {
+      if (isArguments(objValue)) {
+        newValue = toPlainObject(objValue);
+      }
+      else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
+        isCommon = false;
+        newValue = baseClone(srcValue, true);
+      }
+      else {
+        newValue = objValue;
+      }
+    }
+    else {
+      isCommon = false;
+    }
+  }
+  stack.set(srcValue, newValue);
+
+  if (isCommon) {
+    // Recursively merge objects and arrays (susceptible to call stack limits).
+    mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
+  }
+  stack['delete'](srcValue);
+  assignMergeValue(object, key, newValue);
+}
+
+export default baseMergeDeep;

+ 20 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseNth.js

@@ -0,0 +1,20 @@
+import isIndex from './_isIndex';
+
+/**
+ * The base implementation of `_.nth` which doesn't coerce `n` to an integer.
+ *
+ * @private
+ * @param {Array} array The array to query.
+ * @param {number} n The index of the element to return.
+ * @returns {*} Returns the nth element of `array`.
+ */
+function baseNth(array, n) {
+  var length = array.length;
+  if (!length) {
+    return;
+  }
+  n += n < 0 ? length : 0;
+  return isIndex(n, length) ? array[n] : undefined;
+}
+
+export default baseNth;

+ 34 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseOrderBy.js

@@ -0,0 +1,34 @@
+import arrayMap from './_arrayMap';
+import baseIteratee from './_baseIteratee';
+import baseMap from './_baseMap';
+import baseSortBy from './_baseSortBy';
+import baseUnary from './_baseUnary';
+import compareMultiple from './_compareMultiple';
+import identity from './identity';
+
+/**
+ * The base implementation of `_.orderBy` without param guards.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
+ * @param {string[]} orders The sort orders of `iteratees`.
+ * @returns {Array} Returns the new sorted array.
+ */
+function baseOrderBy(collection, iteratees, orders) {
+  var index = -1;
+  iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));
+
+  var result = baseMap(collection, function(value, key, collection) {
+    var criteria = arrayMap(iteratees, function(iteratee) {
+      return iteratee(value);
+    });
+    return { 'criteria': criteria, 'index': ++index, 'value': value };
+  });
+
+  return baseSortBy(result, function(object, other) {
+    return compareMultiple(object, other, orders);
+  });
+}
+
+export default baseOrderBy;

+ 22 - 0
packages/ckeditor5-utils/src/lib/lodash/_basePick.js

@@ -0,0 +1,22 @@
+import arrayReduce from './_arrayReduce';
+
+/**
+ * The base implementation of `_.pick` without support for individual
+ * property identifiers.
+ *
+ * @private
+ * @param {Object} object The source object.
+ * @param {string[]} props The property identifiers to pick.
+ * @returns {Object} Returns the new object.
+ */
+function basePick(object, props) {
+  object = Object(object);
+  return arrayReduce(props, function(result, key) {
+    if (key in object) {
+      result[key] = object[key];
+    }
+    return result;
+  }, {});
+}
+
+export default basePick;

+ 28 - 0
packages/ckeditor5-utils/src/lib/lodash/_basePickBy.js

@@ -0,0 +1,28 @@
+import getAllKeysIn from './_getAllKeysIn';
+
+/**
+ * The base implementation of  `_.pickBy` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Object} object The source object.
+ * @param {Function} predicate The function invoked per property.
+ * @returns {Object} Returns the new object.
+ */
+function basePickBy(object, predicate) {
+  var index = -1,
+      props = getAllKeysIn(object),
+      length = props.length,
+      result = {};
+
+  while (++index < length) {
+    var key = props[index],
+        value = object[key];
+
+    if (predicate(value, key)) {
+      result[key] = value;
+    }
+  }
+  return result;
+}
+
+export default basePickBy;

+ 1 - 1
packages/ckeditor5-utils/src/lib/lodash/_baseProperty.js

@@ -3,7 +3,7 @@
  *
  * @private
  * @param {string} key The key of the property to get.
- * @returns {Function} Returns the new function.
+ * @returns {Function} Returns the new accessor function.
  */
 function baseProperty(key) {
   return function(object) {

+ 16 - 0
packages/ckeditor5-utils/src/lib/lodash/_basePropertyDeep.js

@@ -0,0 +1,16 @@
+import baseGet from './_baseGet';
+
+/**
+ * A specialized version of `baseProperty` which supports deep paths.
+ *
+ * @private
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new accessor function.
+ */
+function basePropertyDeep(path) {
+  return function(object) {
+    return baseGet(object, path);
+  };
+}
+
+export default basePropertyDeep;

+ 47 - 0
packages/ckeditor5-utils/src/lib/lodash/_basePullAll.js

@@ -0,0 +1,47 @@
+import arrayMap from './_arrayMap';
+import baseIndexOf from './_baseIndexOf';
+import baseIndexOfWith from './_baseIndexOfWith';
+import baseUnary from './_baseUnary';
+
+/** Used for built-in method references. */
+var arrayProto = Array.prototype;
+
+/** Built-in value references. */
+var splice = arrayProto.splice;
+
+/**
+ * The base implementation of `_.pullAllBy` without support for iteratee
+ * shorthands.
+ *
+ * @private
+ * @param {Array} array The array to modify.
+ * @param {Array} values The values to remove.
+ * @param {Function} [iteratee] The iteratee invoked per element.
+ * @param {Function} [comparator] The comparator invoked per element.
+ * @returns {Array} Returns `array`.
+ */
+function basePullAll(array, values, iteratee, comparator) {
+  var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
+      index = -1,
+      length = values.length,
+      seen = array;
+
+  if (iteratee) {
+    seen = arrayMap(array, baseUnary(iteratee));
+  }
+  while (++index < length) {
+    var fromIndex = 0,
+        value = values[index],
+        computed = iteratee ? iteratee(value) : value;
+
+    while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
+      if (seen !== array) {
+        splice.call(seen, fromIndex, 1);
+      }
+      splice.call(array, fromIndex, 1);
+    }
+  }
+  return array;
+}
+
+export default basePullAll;

+ 50 - 0
packages/ckeditor5-utils/src/lib/lodash/_basePullAt.js

@@ -0,0 +1,50 @@
+import castPath from './_castPath';
+import isIndex from './_isIndex';
+import isKey from './_isKey';
+import last from './last';
+import parent from './_parent';
+import toKey from './_toKey';
+
+/** Used for built-in method references. */
+var arrayProto = Array.prototype;
+
+/** Built-in value references. */
+var splice = arrayProto.splice;
+
+/**
+ * The base implementation of `_.pullAt` without support for individual
+ * indexes or capturing the removed elements.
+ *
+ * @private
+ * @param {Array} array The array to modify.
+ * @param {number[]} indexes The indexes of elements to remove.
+ * @returns {Array} Returns `array`.
+ */
+function basePullAt(array, indexes) {
+  var length = array ? indexes.length : 0,
+      lastIndex = length - 1;
+
+  while (length--) {
+    var index = indexes[length];
+    if (length == lastIndex || index !== previous) {
+      var previous = index;
+      if (isIndex(index)) {
+        splice.call(array, index, 1);
+      }
+      else if (!isKey(index, array)) {
+        var path = castPath(index),
+            object = parent(array, path);
+
+        if (object != null) {
+          delete object[toKey(last(path))];
+        }
+      }
+      else {
+        delete array[toKey(index)];
+      }
+    }
+  }
+  return array;
+}
+
+export default basePullAt;

+ 18 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseRandom.js

@@ -0,0 +1,18 @@
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeFloor = Math.floor,
+    nativeRandom = Math.random;
+
+/**
+ * The base implementation of `_.random` without support for returning
+ * floating-point numbers.
+ *
+ * @private
+ * @param {number} lower The lower bound.
+ * @param {number} upper The upper bound.
+ * @returns {number} Returns the random number.
+ */
+function baseRandom(lower, upper) {
+  return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
+}
+
+export default baseRandom;

+ 28 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseRange.js

@@ -0,0 +1,28 @@
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeCeil = Math.ceil,
+    nativeMax = Math.max;
+
+/**
+ * The base implementation of `_.range` and `_.rangeRight` which doesn't
+ * coerce arguments to numbers.
+ *
+ * @private
+ * @param {number} start The start of the range.
+ * @param {number} end The end of the range.
+ * @param {number} step The value to increment or decrement by.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Array} Returns the range of numbers.
+ */
+function baseRange(start, end, step, fromRight) {
+  var index = -1,
+      length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
+      result = Array(length);
+
+  while (length--) {
+    result[fromRight ? length : ++index] = start;
+    start += step;
+  }
+  return result;
+}
+
+export default baseRange;

+ 23 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseReduce.js

@@ -0,0 +1,23 @@
+/**
+ * The base implementation of `_.reduce` and `_.reduceRight`, without support
+ * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {*} accumulator The initial value.
+ * @param {boolean} initAccum Specify using the first or last element of
+ *  `collection` as the initial value.
+ * @param {Function} eachFunc The function to iterate over `collection`.
+ * @returns {*} Returns the accumulated value.
+ */
+function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
+  eachFunc(collection, function(value, index, collection) {
+    accumulator = initAccum
+      ? (initAccum = false, value)
+      : iteratee(accumulator, value, index, collection);
+  });
+  return accumulator;
+}
+
+export default baseReduce;

+ 35 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseRepeat.js

@@ -0,0 +1,35 @@
+/** Used as references for various `Number` constants. */
+var MAX_SAFE_INTEGER = 9007199254740991;
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeFloor = Math.floor;
+
+/**
+ * The base implementation of `_.repeat` which doesn't coerce arguments.
+ *
+ * @private
+ * @param {string} string The string to repeat.
+ * @param {number} n The number of times to repeat the string.
+ * @returns {string} Returns the repeated string.
+ */
+function baseRepeat(string, n) {
+  var result = '';
+  if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
+    return result;
+  }
+  // Leverage the exponentiation by squaring algorithm for a faster repeat.
+  // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
+  do {
+    if (n % 2) {
+      result += string;
+    }
+    n = nativeFloor(n / 2);
+    if (n) {
+      string += string;
+    }
+  } while (n);
+
+  return result;
+}
+
+export default baseRepeat;

+ 46 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseSet.js

@@ -0,0 +1,46 @@
+import assignValue from './_assignValue';
+import castPath from './_castPath';
+import isIndex from './_isIndex';
+import isKey from './_isKey';
+import isObject from './isObject';
+import toKey from './_toKey';
+
+/**
+ * The base implementation of `_.set`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the property to set.
+ * @param {*} value The value to set.
+ * @param {Function} [customizer] The function to customize path creation.
+ * @returns {Object} Returns `object`.
+ */
+function baseSet(object, path, value, customizer) {
+  path = isKey(path, object) ? [path] : castPath(path);
+
+  var index = -1,
+      length = path.length,
+      lastIndex = length - 1,
+      nested = object;
+
+  while (nested != null && ++index < length) {
+    var key = toKey(path[index]);
+    if (isObject(nested)) {
+      var newValue = value;
+      if (index != lastIndex) {
+        var objValue = nested[key];
+        newValue = customizer ? customizer(objValue, key, nested) : undefined;
+        if (newValue === undefined) {
+          newValue = objValue == null
+            ? (isIndex(path[index + 1]) ? [] : {})
+            : objValue;
+        }
+      }
+      assignValue(nested, key, newValue);
+    }
+    nested = nested[key];
+  }
+  return object;
+}
+
+export default baseSet;

+ 17 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseSetData.js

@@ -0,0 +1,17 @@
+import identity from './identity';
+import metaMap from './_metaMap';
+
+/**
+ * The base implementation of `setData` without support for hot loop detection.
+ *
+ * @private
+ * @param {Function} func The function to associate metadata with.
+ * @param {*} data The metadata.
+ * @returns {Function} Returns `func`.
+ */
+var baseSetData = !metaMap ? identity : function(func, data) {
+  metaMap.set(func, data);
+  return func;
+};
+
+export default baseSetData;

+ 31 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseSlice.js

@@ -0,0 +1,31 @@
+/**
+ * The base implementation of `_.slice` without an iteratee call guard.
+ *
+ * @private
+ * @param {Array} array The array to slice.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns the slice of `array`.
+ */
+function baseSlice(array, start, end) {
+  var index = -1,
+      length = array.length;
+
+  if (start < 0) {
+    start = -start > length ? 0 : (length + start);
+  }
+  end = end > length ? length : end;
+  if (end < 0) {
+    end += length;
+  }
+  length = start > end ? 0 : ((end - start) >>> 0);
+  start >>>= 0;
+
+  var result = Array(length);
+  while (++index < length) {
+    result[index] = array[index + start];
+  }
+  return result;
+}
+
+export default baseSlice;

+ 22 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseSome.js

@@ -0,0 +1,22 @@
+import baseEach from './_baseEach';
+
+/**
+ * The base implementation of `_.some` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ *  else `false`.
+ */
+function baseSome(collection, predicate) {
+  var result;
+
+  baseEach(collection, function(value, index, collection) {
+    result = predicate(value, index, collection);
+    return !result;
+  });
+  return !!result;
+}
+
+export default baseSome;

+ 21 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseSortBy.js

@@ -0,0 +1,21 @@
+/**
+ * The base implementation of `_.sortBy` which uses `comparer` to define the
+ * sort order of `array` and replaces criteria objects with their corresponding
+ * values.
+ *
+ * @private
+ * @param {Array} array The array to sort.
+ * @param {Function} comparer The function to define sort order.
+ * @returns {Array} Returns `array`.
+ */
+function baseSortBy(array, comparer) {
+  var length = array.length;
+
+  array.sort(comparer);
+  while (length--) {
+    array[length] = array[length].value;
+  }
+  return array;
+}
+
+export default baseSortBy;

+ 42 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseSortedIndex.js

@@ -0,0 +1,42 @@
+import baseSortedIndexBy from './_baseSortedIndexBy';
+import identity from './identity';
+import isSymbol from './isSymbol';
+
+/** Used as references for the maximum length and index of an array. */
+var MAX_ARRAY_LENGTH = 4294967295,
+    HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
+
+/**
+ * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
+ * performs a binary search of `array` to determine the index at which `value`
+ * should be inserted into `array` in order to maintain its sort order.
+ *
+ * @private
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
+ * @returns {number} Returns the index at which `value` should be inserted
+ *  into `array`.
+ */
+function baseSortedIndex(array, value, retHighest) {
+  var low = 0,
+      high = array ? array.length : low;
+
+  if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
+    while (low < high) {
+      var mid = (low + high) >>> 1,
+          computed = array[mid];
+
+      if (computed !== null && !isSymbol(computed) &&
+          (retHighest ? (computed <= value) : (computed < value))) {
+        low = mid + 1;
+      } else {
+        high = mid;
+      }
+    }
+    return high;
+  }
+  return baseSortedIndexBy(array, value, identity, retHighest);
+}
+
+export default baseSortedIndex;

+ 64 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseSortedIndexBy.js

@@ -0,0 +1,64 @@
+import isSymbol from './isSymbol';
+
+/** Used as references for the maximum length and index of an array. */
+var MAX_ARRAY_LENGTH = 4294967295,
+    MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1;
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeFloor = Math.floor,
+    nativeMin = Math.min;
+
+/**
+ * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
+ * which invokes `iteratee` for `value` and each element of `array` to compute
+ * their sort ranking. The iteratee is invoked with one argument; (value).
+ *
+ * @private
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {Function} iteratee The iteratee invoked per element.
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
+ * @returns {number} Returns the index at which `value` should be inserted
+ *  into `array`.
+ */
+function baseSortedIndexBy(array, value, iteratee, retHighest) {
+  value = iteratee(value);
+
+  var low = 0,
+      high = array ? array.length : 0,
+      valIsNaN = value !== value,
+      valIsNull = value === null,
+      valIsSymbol = isSymbol(value),
+      valIsUndefined = value === undefined;
+
+  while (low < high) {
+    var mid = nativeFloor((low + high) / 2),
+        computed = iteratee(array[mid]),
+        othIsDefined = computed !== undefined,
+        othIsNull = computed === null,
+        othIsReflexive = computed === computed,
+        othIsSymbol = isSymbol(computed);
+
+    if (valIsNaN) {
+      var setLow = retHighest || othIsReflexive;
+    } else if (valIsUndefined) {
+      setLow = othIsReflexive && (retHighest || othIsDefined);
+    } else if (valIsNull) {
+      setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
+    } else if (valIsSymbol) {
+      setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
+    } else if (othIsNull || othIsSymbol) {
+      setLow = false;
+    } else {
+      setLow = retHighest ? (computed <= value) : (computed < value);
+    }
+    if (setLow) {
+      low = mid + 1;
+    } else {
+      high = mid;
+    }
+  }
+  return nativeMin(high, MAX_ARRAY_INDEX);
+}
+
+export default baseSortedIndexBy;

+ 30 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseSortedUniq.js

@@ -0,0 +1,30 @@
+import eq from './eq';
+
+/**
+ * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
+ * support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Function} [iteratee] The iteratee invoked per element.
+ * @returns {Array} Returns the new duplicate free array.
+ */
+function baseSortedUniq(array, iteratee) {
+  var index = -1,
+      length = array.length,
+      resIndex = 0,
+      result = [];
+
+  while (++index < length) {
+    var value = array[index],
+        computed = iteratee ? iteratee(value) : value;
+
+    if (!index || !eq(computed, seen)) {
+      var seen = computed;
+      result[resIndex++] = value === 0 ? 0 : value;
+    }
+  }
+  return result;
+}
+
+export default baseSortedUniq;

+ 24 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseSum.js

@@ -0,0 +1,24 @@
+/**
+ * The base implementation of `_.sum` and `_.sumBy` without support for
+ * iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {number} Returns the sum.
+ */
+function baseSum(array, iteratee) {
+  var result,
+      index = -1,
+      length = array.length;
+
+  while (++index < length) {
+    var current = iteratee(array[index]);
+    if (current !== undefined) {
+      result = result === undefined ? current : (result + current);
+    }
+  }
+  return result;
+}
+
+export default baseSum;

+ 24 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseToNumber.js

@@ -0,0 +1,24 @@
+import isSymbol from './isSymbol';
+
+/** Used as references for various `Number` constants. */
+var NAN = 0 / 0;
+
+/**
+ * The base implementation of `_.toNumber` which doesn't ensure correct
+ * conversions of binary, hexadecimal, or octal string values.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {number} Returns the number.
+ */
+function baseToNumber(value) {
+  if (typeof value == 'number') {
+    return value;
+  }
+  if (isSymbol(value)) {
+    return NAN;
+  }
+  return +value;
+}
+
+export default baseToNumber;

+ 18 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseToPairs.js

@@ -0,0 +1,18 @@
+import arrayMap from './_arrayMap';
+
+/**
+ * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
+ * of key-value pairs for `object` corresponding to the property names of `props`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} props The property names to get values for.
+ * @returns {Object} Returns the key-value pairs.
+ */
+function baseToPairs(object, props) {
+  return arrayMap(props, function(key) {
+    return [key, object[key]];
+  });
+}
+
+export default baseToPairs;

+ 31 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseToString.js

@@ -0,0 +1,31 @@
+import Symbol from './_Symbol';
+import isSymbol from './isSymbol';
+
+/** Used as references for various `Number` constants. */
+var INFINITY = 1 / 0;
+
+/** Used to convert symbols to primitives and strings. */
+var symbolProto = Symbol ? Symbol.prototype : undefined,
+    symbolToString = symbolProto ? symbolProto.toString : undefined;
+
+/**
+ * The base implementation of `_.toString` which doesn't convert nullish
+ * values to empty strings.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ */
+function baseToString(value) {
+  // Exit early for strings to avoid a performance hit in some environments.
+  if (typeof value == 'string') {
+    return value;
+  }
+  if (isSymbol(value)) {
+    return symbolToString ? symbolToString.call(value) : '';
+  }
+  var result = (value + '');
+  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
+}
+
+export default baseToString;

+ 14 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseUnary.js

@@ -0,0 +1,14 @@
+/**
+ * The base implementation of `_.unary` without support for storing wrapper metadata.
+ *
+ * @private
+ * @param {Function} func The function to cap arguments for.
+ * @returns {Function} Returns the new capped function.
+ */
+function baseUnary(func) {
+  return function(value) {
+    return func(value);
+  };
+}
+
+export default baseUnary;

+ 72 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseUniq.js

@@ -0,0 +1,72 @@
+import SetCache from './_SetCache';
+import arrayIncludes from './_arrayIncludes';
+import arrayIncludesWith from './_arrayIncludesWith';
+import cacheHas from './_cacheHas';
+import createSet from './_createSet';
+import setToArray from './_setToArray';
+
+/** Used as the size to enable large array optimizations. */
+var LARGE_ARRAY_SIZE = 200;
+
+/**
+ * The base implementation of `_.uniqBy` without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Function} [iteratee] The iteratee invoked per element.
+ * @param {Function} [comparator] The comparator invoked per element.
+ * @returns {Array} Returns the new duplicate free array.
+ */
+function baseUniq(array, iteratee, comparator) {
+  var index = -1,
+      includes = arrayIncludes,
+      length = array.length,
+      isCommon = true,
+      result = [],
+      seen = result;
+
+  if (comparator) {
+    isCommon = false;
+    includes = arrayIncludesWith;
+  }
+  else if (length >= LARGE_ARRAY_SIZE) {
+    var set = iteratee ? null : createSet(array);
+    if (set) {
+      return setToArray(set);
+    }
+    isCommon = false;
+    includes = cacheHas;
+    seen = new SetCache;
+  }
+  else {
+    seen = iteratee ? [] : result;
+  }
+  outer:
+  while (++index < length) {
+    var value = array[index],
+        computed = iteratee ? iteratee(value) : value;
+
+    value = (comparator || value !== 0) ? value : 0;
+    if (isCommon && computed === computed) {
+      var seenIndex = seen.length;
+      while (seenIndex--) {
+        if (seen[seenIndex] === computed) {
+          continue outer;
+        }
+      }
+      if (iteratee) {
+        seen.push(computed);
+      }
+      result.push(value);
+    }
+    else if (!includes(seen, computed, comparator)) {
+      if (seen !== result) {
+        seen.push(computed);
+      }
+      result.push(value);
+    }
+  }
+  return result;
+}
+
+export default baseUniq;

+ 24 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseUnset.js

@@ -0,0 +1,24 @@
+import baseHas from './_baseHas';
+import castPath from './_castPath';
+import isKey from './_isKey';
+import last from './last';
+import parent from './_parent';
+import toKey from './_toKey';
+
+/**
+ * The base implementation of `_.unset`.
+ *
+ * @private
+ * @param {Object} object The object to modify.
+ * @param {Array|string} path The path of the property to unset.
+ * @returns {boolean} Returns `true` if the property is deleted, else `false`.
+ */
+function baseUnset(object, path) {
+  path = isKey(path, object) ? [path] : castPath(path);
+  object = parent(object, path);
+
+  var key = toKey(last(path));
+  return !(object != null && baseHas(object, key)) || delete object[key];
+}
+
+export default baseUnset;

+ 18 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseUpdate.js

@@ -0,0 +1,18 @@
+import baseGet from './_baseGet';
+import baseSet from './_baseSet';
+
+/**
+ * The base implementation of `_.update`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the property to update.
+ * @param {Function} updater The function to produce the updated value.
+ * @param {Function} [customizer] The function to customize path creation.
+ * @returns {Object} Returns `object`.
+ */
+function baseUpdate(object, path, updater, customizer) {
+  return baseSet(object, path, updater(baseGet(object, path)), customizer);
+}
+
+export default baseUpdate;

+ 19 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseValues.js

@@ -0,0 +1,19 @@
+import arrayMap from './_arrayMap';
+
+/**
+ * The base implementation of `_.values` and `_.valuesIn` which creates an
+ * array of `object` property values corresponding to the property names
+ * of `props`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} props The property names to get values for.
+ * @returns {Object} Returns the array of property values.
+ */
+function baseValues(object, props) {
+  return arrayMap(props, function(key) {
+    return object[key];
+  });
+}
+
+export default baseValues;

+ 26 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseWhile.js

@@ -0,0 +1,26 @@
+import baseSlice from './_baseSlice';
+
+/**
+ * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
+ * without support for iteratee shorthands.
+ *
+ * @private
+ * @param {Array} array The array to query.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Array} Returns the slice of `array`.
+ */
+function baseWhile(array, predicate, isDrop, fromRight) {
+  var length = array.length,
+      index = fromRight ? length : -1;
+
+  while ((fromRight ? index-- : ++index < length) &&
+    predicate(array[index], index, array)) {}
+
+  return isDrop
+    ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
+    : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
+}
+
+export default baseWhile;

+ 25 - 0
packages/ckeditor5-utils/src/lib/lodash/_baseWrapperValue.js

@@ -0,0 +1,25 @@
+import LazyWrapper from './_LazyWrapper';
+import arrayPush from './_arrayPush';
+import arrayReduce from './_arrayReduce';
+
+/**
+ * The base implementation of `wrapperValue` which returns the result of
+ * performing a sequence of actions on the unwrapped `value`, where each
+ * successive action is supplied the return value of the previous.
+ *
+ * @private
+ * @param {*} value The unwrapped value.
+ * @param {Array} actions Actions to perform to resolve the unwrapped value.
+ * @returns {*} Returns the resolved value.
+ */
+function baseWrapperValue(value, actions) {
+  var result = value;
+  if (result instanceof LazyWrapper) {
+    result = result.value();
+  }
+  return arrayReduce(actions, function(result, action) {
+    return action.func.apply(action.thisArg, arrayPush([result], action.args));
+  }, result);
+}
+
+export default baseWrapperValue;

Некоторые файлы не были показаны из-за большого количества измененных файлов