-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add randomphrase lib for random phrase id generation (#156)
* Add randomphrase * bump ver, fix vulns
- Loading branch information
1 parent
b08746a
commit 0e87a65
Showing
6 changed files
with
14,860 additions
and
32 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/************************************************************************** | ||
* (C) Copyright ModusBox Inc. 2019 - All rights reserved. * | ||
* * | ||
* This file is made available under the terms of the license agreement * | ||
* specified in the corresponding source code repository. * | ||
* * | ||
* ORIGINAL AUTHOR: * | ||
* Matt Kingston - [email protected] * | ||
**************************************************************************/ | ||
|
||
'use strict'; | ||
|
||
const words = require('./words.json'); | ||
|
||
const randomEl = arr => arr[Math.floor(Math.random() * arr.length)]; | ||
module.exports = (separator = '-') => [ | ||
randomEl(words.adjectives), | ||
randomEl(words.nouns), | ||
randomEl(words.adjectives), | ||
randomEl(words.nouns) | ||
].join(separator); |
Oops, something went wrong.