diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-06-10 16:43:32 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-06-10 16:43:32 +0200 |
commit | fbc851bc4e21e30490fea508758856dab3f22037 (patch) | |
tree | d5a12b3ec07dd4f0a89b27ee4071cbb8415b9643 /lib/plugins/toNames.js | |
parent | e92b661a2a9b193a85dbae998e463cf9b6299fb9 (diff) | |
download | gitbook-fbc851bc4e21e30490fea508758856dab3f22037.zip gitbook-fbc851bc4e21e30490fea508758856dab3f22037.tar.gz gitbook-fbc851bc4e21e30490fea508758856dab3f22037.tar.bz2 |
Fix listAll to add default plugins after normal ones
Diffstat (limited to 'lib/plugins/toNames.js')
-rw-r--r-- | lib/plugins/toNames.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/plugins/toNames.js b/lib/plugins/toNames.js new file mode 100644 index 0000000..ad0dd8f --- /dev/null +++ b/lib/plugins/toNames.js @@ -0,0 +1,16 @@ + +/** + * Return list of plugin names. This method is nly used in unit tests. + * + * @param {OrderedMap<String:Plugin} plugins + * @return {Array<String>} + */ +function toNames(plugins) { + return plugins + .map(function(plugin) { + return plugin.getName(); + }) + .toArray(); +} + +module.exports = toNames; |