immutable 4.2.1 → 4.2.3

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.
@@ -4574,7 +4574,7 @@ declare namespace Immutable {
4574
4574
  ): this;
4575
4575
 
4576
4576
  /**
4577
- * Returns a `Collection.Keyed` of `Collection.Keyeds`, grouped by the return
4577
+ * Returns a `Map` of `Collection`, grouped by the return
4578
4578
  * value of the `grouper` function.
4579
4579
  *
4580
4580
  * Note: This is always an eager operation.
@@ -4600,7 +4600,7 @@ declare namespace Immutable {
4600
4600
  groupBy<G>(
4601
4601
  grouper: (value: V, key: K, iter: this) => G,
4602
4602
  context?: unknown
4603
- ): /*Map*/ Seq.Keyed<G, /*this*/ Collection<K, V>>;
4603
+ ): Map<G, this>;
4604
4604
 
4605
4605
  // Side effects
4606
4606
 
@@ -5886,7 +5886,7 @@ function defaultConverter(k, v) {
5886
5886
  return isIndexed(v) ? v.toList() : isKeyed(v) ? v.toMap() : v.toSet();
5887
5887
  }
5888
5888
 
5889
- var version = "4.2.1";
5889
+ var version = "4.2.3";
5890
5890
 
5891
5891
  var Immutable = {
5892
5892
  version: version,
package/dist/immutable.js CHANGED
@@ -5892,7 +5892,7 @@
5892
5892
  return isIndexed(v) ? v.toList() : isKeyed(v) ? v.toMap() : v.toSet();
5893
5893
  }
5894
5894
 
5895
- var version = "4.2.1";
5895
+ var version = "4.2.3";
5896
5896
 
5897
5897
  var Immutable = {
5898
5898
  version: version,
@@ -332,6 +332,11 @@ declare class KeyedCollection<K, +V> extends Collection<K, V> {
332
332
  context?: mixed
333
333
  ): KeyedCollection<K, V>;
334
334
 
335
+ partition(
336
+ predicate: (value: V, key: K, iter: this) => mixed,
337
+ context?: mixed
338
+ ): [this, this];
339
+
335
340
  map<M>(
336
341
  mapper: (value: V, key: K, iter: this) => M,
337
342
  context?: mixed
@@ -484,6 +489,11 @@ declare class IndexedCollection<+T> extends Collection<number, T> {
484
489
  context?: mixed
485
490
  ): IndexedCollection<T>;
486
491
 
492
+ partition(
493
+ predicate: (value: T, index: number, iter: this) => mixed,
494
+ context?: mixed
495
+ ): [this, this];
496
+
487
497
  map<M>(
488
498
  mapper: (value: T, index: number, iter: this) => M,
489
499
  context?: mixed
@@ -519,6 +529,11 @@ declare class SetCollection<+T> extends Collection<T, T> {
519
529
  context?: mixed
520
530
  ): SetCollection<T>;
521
531
 
532
+ partition(
533
+ predicate: (value: T, value: T, iter: this) => mixed,
534
+ context?: mixed
535
+ ): [this, this];
536
+
522
537
  map<M>(
523
538
  mapper: (value: T, value: T, iter: this) => M,
524
539
  context?: mixed
@@ -570,6 +585,11 @@ declare class KeyedSeq<K, +V> extends Seq<K, V> mixins KeyedCollection<K, V> {
570
585
  context?: mixed
571
586
  ): KeyedSeq<K, V>;
572
587
 
588
+ partition(
589
+ predicate: (value: V, key: K, iter: this) => mixed,
590
+ context?: mixed
591
+ ): [this, this];
592
+
573
593
  map<M>(
574
594
  mapper: (value: V, key: K, iter: this) => M,
575
595
  context?: mixed
@@ -612,6 +632,11 @@ declare class IndexedSeq<+T>
612
632
  context?: mixed
613
633
  ): IndexedSeq<T>;
614
634
 
635
+ partition(
636
+ predicate: (value: T, index: number, iter: this) => mixed,
637
+ context?: mixed
638
+ ): [this, this];
639
+
615
640
  map<M>(
616
641
  mapper: (value: T, index: number, iter: this) => M,
617
642
  context?: mixed
@@ -729,6 +754,11 @@ declare class SetSeq<+T> extends Seq<T, T> mixins SetCollection<T> {
729
754
  context?: mixed
730
755
  ): SetSeq<T>;
731
756
 
757
+ partition(
758
+ predicate: (value: T, value: T, iter: this) => mixed,
759
+ context?: mixed
760
+ ): [this, this];
761
+
732
762
  map<M>(
733
763
  mapper: (value: T, value: T, iter: this) => M,
734
764
  context?: mixed
@@ -949,6 +979,11 @@ declare class List<+T>
949
979
  context?: mixed
950
980
  ): List<T>;
951
981
 
982
+ partition(
983
+ predicate: (value: T, index: number, iter: this) => mixed,
984
+ context?: mixed
985
+ ): [this, this];
986
+
952
987
  map<M>(
953
988
  mapper: (value: T, index: number, iter: this) => M,
954
989
  context?: mixed
@@ -1124,6 +1159,11 @@ declare class Map<K, +V>
1124
1159
  context?: mixed
1125
1160
  ): Map<K, V>;
1126
1161
 
1162
+ partition(
1163
+ predicate: (value: V, key: K, iter: this) => mixed,
1164
+ context?: mixed
1165
+ ): [this, this];
1166
+
1127
1167
  map<M>(
1128
1168
  mapper: (value: V, key: K, iter: this) => M,
1129
1169
  context?: mixed
@@ -1221,6 +1261,11 @@ declare class OrderedMap<K, +V>
1221
1261
  context?: mixed
1222
1262
  ): OrderedMap<K, V>;
1223
1263
 
1264
+ partition(
1265
+ predicate: (value: V, key: K, iter: this) => mixed,
1266
+ context?: mixed
1267
+ ): [this, this];
1268
+
1224
1269
  map<M>(
1225
1270
  mapper: (value: V, key: K, iter: this) => M,
1226
1271
  context?: mixed
@@ -1285,6 +1330,11 @@ declare class Set<+T> extends SetCollection<T> {
1285
1330
  context?: mixed
1286
1331
  ): Set<T>;
1287
1332
 
1333
+ partition(
1334
+ predicate: (value: T, value: T, iter: this) => mixed,
1335
+ context?: mixed
1336
+ ): [this, this];
1337
+
1288
1338
  map<M>(
1289
1339
  mapper: (value: T, value: T, iter: this) => M,
1290
1340
  context?: mixed
@@ -1327,6 +1377,11 @@ declare class OrderedSet<+T> extends Set<T> {
1327
1377
  context?: mixed
1328
1378
  ): OrderedSet<T>;
1329
1379
 
1380
+ partition(
1381
+ predicate: (value: T, value: T, iter: this) => mixed,
1382
+ context?: mixed
1383
+ ): [this, this];
1384
+
1330
1385
  map<M>(
1331
1386
  mapper: (value: T, value: T, iter: this) => M,
1332
1387
  context?: mixed
@@ -51,5 +51,5 @@ t,e,r)&&++o&&n(t,e,i)}),o},e.__iteratorUncached=function(n,t){var i=this;if(t)re
51
51
  ):this.size);var n=this.slice(0,t);return Vt(this,1===r?n:n.concat(Zt(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){e=this.findLastEntry(t,e);return e?e[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return Vt(this,Pt(this,t,!1))},get:function(r,t){return(r=h(this,r))<0||this.size===1/0||void 0!==this.size&&this.size<r?t:this.find(function(t,e){return e===r},void 0,t)},has:function(t){return 0<=(t=h(this,t))&&(void 0!==this.size?this.size===1/0||t<this.size:!!~this.indexOf(t))},interpose:function(t){return Vt(this,(u=t,(t=Xt(o=this)).size=o.size&&2*o.size-1,t.__iterateUncached=function(e,t){var r=this,n=0;return o.__iterate(function(t){return(!n||!1!==e(u,n++,r))&&!1!==e(t,n++,r)},t),n},t.__iteratorUncached=function(t,e){var r,n=o.__iterator(K,e),i=0;return new P(function(){return(!r||i%2)&&(r=n.next()).done?r:i%2?W(t,i++,u):W(t,i++,r.value,r)})},t));var o,u},interleave:function(){var t=[this].concat(Zt(arguments)),e=Jt(this.toSeq(),Z.of,t),r=e.flatten(!0);return e.size&&(r.size=e.size*t.length),Vt(this,r)},keySeq:function(){return Hr(0,this.size)},last:function(t){return this.get(-1,t)},skipWhile:function(t,e){return Vt(this,Bt(this,t,e,!1))},zip:function(){var t=[this].concat(Zt(arguments));return Vt(this,Jt(this,on,t))},zipAll:function(){var t=[this].concat(Zt(arguments));return Vt(this,Jt(this,on,t,!0))},zipWith:function(t){var e=Zt(arguments);return Vt(e[0]=this,Jt(this,t,e))}});var Gr=E.prototype;Gr[S]=!0,Gr[k]=!0,Ur(j,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}});var Zr=j.prototype;function $r(t,n,i,o,u,e){return te(t.size),t.__iterate(function(t,e,r){i=u?(u=!1,t):n.call(o,i,t,e,r)},e),i}function tn(t,e){return e}function en(t,e){return[e,t]}function rn(t){return function(){return!t.apply(this,arguments)}}function nn(t){return function(){return-t.apply(this,arguments)}}function on(){return Zt(arguments)}function un(t,e){return t<e?1:e<t?-1:0}function sn(t,e){return t^e+2654435769+(t<<6)+(t>>2
52
52
  )|0}Zr.has=Xr.includes,Zr.contains=Zr.includes,Zr.keys=Zr.values,Ur(G,Fr),Ur(Z,Gr),Ur($,Zr);var an=function(t){function e(r){return null==r?_n():kr(r)?r:_n().withMutations(function(e){var t=j(r);te(t.size),t.forEach(function(t){return e.add(t)})})}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).of=function(){return this(arguments)},e.fromKeys=function(t){return this(O(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Tr);an.isOrderedSet=kr;var cn,fn=an.prototype;function hn(t,e){var r=Object.create(fn);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function _n(){return cn=cn||hn(zr())}fn[k]=!0,fn.zip=Gr.zip,fn.zipWith=Gr.zipWith,fn.zipAll=Gr.zipAll,fn.__empty=_n,fn.__make=hn;Gr=function(u,s){var a;!function(t){if(x(t))throw Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(A(t))throw Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===t||"object"!=typeof t)throw Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(u);var c=function(t){var n=this;if(t instanceof c)return t;if(!(this instanceof c))return new c(t);if(!a){a=!0;var e=Object.keys(u),r=f._indices={};f._name=s,f._keys=e,f._defaultValues=u;for(var i=0;i<e.length;i++){var o=e[i];r[o]=i,f[o]?"object"==typeof console&&console.warn&&console.warn("Cannot define "+vn(this)+' with property "'+o+'" since that property name is part of the Record API.'):function(t,e){try{Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){$t(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}catch(t){}}(f,o)}}return this.__ownerID=void 0,this._values=ur().withMutations(function(r){r.setSize(n._keys.length),O(t).forEach(function(t,e){r.set(n._indices[e],t===n._defaultValues[e]?void 0:t)})}),this},f=c.prototype=Object.create(pn);return f.constructor=c,s&&(
53
53
  c.displayName=s),c};Gr.prototype.toString=function(){for(var t,e=vn(this)+" { ",r=this._keys,n=0,i=r.length;n!==i;n++)e+=(n?", ":"")+(t=r[n])+": "+oe(this.get(t));return e+" }"},Gr.prototype.equals=function(t){return this===t||x(t)&&yn(this).equals(yn(t))},Gr.prototype.hashCode=function(){return yn(this).hashCode()},Gr.prototype.has=function(t){return this._indices.hasOwnProperty(t)},Gr.prototype.get=function(t,e){if(!this.has(t))return e;e=this._values.get(this._indices[t]);return void 0===e?this._defaultValues[t]:e},Gr.prototype.set=function(t,e){if(this.has(t)){e=this._values.set(this._indices[t],e===this._defaultValues[t]?void 0:e);if(e!==this._values&&!this.__ownerID)return ln(this,e)}return this},Gr.prototype.remove=function(t){return this.set(t)},Gr.prototype.clear=function(){var t=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:ln(this,t)},Gr.prototype.wasAltered=function(){return this._values.wasAltered()},Gr.prototype.toSeq=function(){return yn(this)},Gr.prototype.toJS=function(){return Kr(this)},Gr.prototype.entries=function(){return this.__iterator(T)},Gr.prototype.__iterator=function(t,e){return yn(this).__iterator(t,e)},Gr.prototype.__iterate=function(t,e){return yn(this).__iterate(t,e)},Gr.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._values.__ensureOwner(t);return t?ln(this,e,t):(this.__ownerID=t,this._values=e,this)},Gr.isRecord=x,Gr.getDescriptiveName=vn;var pn=Gr.prototype;function ln(t,e,r){t=Object.create(Object.getPrototypeOf(t));return t._values=e,t.__ownerID=r,t}function vn(t){return t.constructor.displayName||t.constructor.name||"Record"}function yn(e){return ot(e._keys.map(function(t){return[t,e.get(t)]}))}pn[D]=!0,pn[e]=pn.remove,pn.deleteIn=pn.removeIn=ve,pn.getIn=Vr,pn.hasIn=Xr.hasIn,pn.merge=me,pn.mergeWith=we,pn.mergeIn=De,pn.mergeDeep=qe,pn.mergeDeepWith=Me,pn.mergeDeepIn=xe,pn.setIn=pe,pn.update=de,pn.updateIn=ge,pn.withMutations=Ae,pn.asMutable=ke,pn.asImmutable=Re,pn[B]=pn.entries,pn.toJSON=pn.toObject=Xr.toObject,
54
- pn.inspect=pn.toSource=function(){return""+this};var dn,e=function(t){function n(t,e){if(!(this instanceof n))return new n(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(dn)return dn;dn=this}}return t&&(n.__proto__=t),((n.prototype=Object.create(t&&t.prototype)).constructor=n).prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},n.prototype.get=function(t,e){return this.has(t)?this._value:e},n.prototype.includes=function(t){return _t(this._value,t)},n.prototype.slice=function(t,e){var r=this.size;return p(t,e,r)?this:new n(this._value,w(e,r)-y(t,r))},n.prototype.reverse=function(){return this},n.prototype.indexOf=function(t){return _t(this._value,t)?0:-1},n.prototype.lastIndexOf=function(t){return _t(this._value,t)?this.size:-1},n.prototype.__iterate=function(t,e){for(var r=this.size,n=0;n!==r&&!1!==t(this._value,e?r-++n:n++,this););return n},n.prototype.__iterator=function(t,e){var r=this,n=this.size,i=0;return new P(function(){return i===n?N():W(t,e?n-++i:i++,r._value)})},n.prototype.equals=function(t){return t instanceof n?_t(this._value,t._value):Rr(t)},n}(Z);function gn(t,e){return function r(n,i,o,t,u,e){if("string"!=typeof o&&!A(o)&&(X(o)||H(o)||ne(o))){if(~n.indexOf(o))throw new TypeError("Cannot convert circular structure to Immutable");n.push(o),u&&""!==t&&u.push(t);var t=i.call(e,t,F(o).map(function(t,e){return r(n,i,t,e,u,o)}),u&&u.slice());return n.pop(),u&&u.pop(),t}return o}([],e||mn,t,"",e&&2<e.length?[]:void 0,{"":t})}function mn(t,e){return z(e)?e.toList():a(e)?e.toMap():e.toSet()}B={version:"4.2.1",Collection:I,Iterable:I,Seq:F,Map:Ke,OrderedMap:wr,List:ur,Stack:Er,Set:Tr,OrderedSet:an,Record:Gr,Range:Hr,Repeat:e,is:_t,fromJS:gn,hash:yt,isImmutable:A,isCollection:f,isKeyed:a,isIndexed:z,isAssociative:b,isOrdered:R,isValueObject:ht,isPlainObject:ne,isSeq:M,isList:or,isMap:ct,isOrderedMap:ft,isStack:Or,isSet:Ar,isOrderedSet:kr,isRecord:x,get:se,getIn:Jr,has:ue,hasIn:Yr,merge:ze,mergeDeep:Ie,mergeWith:be,
55
- mergeDeepWith:Oe,remove:ce,removeIn:le,set:fe,setIn:_e,update:ye,updateIn:he},Xr=I;t.Collection=I,t.Iterable=Xr,t.List=ur,t.Map=Ke,t.OrderedMap=wr,t.OrderedSet=an,t.Range=Hr,t.Record=Gr,t.Repeat=e,t.Seq=F,t.Set=Tr,t.Stack=Er,t.default=B,t.fromJS=gn,t.get=se,t.getIn=Jr,t.has=ue,t.hasIn=Yr,t.hash=yt,t.is=_t,t.isAssociative=b,t.isCollection=f,t.isImmutable=A,t.isIndexed=z,t.isKeyed=a,t.isList=or,t.isMap=ct,t.isOrdered=R,t.isOrderedMap=ft,t.isOrderedSet=kr,t.isPlainObject=ne,t.isRecord=x,t.isSeq=M,t.isSet=Ar,t.isStack=Or,t.isValueObject=ht,t.merge=ze,t.mergeDeep=Ie,t.mergeDeepWith=Oe,t.mergeWith=be,t.remove=ce,t.removeIn=le,t.set=fe,t.setIn=_e,t.update=ye,t.updateIn=he,t.version="4.2.1",Object.defineProperty(t,"__esModule",{value:!0})});
54
+ pn.inspect=pn.toSource=function(){return""+this};var dn,e=function(t){function n(t,e){if(!(this instanceof n))return new n(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(dn)return dn;dn=this}}return t&&(n.__proto__=t),((n.prototype=Object.create(t&&t.prototype)).constructor=n).prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},n.prototype.get=function(t,e){return this.has(t)?this._value:e},n.prototype.includes=function(t){return _t(this._value,t)},n.prototype.slice=function(t,e){var r=this.size;return p(t,e,r)?this:new n(this._value,w(e,r)-y(t,r))},n.prototype.reverse=function(){return this},n.prototype.indexOf=function(t){return _t(this._value,t)?0:-1},n.prototype.lastIndexOf=function(t){return _t(this._value,t)?this.size:-1},n.prototype.__iterate=function(t,e){for(var r=this.size,n=0;n!==r&&!1!==t(this._value,e?r-++n:n++,this););return n},n.prototype.__iterator=function(t,e){var r=this,n=this.size,i=0;return new P(function(){return i===n?N():W(t,e?n-++i:i++,r._value)})},n.prototype.equals=function(t){return t instanceof n?_t(this._value,t._value):Rr(t)},n}(Z);function gn(t,e){return function r(n,i,o,t,u,e){if("string"!=typeof o&&!A(o)&&(X(o)||H(o)||ne(o))){if(~n.indexOf(o))throw new TypeError("Cannot convert circular structure to Immutable");n.push(o),u&&""!==t&&u.push(t);var t=i.call(e,t,F(o).map(function(t,e){return r(n,i,t,e,u,o)}),u&&u.slice());return n.pop(),u&&u.pop(),t}return o}([],e||mn,t,"",e&&2<e.length?[]:void 0,{"":t})}function mn(t,e){return z(e)?e.toList():a(e)?e.toMap():e.toSet()}B={version:"4.2.3",Collection:I,Iterable:I,Seq:F,Map:Ke,OrderedMap:wr,List:ur,Stack:Er,Set:Tr,OrderedSet:an,Record:Gr,Range:Hr,Repeat:e,is:_t,fromJS:gn,hash:yt,isImmutable:A,isCollection:f,isKeyed:a,isIndexed:z,isAssociative:b,isOrdered:R,isValueObject:ht,isPlainObject:ne,isSeq:M,isList:or,isMap:ct,isOrderedMap:ft,isStack:Or,isSet:Ar,isOrderedSet:kr,isRecord:x,get:se,getIn:Jr,has:ue,hasIn:Yr,merge:ze,mergeDeep:Ie,mergeWith:be,
55
+ mergeDeepWith:Oe,remove:ce,removeIn:le,set:fe,setIn:_e,update:ye,updateIn:he},Xr=I;t.Collection=I,t.Iterable=Xr,t.List=ur,t.Map=Ke,t.OrderedMap=wr,t.OrderedSet=an,t.Range=Hr,t.Record=Gr,t.Repeat=e,t.Seq=F,t.Set=Tr,t.Stack=Er,t.default=B,t.fromJS=gn,t.get=se,t.getIn=Jr,t.has=ue,t.hasIn=Yr,t.hash=yt,t.is=_t,t.isAssociative=b,t.isCollection=f,t.isImmutable=A,t.isIndexed=z,t.isKeyed=a,t.isList=or,t.isMap=ct,t.isOrdered=R,t.isOrderedMap=ft,t.isOrderedSet=kr,t.isPlainObject=ne,t.isRecord=x,t.isSeq=M,t.isSet=Ar,t.isStack=Or,t.isValueObject=ht,t.merge=ze,t.mergeDeep=Ie,t.mergeDeepWith=Oe,t.mergeWith=be,t.remove=ce,t.removeIn=le,t.set=fe,t.setIn=_e,t.update=ye,t.updateIn=he,t.version="4.2.3",Object.defineProperty(t,"__esModule",{value:!0})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "immutable",
3
- "version": "4.2.1",
3
+ "version": "4.2.3",
4
4
  "description": "Immutable Data Collections",
5
5
  "license": "MIT",
6
6
  "homepage": "https://immutable-js.com",