mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 14:02:02 +00:00
Add Collection.map();
This commit is contained in:
parent
fced6983d9
commit
7f9ea762ed
2 changed files with 11 additions and 1 deletions
File diff suppressed because one or more lines are too long
|
|
@ -141,6 +141,16 @@ class Collection extends Map {
|
||||||
}
|
}
|
||||||
return collection;
|
return collection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Functionally identical shortcut to `collection.array().map(...)`.
|
||||||
|
* @param {function} callback Function that produces an element of the new Array, taking three arguments.
|
||||||
|
* @param {*} [thisArg] Optional. Value to use as this when executing callback.
|
||||||
|
* @returns {array}
|
||||||
|
*/
|
||||||
|
map(...args) {
|
||||||
|
return this.array().map(...args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Collection;
|
module.exports = Collection;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue