Skip to content

Commit 24531d1

Browse files
committed
chore: wip
1 parent 5f5dc8b commit 24531d1

File tree

1 file changed

+13
-13
lines changed
  • storage/framework/core/collections/src

1 file changed

+13
-13
lines changed

storage/framework/core/collections/src/index.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ export class Collection<T> {
11391139
return result
11401140
}
11411141

1142-
shift(count = 1) {
1142+
shift(count = 1): T | undefined | null {
11431143
if (this.isEmpty()) {
11441144
return null
11451145
}
@@ -1178,7 +1178,7 @@ export class Collection<T> {
11781178
return null
11791179
}
11801180

1181-
shuffle() {
1181+
shuffle(): Collection<T> {
11821182
const items = values(this.items)
11831183

11841184
let j
@@ -1197,7 +1197,7 @@ export class Collection<T> {
11971197
return this
11981198
}
11991199

1200-
skip(number) {
1200+
skip(number: number): Collection<T> {
12011201
if (isObject(this.items)) {
12021202
return new this.constructor(
12031203
Object.keys(this.items).reduce((accumulator, key, index) => {
@@ -1213,7 +1213,7 @@ export class Collection<T> {
12131213
return new this.constructor(this.items.slice(number))
12141214
}
12151215

1216-
skipUntil(valueOrFunction) {
1216+
skipUntil(valueOrFunction: any): Collection<T> {
12171217
let previous = null
12181218
let items
12191219

@@ -1249,7 +1249,7 @@ export class Collection<T> {
12491249
return new this.constructor(items)
12501250
}
12511251

1252-
skipWhile(valueOrFunction) {
1252+
skipWhile(valueOrFunction: any): Collection<T> {
12531253
let previous = null
12541254
let items
12551255

@@ -1285,7 +1285,7 @@ export class Collection<T> {
12851285
return new this.constructor(items)
12861286
}
12871287

1288-
slice(remove, limit) {
1288+
slice(remove: number, limit: number): Collection<T> {
12891289
let collection = this.items.slice(remove)
12901290

12911291
if (limit !== undefined) {
@@ -1295,7 +1295,7 @@ export class Collection<T> {
12951295
return new this.constructor(collection)
12961296
}
12971297

1298-
sole(key, operator, value) {
1298+
sole(key: string, operator: string, value: any): T | undefined {
12991299
let collection
13001300

13011301
if (isFunction(key)) {
@@ -1315,9 +1315,9 @@ export class Collection<T> {
13151315
return collection.first()
13161316
}
13171317

1318-
some = this.contains
1318+
some: typeof this.contains = this.contains
13191319

1320-
sort(fn) {
1320+
sort(fn: (a: T, b: T) => number): Collection<T> {
13211321
const collection = [].concat(this.items)
13221322

13231323
if (fn === undefined) {
@@ -1333,11 +1333,11 @@ export class Collection<T> {
13331333
return new this.constructor(collection)
13341334
}
13351335

1336-
sortDesc() {
1336+
sortDesc(): Collection<T> {
13371337
return this.sort().reverse()
13381338
}
13391339

1340-
sortBy(valueOrFunction) {
1340+
sortBy(valueOrFunction: any): Collection<T> {
13411341
const collection = [].concat(this.items)
13421342
const getValue = (item) => {
13431343
if (isFunction(valueOrFunction)) {
@@ -1371,11 +1371,11 @@ export class Collection<T> {
13711371
return new this.constructor(collection)
13721372
}
13731373

1374-
sortByDesc(valueOrFunction) {
1374+
sortByDesc(valueOrFunction: any): Collection<T> {
13751375
return this.sortBy(valueOrFunction).reverse()
13761376
}
13771377

1378-
sortKeys() {
1378+
sortKeys(): Collection<T> {
13791379
const ordered = {}
13801380

13811381
Object.keys(this.items)

0 commit comments

Comments
 (0)