immutable 5.0.0-beta.4 → 5.0.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/README.md +1 -1
  2. package/dist/es/Collection.js +2 -1
  3. package/dist/es/CollectionImpl.js +6 -6
  4. package/dist/es/Hash.js +1 -0
  5. package/dist/es/Immutable.js +2 -2
  6. package/dist/es/Iterator.js +1 -0
  7. package/dist/es/List.js +2 -1
  8. package/dist/es/Map.js +2 -1
  9. package/dist/es/Math.js +1 -0
  10. package/dist/es/Operations.js +2 -1
  11. package/dist/es/OrderedMap.js +2 -1
  12. package/dist/es/OrderedSet.js +2 -1
  13. package/dist/es/PairSorting.js +1 -0
  14. package/dist/es/Range.js +13 -5
  15. package/dist/es/Record.js +2 -1
  16. package/dist/es/Repeat.js +1 -0
  17. package/dist/es/Seq.js +2 -1
  18. package/dist/es/Set.js +1 -0
  19. package/dist/es/Stack.js +1 -0
  20. package/dist/es/TrieUtils.js +2 -0
  21. package/dist/es/fromJS.js +1 -0
  22. package/dist/es/functional/get.js +1 -0
  23. package/dist/es/functional/getIn.js +1 -0
  24. package/dist/es/functional/has.js +1 -0
  25. package/dist/es/functional/hasIn.js +1 -0
  26. package/dist/es/functional/merge.js +1 -0
  27. package/dist/es/functional/remove.js +1 -0
  28. package/dist/es/functional/removeIn.js +1 -0
  29. package/dist/es/functional/set.js +1 -0
  30. package/dist/es/functional/setIn.js +1 -0
  31. package/dist/es/functional/update.js +1 -0
  32. package/dist/es/functional/updateIn.js +1 -0
  33. package/dist/es/is.js +1 -0
  34. package/dist/es/methods/asImmutable.js +1 -0
  35. package/dist/es/methods/asMutable.js +1 -0
  36. package/dist/es/methods/deleteIn.js +1 -0
  37. package/dist/es/methods/getIn.js +1 -0
  38. package/dist/es/methods/hasIn.js +1 -0
  39. package/dist/es/methods/merge.js +1 -0
  40. package/dist/es/methods/mergeDeep.js +1 -0
  41. package/dist/es/methods/mergeDeepIn.js +1 -0
  42. package/dist/es/methods/mergeIn.js +1 -0
  43. package/dist/es/methods/setIn.js +1 -0
  44. package/dist/es/methods/toObject.js +1 -0
  45. package/dist/es/methods/update.js +1 -0
  46. package/dist/es/methods/updateIn.js +1 -0
  47. package/dist/es/methods/wasAltered.js +1 -0
  48. package/dist/es/methods/withMutations.js +1 -0
  49. package/dist/es/package.json.js +2 -1
  50. package/dist/es/predicates/isAssociative.js +1 -0
  51. package/dist/es/predicates/isCollection.js +2 -0
  52. package/dist/es/predicates/isImmutable.js +1 -0
  53. package/dist/es/predicates/isIndexed.js +1 -0
  54. package/dist/es/predicates/isKeyed.js +1 -0
  55. package/dist/es/predicates/isList.js +1 -0
  56. package/dist/es/predicates/isMap.js +1 -0
  57. package/dist/es/predicates/isOrdered.js +1 -0
  58. package/dist/es/predicates/isOrderedMap.js +1 -0
  59. package/dist/es/predicates/isOrderedSet.js +1 -0
  60. package/dist/es/predicates/isRecord.js +1 -0
  61. package/dist/es/predicates/isSeq.js +1 -0
  62. package/dist/es/predicates/isSet.js +1 -0
  63. package/dist/es/predicates/isStack.js +1 -0
  64. package/dist/es/predicates/isValueObject.js +1 -0
  65. package/dist/es/toJS.js +1 -0
  66. package/dist/es/utils/arrCopy.js +3 -1
  67. package/dist/es/utils/assertNotInfinite.js +2 -1
  68. package/dist/es/utils/coerceKeyPath.js +2 -1
  69. package/dist/es/utils/deepEqual.js +2 -1
  70. package/dist/es/utils/hasOwnProperty.js +2 -1
  71. package/dist/es/utils/invariant.js +2 -1
  72. package/dist/es/utils/isArrayLike.js +2 -1
  73. package/dist/es/utils/isDataStructure.js +2 -1
  74. package/dist/es/utils/isPlainObj.js +2 -1
  75. package/dist/es/utils/mixin.js +5 -1
  76. package/dist/es/utils/quoteString.js +5 -1
  77. package/dist/es/utils/shallowCopy.js +2 -1
  78. package/dist/immutable.d.ts +6 -2
  79. package/dist/immutable.js +25 -10
  80. package/dist/immutable.min.js +2 -32
  81. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * @license
2
3
  * MIT License
3
4
  *
4
5
  * Copyright (c) 2014-present, Lee Byron and other contributors.
@@ -21,6 +22,7 @@
21
22
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
23
  * SOFTWARE.
23
24
  */
25
+ // http://jsperf.com/copy-array-inline
24
26
  function arrCopy(arr, offset) {
25
27
  offset = offset || 0;
26
28
  var len = Math.max(0, arr.length - offset);
@@ -31,4 +33,4 @@ function arrCopy(arr, offset) {
31
33
  return newArr;
32
34
  }
33
35
 
34
- export default arrCopy;
36
+ export { arrCopy as default };
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * @license
2
3
  * MIT License
3
4
  *
4
5
  * Copyright (c) 2014-present, Lee Byron and other contributors.
@@ -30,4 +31,4 @@ function assertNotInfinite(size) {
30
31
  );
31
32
  }
32
33
 
33
- export default assertNotInfinite;
34
+ export { assertNotInfinite as default };
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * @license
2
3
  * MIT License
3
4
  *
4
5
  * Copyright (c) 2014-present, Lee Byron and other contributors.
@@ -36,4 +37,4 @@ function coerceKeyPath(keyPath) {
36
37
  );
37
38
  }
38
39
 
39
- export default coerceKeyPath;
40
+ export { coerceKeyPath as default };
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * @license
2
3
  * MIT License
3
4
  *
4
5
  * Copyright (c) 2014-present, Lee Byron and other contributors.
@@ -95,4 +96,4 @@ function deepEqual(a, b) {
95
96
  return allEqual && a.size === bSize;
96
97
  }
97
98
 
98
- export default deepEqual;
99
+ export { deepEqual as default };
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * @license
2
3
  * MIT License
3
4
  *
4
5
  * Copyright (c) 2014-present, Lee Byron and other contributors.
@@ -23,4 +24,4 @@
23
24
  */
24
25
  var hasOwnProperty = Object.prototype.hasOwnProperty;
25
26
 
26
- export default hasOwnProperty;
27
+ export { hasOwnProperty as default };
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * @license
2
3
  * MIT License
3
4
  *
4
5
  * Copyright (c) 2014-present, Lee Byron and other contributors.
@@ -25,4 +26,4 @@ function invariant(condition, error) {
25
26
  if (!condition) { throw new Error(error); }
26
27
  }
27
28
 
28
- export default invariant;
29
+ export { invariant as default };
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * @license
2
3
  * MIT License
3
4
  *
4
5
  * Copyright (c) 2014-present, Lee Byron and other contributors.
@@ -40,4 +41,4 @@ function isArrayLike(value) {
40
41
  );
41
42
  }
42
43
 
43
- export default isArrayLike;
44
+ export { isArrayLike as default };
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * @license
2
3
  * MIT License
3
4
  *
4
5
  * Copyright (c) 2014-present, Lee Byron and other contributors.
@@ -35,4 +36,4 @@ function isDataStructure(value) {
35
36
  );
36
37
  }
37
38
 
38
- export default isDataStructure;
39
+ export { isDataStructure as default };
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * @license
2
3
  * MIT License
3
4
  *
4
5
  * Copyright (c) 2014-present, Lee Byron and other contributors.
@@ -48,4 +49,4 @@ function isPlainObject(value) {
48
49
  return parentProto === proto;
49
50
  }
50
51
 
51
- export default isPlainObject;
52
+ export { isPlainObject as default };
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * @license
2
3
  * MIT License
3
4
  *
4
5
  * Copyright (c) 2014-present, Lee Byron and other contributors.
@@ -21,6 +22,9 @@
21
22
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
23
  * SOFTWARE.
23
24
  */
25
+ /**
26
+ * Contributes additional methods to a constructor
27
+ */
24
28
  function mixin(ctor, methods) {
25
29
  var keyCopier = function (key) {
26
30
  ctor.prototype[key] = methods[key];
@@ -31,4 +35,4 @@ function mixin(ctor, methods) {
31
35
  return ctor;
32
36
  }
33
37
 
34
- export default mixin;
38
+ export { mixin as default };
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * @license
2
3
  * MIT License
3
4
  *
4
5
  * Copyright (c) 2014-present, Lee Byron and other contributors.
@@ -21,6 +22,9 @@
21
22
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
23
  * SOFTWARE.
23
24
  */
25
+ /**
26
+ * Converts a value to a string, adding quotes if a string was provided.
27
+ */
24
28
  function quoteString(value) {
25
29
  try {
26
30
  return typeof value === 'string' ? JSON.stringify(value) : String(value);
@@ -29,4 +33,4 @@ function quoteString(value) {
29
33
  }
30
34
  }
31
35
 
32
- export default quoteString;
36
+ export { quoteString as default };
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * @license
2
3
  * MIT License
3
4
  *
4
5
  * Copyright (c) 2014-present, Lee Byron and other contributors.
@@ -37,4 +38,4 @@ function shallowCopy(from) {
37
38
  return to;
38
39
  }
39
40
 
40
- export default shallowCopy;
41
+ export { shallowCopy as default };
@@ -1830,6 +1830,8 @@ declare namespace Immutable {
1830
1830
  * `Set.fromKeys()` creates a new immutable Set containing the keys from
1831
1831
  * this Collection or JavaScript Object.
1832
1832
  */
1833
+ function fromKeys<T>(iter: Collection.Keyed<T, unknown>): Set<T>;
1834
+ // tslint:disable-next-line unified-signatures
1833
1835
  function fromKeys<T>(iter: Collection<T, unknown>): Set<T>;
1834
1836
  function fromKeys(obj: { [key: string]: unknown }): Set<string>;
1835
1837
 
@@ -2053,6 +2055,8 @@ declare namespace Immutable {
2053
2055
  * `OrderedSet.fromKeys()` creates a new immutable OrderedSet containing
2054
2056
  * the keys from this Collection or JavaScript Object.
2055
2057
  */
2058
+ function fromKeys<T>(iter: Collection.Keyed<T, unknown>): OrderedSet<T>;
2059
+ // tslint:disable-next-line unified-signatures
2056
2060
  function fromKeys<T>(iter: Collection<T, unknown>): OrderedSet<T>;
2057
2061
  function fromKeys(obj: { [key: string]: unknown }): OrderedSet<string>;
2058
2062
  }
@@ -2475,8 +2479,8 @@ declare namespace Immutable {
2475
2479
  * ```
2476
2480
  */
2477
2481
  function Range(
2478
- start?: number,
2479
- end?: number,
2482
+ start: number,
2483
+ end: number,
2480
2484
  step?: number
2481
2485
  ): Seq.Indexed<number>;
2482
2486
 
package/dist/immutable.js CHANGED
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * @license
2
3
  * MIT License
3
4
  *
4
5
  * Copyright (c) 2014-present, Lee Byron and other contributors.
@@ -25,8 +26,9 @@
25
26
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
26
27
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
27
28
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Immutable = {}));
28
- }(this, (function (exports) { 'use strict';
29
+ })(this, (function (exports) { 'use strict';
29
30
 
31
+ // Used for setting prototype methods that IE8 chokes on.
30
32
  var DELETE = 'delete';
31
33
 
32
34
  // Constants describing the size of trie nodes.
@@ -118,6 +120,7 @@
118
120
  return value < 0 || (value === 0 && 1 / value === -Infinity);
119
121
  }
120
122
 
123
+ // Note: value is unchanged to not break immutable-devtools.
121
124
  var IS_COLLECTION_SYMBOL = '@@__IMMUTABLE_ITERABLE__@@';
122
125
 
123
126
  function isCollection(maybeCollection) {
@@ -1935,6 +1938,7 @@
1935
1938
  return a > b ? 1 : a < b ? -1 : 0;
1936
1939
  }
1937
1940
 
1941
+ // http://jsperf.com/copy-array-inline
1938
1942
  function arrCopy(arr, offset) {
1939
1943
  offset = offset || 0;
1940
1944
  var len = Math.max(0, arr.length - offset);
@@ -2006,6 +2010,9 @@
2006
2010
  );
2007
2011
  }
2008
2012
 
2013
+ /**
2014
+ * Converts a value to a string, adding quotes if a string was provided.
2015
+ */
2009
2016
  function quoteString(value) {
2010
2017
  try {
2011
2018
  return typeof value === 'string' ? JSON.stringify(value) : String(value);
@@ -4289,6 +4296,9 @@
4289
4296
  return allEqual && a.size === bSize;
4290
4297
  }
4291
4298
 
4299
+ /**
4300
+ * Contributes additional methods to a constructor
4301
+ */
4292
4302
  function mixin(ctor, methods) {
4293
4303
  var keyCopier = function (key) {
4294
4304
  ctor.prototype[key] = methods[key];
@@ -4571,15 +4581,22 @@
4571
4581
  */
4572
4582
  var Range = /*@__PURE__*/(function (IndexedSeq) {
4573
4583
  function Range(start, end, step) {
4584
+ if ( step === void 0 ) step = 1;
4585
+
4574
4586
  if (!(this instanceof Range)) {
4575
4587
  return new Range(start, end, step);
4576
4588
  }
4577
4589
  invariant(step !== 0, 'Cannot step a Range by 0');
4578
- start = start || 0;
4579
- if (end === undefined) {
4580
- end = Infinity;
4581
- }
4582
- step = step === undefined ? 1 : Math.abs(step);
4590
+ invariant(
4591
+ start !== undefined,
4592
+ 'You must define a start value when using Range'
4593
+ );
4594
+ invariant(
4595
+ end !== undefined,
4596
+ 'You must define an end value when using Range'
4597
+ );
4598
+
4599
+ step = Math.abs(step);
4583
4600
  if (end < start) {
4584
4601
  step = -step;
4585
4602
  }
@@ -5905,7 +5922,7 @@
5905
5922
  return isIndexed(v) ? v.toList() : isKeyed(v) ? v.toMap() : v.toSet();
5906
5923
  }
5907
5924
 
5908
- var version = "5.0.0-beta.4";
5925
+ var version = "5.0.0-beta.5";
5909
5926
 
5910
5927
  // Note: Iterable is deprecated
5911
5928
  var Iterable = Collection;
@@ -5958,6 +5975,4 @@
5958
5975
  exports.updateIn = updateIn$1;
5959
5976
  exports.version = version;
5960
5977
 
5961
- Object.defineProperty(exports, '__esModule', { value: true });
5962
-
5963
- })));
5978
+ }));