lint
This commit is contained in:
		
							parent
							
								
									96ae0a5398
								
							
						
					
					
						commit
						dd2c3c1f8c
					
				
					 1 changed files with 2 additions and 2 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 (!amount) return [] | 		if (typeof amount !== 'number' && !amount) return [] | ||||||
| 		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 || !amount) return [] | 		if (arr.length === 0 || typeof amount !== 'number' && !amount) return [] | ||||||
| 		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