immutable 5.0.0-beta.3 → 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 (82) hide show
  1. package/README.md +4 -4
  2. package/dist/es/Collection.js +75 -0
  3. package/dist/es/CollectionImpl.js +781 -0
  4. package/dist/es/Hash.js +260 -0
  5. package/dist/es/Immutable.js +73 -0
  6. package/dist/es/Iterator.js +106 -0
  7. package/dist/es/List.js +692 -0
  8. package/dist/es/Map.js +833 -0
  9. package/dist/es/Math.js +45 -0
  10. package/dist/es/Operations.js +953 -0
  11. package/dist/es/OrderedMap.js +195 -0
  12. package/dist/es/OrderedSet.js +91 -0
  13. package/dist/es/PairSorting.js +30 -0
  14. package/dist/es/Range.js +175 -0
  15. package/dist/es/Record.js +291 -0
  16. package/dist/es/Repeat.js +130 -0
  17. package/dist/es/Seq.js +397 -0
  18. package/dist/es/Set.js +278 -0
  19. package/dist/es/Stack.js +260 -0
  20. package/dist/es/TrieUtils.js +117 -0
  21. package/dist/es/fromJS.js +74 -0
  22. package/dist/es/functional/get.js +38 -0
  23. package/dist/es/functional/getIn.js +41 -0
  24. package/dist/es/functional/has.js +35 -0
  25. package/dist/es/functional/hasIn.js +32 -0
  26. package/dist/es/functional/merge.js +137 -0
  27. package/dist/es/functional/remove.js +56 -0
  28. package/dist/es/functional/removeIn.js +32 -0
  29. package/dist/es/functional/set.js +52 -0
  30. package/dist/es/functional/setIn.js +32 -0
  31. package/dist/es/functional/update.js +31 -0
  32. package/dist/es/functional/updateIn.js +94 -0
  33. package/dist/es/is.js +108 -0
  34. package/dist/es/methods/asImmutable.js +29 -0
  35. package/dist/es/methods/asMutable.js +31 -0
  36. package/dist/es/methods/deleteIn.js +31 -0
  37. package/dist/es/methods/getIn.js +31 -0
  38. package/dist/es/methods/hasIn.js +31 -0
  39. package/dist/es/methods/merge.js +79 -0
  40. package/dist/es/methods/mergeDeep.js +41 -0
  41. package/dist/es/methods/mergeDeepIn.js +37 -0
  42. package/dist/es/methods/mergeIn.js +36 -0
  43. package/dist/es/methods/setIn.js +31 -0
  44. package/dist/es/methods/toObject.js +36 -0
  45. package/dist/es/methods/update.js +33 -0
  46. package/dist/es/methods/updateIn.js +31 -0
  47. package/dist/es/methods/wasAltered.js +29 -0
  48. package/dist/es/methods/withMutations.js +31 -0
  49. package/dist/es/package.json.js +27 -0
  50. package/dist/es/predicates/isAssociative.js +32 -0
  51. package/dist/es/predicates/isCollection.js +32 -0
  52. package/dist/es/predicates/isImmutable.js +32 -0
  53. package/dist/es/predicates/isIndexed.js +31 -0
  54. package/dist/es/predicates/isKeyed.js +31 -0
  55. package/dist/es/predicates/isList.js +31 -0
  56. package/dist/es/predicates/isMap.js +31 -0
  57. package/dist/es/predicates/isOrdered.js +31 -0
  58. package/dist/es/predicates/isOrderedMap.js +32 -0
  59. package/dist/es/predicates/isOrderedSet.js +32 -0
  60. package/dist/es/predicates/isRecord.js +31 -0
  61. package/dist/es/predicates/isSeq.js +31 -0
  62. package/dist/es/predicates/isSet.js +31 -0
  63. package/dist/es/predicates/isStack.js +31 -0
  64. package/dist/es/predicates/isValueObject.js +33 -0
  65. package/dist/es/toJS.js +54 -0
  66. package/dist/es/utils/arrCopy.js +36 -0
  67. package/dist/es/utils/assertNotInfinite.js +34 -0
  68. package/dist/es/utils/coerceKeyPath.js +40 -0
  69. package/dist/es/utils/deepEqual.js +99 -0
  70. package/dist/es/utils/hasOwnProperty.js +27 -0
  71. package/dist/es/utils/invariant.js +29 -0
  72. package/dist/es/utils/isArrayLike.js +44 -0
  73. package/dist/es/utils/isDataStructure.js +39 -0
  74. package/dist/es/utils/isPlainObj.js +52 -0
  75. package/dist/es/utils/mixin.js +38 -0
  76. package/dist/es/utils/quoteString.js +36 -0
  77. package/dist/es/utils/shallowCopy.js +41 -0
  78. package/dist/immutable.d.ts +137 -16
  79. package/dist/immutable.js +25 -68
  80. package/dist/immutable.min.js +2 -32
  81. package/package.json +2 -3
  82. package/dist/immutable.es.js +0 -5965
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Build Status](https://github.com/immutable-js/immutable-js/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/immutable-js/immutable-js/actions/workflows/ci.yml?query=branch%3Amain) [Chat on slack](https://immutable-js.slack.com)
4
4
 
5
- [Read the docs](https://immutable-js.com) and eat your vegetables.
5
+ [Read the docs](https://immutable-js.com/docs/) and eat your vegetables.
6
6
 
7
7
  Docs are automatically generated from [README.md][] and [immutable.d.ts][].
8
8
  Please contribute! Also, don't miss the [wiki][] which contains articles on
@@ -152,9 +152,9 @@ via relative path to the type definitions at the top of your file.
152
152
 
153
153
  ```js
154
154
  ///<reference path='./node_modules/immutable/dist/immutable.d.ts'/>
155
- import Immutable from 'immutable';
156
- var map1: Immutable.Map<string, number>;
157
- map1 = Immutable.Map({ a: 1, b: 2, c: 3 });
155
+ import { Map } from 'immutable';
156
+ var map1: Map<string, number>;
157
+ map1 = Map({ a: 1, b: 2, c: 3 });
158
158
  var map2 = map1.set('b', 50);
159
159
  map1.get('b'); // 2
160
160
  map2.get('b'); // 50
@@ -0,0 +1,75 @@
1
+ /**
2
+ * @license
3
+ * MIT License
4
+ *
5
+ * Copyright (c) 2014-present, Lee Byron and other contributors.
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+ import { Seq, KeyedSeq, IndexedSeq, SetSeq } from './Seq.js';
26
+ import { isCollection } from './predicates/isCollection.js';
27
+ import { isKeyed } from './predicates/isKeyed.js';
28
+ import { isIndexed } from './predicates/isIndexed.js';
29
+ import { isAssociative } from './predicates/isAssociative.js';
30
+
31
+ var Collection = function Collection(value) {
32
+ return isCollection(value) ? value : Seq(value);
33
+ };
34
+
35
+ var KeyedCollection = /*@__PURE__*/(function (Collection) {
36
+ function KeyedCollection(value) {
37
+ return isKeyed(value) ? value : KeyedSeq(value);
38
+ }
39
+
40
+ if ( Collection ) KeyedCollection.__proto__ = Collection;
41
+ KeyedCollection.prototype = Object.create( Collection && Collection.prototype );
42
+ KeyedCollection.prototype.constructor = KeyedCollection;
43
+
44
+ return KeyedCollection;
45
+ }(Collection));
46
+
47
+ var IndexedCollection = /*@__PURE__*/(function (Collection) {
48
+ function IndexedCollection(value) {
49
+ return isIndexed(value) ? value : IndexedSeq(value);
50
+ }
51
+
52
+ if ( Collection ) IndexedCollection.__proto__ = Collection;
53
+ IndexedCollection.prototype = Object.create( Collection && Collection.prototype );
54
+ IndexedCollection.prototype.constructor = IndexedCollection;
55
+
56
+ return IndexedCollection;
57
+ }(Collection));
58
+
59
+ var SetCollection = /*@__PURE__*/(function (Collection) {
60
+ function SetCollection(value) {
61
+ return isCollection(value) && !isAssociative(value) ? value : SetSeq(value);
62
+ }
63
+
64
+ if ( Collection ) SetCollection.__proto__ = Collection;
65
+ SetCollection.prototype = Object.create( Collection && Collection.prototype );
66
+ SetCollection.prototype.constructor = SetCollection;
67
+
68
+ return SetCollection;
69
+ }(Collection));
70
+
71
+ Collection.Keyed = KeyedCollection;
72
+ Collection.Indexed = IndexedCollection;
73
+ Collection.Set = SetCollection;
74
+
75
+ export { Collection, IndexedCollection, KeyedCollection, SetCollection };