parent
61d6e13c78
commit
5abf4c4e06
3 changed files with 14 additions and 12 deletions
|
@ -1,8 +1,14 @@
|
|||
import generate from 'project-name-generator';
|
||||
import friendlyWords from 'friendly-words';
|
||||
import * as ActionTypes from '../../../constants';
|
||||
|
||||
const generateRandomName = () => {
|
||||
const adj = friendlyWords.predicates[Math.floor(Math.random() * friendlyWords.predicates.length)];
|
||||
const obj = friendlyWords.objects[Math.floor(Math.random() * friendlyWords.objects.length)];
|
||||
return `${adj} ${obj}`;
|
||||
};
|
||||
|
||||
const initialState = () => {
|
||||
const generatedString = generate({ words: 2 }).spaced;
|
||||
const generatedString = generateRandomName();
|
||||
const generatedName = generatedString.charAt(0).toUpperCase() + generatedString.slice(1);
|
||||
return {
|
||||
name: generatedName,
|
||||
|
|
14
package-lock.json
generated
14
package-lock.json
generated
|
@ -5043,6 +5043,11 @@
|
|||
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
|
||||
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
|
||||
},
|
||||
"friendly-words": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/friendly-words/-/friendly-words-1.1.3.tgz",
|
||||
"integrity": "sha512-o4wUonKIZlPiVL3Q/qah1SBKrTlGAk9t8Tv1VUk24plhPib0I5utFszQlzHIuFpOIhYX0+GQ0VNQ7KSmr4Y3CQ=="
|
||||
},
|
||||
"fs-constants": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
|
||||
|
@ -12902,15 +12907,6 @@
|
|||
"integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
|
||||
"dev": true
|
||||
},
|
||||
"project-name-generator": {
|
||||
"version": "2.1.6",
|
||||
"resolved": "https://registry.npmjs.org/project-name-generator/-/project-name-generator-2.1.6.tgz",
|
||||
"integrity": "sha512-5r5MzHoNf7GTKg0V7zZvolpip5UAQiVpfcSN6QfEK8i/fSKlusJwxzEsKty9ce8h0e5GLoQ85dIGgV1TAnj3Kg==",
|
||||
"requires": {
|
||||
"commander": "^2.15.1",
|
||||
"lodash": "^4.17.10"
|
||||
}
|
||||
},
|
||||
"promise": {
|
||||
"version": "7.3.1",
|
||||
"resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz",
|
||||
|
|
|
@ -105,6 +105,7 @@
|
|||
"express": "^4.16.4",
|
||||
"express-basic-auth": "^1.1.6",
|
||||
"express-session": "^1.15.6",
|
||||
"friendly-words": "^1.1.3",
|
||||
"htmlhint": "^0.10.1",
|
||||
"is-url": "^1.2.4",
|
||||
"js-beautify": "^1.8.9",
|
||||
|
@ -123,7 +124,6 @@
|
|||
"passport-local": "^1.0.0",
|
||||
"pretty-bytes": "^3.0.1",
|
||||
"primer-tooltips": "^1.5.11",
|
||||
"project-name-generator": "^2.1.5",
|
||||
"prop-types": "^15.6.2",
|
||||
"q": "^1.4.1",
|
||||
"react": "^16.7.0",
|
||||
|
|
Loading…
Reference in a new issue