10000 Deploy 37ae5beef11664371ecb231b422a25ffa11126eb to NPM branch · MULXCODE/immutable-js@4f791d6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4f791d6

Browse files
author
Travis CI
committed
Deploy 37ae5be to NPM branch
1 parent 11a28fa commit 4f791d6

File tree

6 files changed

+41
-31
lines changed

6 files changed

+41
-31
lines changed

dist/immutable-nonambient.d.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3810,15 +3810,20 @@
38103810
contains(value: V): boolean;
38113811

38123812
/**
3813-
* The first value in the Collection.
3813+
* In case the `Collection` is not empty returns the first element of the
3814+
* `Collection`.
3815+
* In case the `Collection` is empty returns the optional default
3816+
* value if provided, if no default value is provided returns undefined.
38143817
*/
3815-
first(): V | undefined;
3818+
first<NSV>(notSetValue?: NSV): V | NSV;
38163819

38173820
/**
3818-
* The last value in the Collection.
3821+
* In case the `Collection` is not empty returns the last element of the
3822+
* `Collection`.
3823+
* In case the `Collection` is empty returns the optional default
3824+
* value if provided, if no default value is provided returns undefined.
38193825
*/
3820-
last(): V | undefined;
3821-
3826+
last<NSV>(notSetValue?: NSV): V | NSV;
38223827

38233828
// Reading deep values
38243829

dist/immutable.d.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3810,15 +3810,20 @@ declare module Immutable {
38103810
contains(value: V): boolean;
38113811

38123812
/**
3813-
* The first value in the Collection.
3813+
* In case the `Collection` is not empty returns the first element of the
3814+
* `Collection`.
3815+
* In case the `Collection` is empty returns the optional default
3816+
* value if provided, if no default value is provided returns undefined.
38143817
*/
3815-
first(): V | undefined;
3818+
first<NSV>(notSetValue?: NSV): V | NSV;
38163819

38173820
/**
3818-
* The last value in the Collection.
3821+
* In case the `Collection` is not empty returns the last element of the
3822+
* `Collection`.
3823+
* In case the `Collection` is empty returns the optional default
3824+
* value if provided, if no default value is provided returns undefined.
38193825
*/
3820-
last(): V | undefined;
3821-
3826+
last<NSV>(notSetValue?: NSV): V | NSV;
38223827

38233828
// Reading deep values
38243829

dist/immutable.es.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4852,8 +4852,8 @@ mixin(Collection, {
48524852
.findKey(predicate, context);
48534853
},
48544854

4855-
first: function first() {
4856-
return this.find(returnTrue);
4855+
first: function first(notSetValue) {
4856+
return this.find(returnTrue, null, notSetValue);
48574857
},
48584858

48594859
flatMap: function flatMap(mapper, context) {
@@ -4904,10 +4904,10 @@ mixin(Collection, {
49044904
.toIndexedSeq();
49054905
},
49064906

4907-
last: function last() {
4907+
last: function last(notSetValue) {
49084908
return this.toSeq()
49094909
.reverse()
4910-
.first();
4910+
.first(notSetValue);
49114911
},
49124912

49134913
lastKeyOf: function lastKeyOf(searchValue) {
@@ -5111,8 +5111,8 @@ mixin(IndexedCollection, {
51115111
return entry ? entry[0] : -1;
51125112
},
51135113

5114-
first: function first() {
5115-
return this.get(0);
5114+
first: function first(notSetValue) {
5115+
return this.get(0, notSetValue);
51165116
},
51175117

51185118
flatten: function flatten(depth) {
@@ -5155,8 +5155,8 @@ mixin(IndexedCollection, {
51555155
return Range(0, this.size);
51565156
},
51575157

5158-
last: function last() {
5159-
return this.get(-1);
5158+
last: function last(notSetValue) {
5159+
return this.get(-1, notSetValue);
51605160
},
51615161

51625162
skipWhile: function skipWhile(predicate, context) {

dist/immutable.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4858,8 +4858,8 @@
48584858
.findKey(predicate, context);
48594859
},
48604860

4861-
first: function first() {
4862-
return this.find(returnTrue);
4861+
first: function first(notSetValue) {
4862+
return this.find(returnTrue, null, notSetValue);
48634863
},
48644864

48654865
flatMap: function flatMap(mapper, context) {
@@ -4910,10 +4910,10 @@
49104910
.toIndexedSeq();
49114911
},
49124912

4913-
last: function last() {
4913+
last: function last(notSetValue) {
49144914
return this.toSeq()
49154915
.reverse()
4916-
.first();
4916+
.first(notSetValue);
49174917
},
49184918

49194919
lastKeyOf: function lastKeyOf(searchValue) {
@@ -5117,8 +5117,8 @@
51175117
return entry ? entry[0] : -1;
51185118
},
51195119

5120-
first: function first() {
5121-
return this.get(0);
5120+
first: function first(notSetValue) {
5121+
return this.get(0, notSetValue);
51225122
},
51235123

51245124
flatten: function flatten(depth) {
@@ -5161,8 +5161,8 @@
51615161
return Range(0, this.size);
51625162
},
51635163

5164-
last: function last() {
5165-
return this.get(-1);
5164+
last: function last(notSetValue) {
5165+
return this.get(-1, notSetValue);
51665166
},
51675167

51685168
skipWhile: function skipWhile(predicate, context) {

dist/immutable.js.flow

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ declare class _Collection<K, +V> /*implements ValueObject*/ {
6363
has(key: K): boolean;
6464
includes(value: V): boolean;
6565
contains(value: V): boolean;
66-
first(): V | void;
67-
last(): V | void;
66+
first<NSV>(notSetValue?: NSV): V | NSV;
67+
last<NSV>(notSetValue?: NSV): V | NSV;
6868

6969
hasIn(keyPath: Iterable<mixed>): boolean;
7070

0 commit comments

Comments
 (0)
0