reformat, linter
This commit is contained in:
		
							parent
							
								
									dd2c3c1f8c
								
							
						
					
					
						commit
						31df6a4542
					
				
					 1 changed files with 24 additions and 24 deletions
				
			
		|  | @ -28,7 +28,7 @@ export class Collection<K = string, V = any> extends Map<K, V> { | ||||||
|     const arr = this.array() |     const arr = this.array() | ||||||
|     if (typeof amount === 'undefined') return arr[arr.length - 1] |     if (typeof amount === 'undefined') return arr[arr.length - 1] | ||||||
|     if (amount < 0) return this.first(amount * -1) |     if (amount < 0) return this.first(amount * -1) | ||||||
| 		if (typeof amount !== 'number' && !amount) return [] |     if (!amount) return [] // eslint-disable-line
 | ||||||
|     return arr.slice(-amount) |     return arr.slice(-amount) | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | @ -38,7 +38,7 @@ export class Collection<K = string, V = any> extends Map<K, V> { | ||||||
|   random(amount?: number): V | V[] { |   random(amount?: number): V | V[] { | ||||||
|     let arr = this.array() |     let arr = this.array() | ||||||
|     if (typeof amount === 'undefined') return arr[Math.floor(Math.random() * arr.length)] |     if (typeof amount === 'undefined') return arr[Math.floor(Math.random() * arr.length)] | ||||||
| 		if (arr.length === 0 || typeof amount !== 'number' && !amount) return [] |     if (arr.length === 0 || !amount) return [] // eslint-disable-line
 | ||||||
|     arr = arr.slice() |     arr = arr.slice() | ||||||
|     return Array.from({ length: amount }, (): V => arr.splice(Math.floor(Math.random() * arr.length), 1)[0]) |     return Array.from({ length: amount }, (): V => arr.splice(Math.floor(Math.random() * arr.length), 1)[0]) | ||||||
|   } |   } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue