@@ -1139,7 +1139,7 @@ export class Collection<T> {
1139
1139
return result
1140
1140
}
1141
1141
1142
- shift ( count = 1 ) {
1142
+ shift ( count = 1 ) : T | undefined | null {
1143
1143
if ( this . isEmpty ( ) ) {
1144
1144
return null
1145
1145
}
@@ -1178,7 +1178,7 @@ export class Collection<T> {
1178
1178
return null
1179
1179
}
1180
1180
1181
- shuffle ( ) {
1181
+ shuffle ( ) : Collection < T > {
1182
1182
const items = values ( this . items )
1183
1183
1184
1184
let j
@@ -1197,7 +1197,7 @@ export class Collection<T> {
1197
1197
return this
1198
1198
}
1199
1199
1200
- skip ( number ) {
1200
+ skip ( number : number ) : Collection < T > {
1201
1201
if ( isObject ( this . items ) ) {
1202
1202
return new this . constructor (
1203
1203
Object . keys ( this . items ) . reduce ( ( accumulator , key , index ) => {
@@ -1213,7 +1213,7 @@ export class Collection<T> {
1213
1213
return new this . constructor ( this . items . slice ( number ) )
1214
1214
}
1215
1215
1216
- skipUntil ( valueOrFunction ) {
1216
+ skipUntil ( valueOrFunction : any ) : Collection < T > {
1217
1217
let previous = null
1218
1218
let items
1219
1219
@@ -1249,7 +1249,7 @@ export class Collection<T> {
1249
1249
return new this . constructor ( items )
1250
1250
}
1251
1251
1252
- skipWhile ( valueOrFunction ) {
1252
+ skipWhile ( valueOrFunction : any ) : Collection < T > {
1253
1253
let previous = null
1254
1254
let items
1255
1255
@@ -1285,7 +1285,7 @@ export class Collection<T> {
1285
1285
return new this . constructor ( items )
1286
1286
}
1287
1287
1288
- slice ( remove , limit ) {
1288
+ slice ( remove : number , limit : number ) : Collection < T > {
1289
1289
let collection = this . items . slice ( remove )
1290
1290
1291
1291
if ( limit !== undefined ) {
@@ -1295,7 +1295,7 @@ export class Collection<T> {
1295
1295
return new this . constructor ( collection )
1296
1296
}
1297
1297
1298
- sole ( key , operator , value ) {
1298
+ sole ( key : string , operator : string , value : any ) : T | undefined {
1299
1299
let collection
1300
1300
1301
1301
if ( isFunction ( key ) ) {
@@ -1315,9 +1315,9 @@ export class Collection<T> {
1315
1315
return collection . first ( )
1316
1316
}
1317
1317
1318
- some = this . contains
1318
+ some : typeof this . contains = this . contains
1319
1319
1320
- sort ( fn ) {
1320
+ sort ( fn : ( a : T , b : T ) => number ) : Collection < T > {
1321
1321
const collection = [ ] . concat ( this . items )
1322
1322
1323
1323
if ( fn === undefined ) {
@@ -1333,11 +1333,11 @@ export class Collection<T> {
1333
1333
return new this . constructor ( collection )
1334
1334
}
1335
1335
1336
- sortDesc ( ) {
1336
+ sortDesc ( ) : Collection < T > {
1337
1337
return this . sort ( ) . reverse ( )
1338
1338
}
1339
1339
1340
- sortBy ( valueOrFunction ) {
1340
+ sortBy ( valueOrFunction : any ) : Collection < T > {
1341
1341
const collection = [ ] . concat ( this . items )
1342
1342
const getValue = ( item ) => {
1343
1343
if ( isFunction ( valueOrFunction ) ) {
@@ -1371,11 +1371,11 @@ export class Collection<T> {
1371
1371
return new this . constructor ( collection )
1372
1372
}
1373
1373
1374
- sortByDesc ( valueOrFunction ) {
1374
+ sortByDesc ( valueOrFunction : any ) : Collection < T > {
1375
1375
return this . sortBy ( valueOrFunction ) . reverse ( )
1376
1376
}
1377
1377
1378
- sortKeys ( ) {
1378
+ sortKeys ( ) : Collection < T > {
1379
1379
const ordered = { }
1380
1380
1381
1381
Object . keys ( this . items )
0 commit comments