Remove incorrect check in random.pick
This commit is contained in:
parent
b2a73e5130
commit
385894b5ac
1 changed files with 0 additions and 5 deletions
|
@ -114,11 +114,6 @@ class random {
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
static pick (obj) {
|
static pick (obj) {
|
||||||
if (!(Array.isArray(obj) || typeof obj === 'function')) {
|
|
||||||
logger.traceback()
|
|
||||||
throw new TypeError(`random.pick() received invalid object: (${obj})`)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof obj === 'function') {
|
if (typeof obj === 'function') {
|
||||||
return obj()
|
return obj()
|
||||||
} else if (Array.isArray(obj)) {
|
} else if (Array.isArray(obj)) {
|
||||||
|
|
Loading…
Reference in a new issue