chance-class-name
Advanced tools
Comparing version 1.0.0 to 1.0.1
18
index.js
@@ -0,1 +1,4 @@ | ||
const Chance = require('chance'); | ||
const chance = new Chance(); | ||
const firstCharacterPool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_'; | ||
@@ -5,7 +8,7 @@ const remainingCharacterPool = `${firstCharacterPool}0123456789`; | ||
module.exports = () => { | ||
const length = chance.natural({ // eslint-disable-line no-undef | ||
const length = chance.natural({ | ||
max: 25, | ||
min: 1 | ||
}); | ||
const firstCharacter = chance.character({pool: firstCharacterPool}); // eslint-disable-line no-undef | ||
const firstCharacter = chance.character({pool: firstCharacterPool}); | ||
@@ -16,6 +19,9 @@ if (length === 1) { | ||
return firstCharacter + chance.string({ // eslint-disable-line no-undef | ||
length: length - 1, | ||
pool: remainingCharacterPool | ||
}); | ||
return ( | ||
firstCharacter + | ||
chance.string({ | ||
length: length - 1, | ||
pool: remainingCharacterPool | ||
}) | ||
); | ||
}; |
103
package.json
{ | ||
"name": "chance-class-name", | ||
"description": "A Chance.js mixin to generate class names.", | ||
"version": "1.0.0", | ||
"author": { | ||
"name": "Michael Novotny", | ||
"email": "manovotny@gmail.com", | ||
"url": "htts://manovotny.com" | ||
}, | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/manovotny/chance-class-name.git" | ||
}, | ||
"keywords": [ | ||
"chance", | ||
"class", | ||
"classname", | ||
"css", | ||
"generated", | ||
"mixin", | ||
"random" | ||
], | ||
"engines": { | ||
"node": ">=6" | ||
}, | ||
"main": "index.js", | ||
"files": [ | ||
"src" | ||
], | ||
"scripts": { | ||
"lint": "eslint . --ext .json --ext .js", | ||
"test": "npm run lint && npm run unit", | ||
"unit": "jest" | ||
}, | ||
"dependencies": { | ||
"chance": "1.0.9" | ||
}, | ||
"devDependencies": { | ||
"eslint-config-get-off-my-lawn": "2.1.0", | ||
"jest": "20.0.4" | ||
} | ||
"name": "chance-class-name", | ||
"description": "A Chance.js mixin to generate class names.", | ||
"version": "1.0.1", | ||
"author": { | ||
"name": "Michael Novotny", | ||
"email": "manovotny@gmail.com", | ||
"url": "htts://manovotny.com" | ||
}, | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/manovotny/chance-class-name.git" | ||
}, | ||
"keywords": [ | ||
"chance", | ||
"class", | ||
"classname", | ||
"css", | ||
"generated", | ||
"mixin", | ||
"random" | ||
], | ||
"engines": { | ||
"node": ">=8.6.0", | ||
"yarn": ">=1.0.0" | ||
}, | ||
"main": "index.js", | ||
"files": [ | ||
"src" | ||
], | ||
"scripts": { | ||
"lint": "eslint . --ext .js --ext .json", | ||
"prettier": "prettier --write \"**/*.{js,json,md,yml}\"", | ||
"prettier:check": "prettier --check \"**/*.{js,json,md,yml}\"", | ||
"test": "yarn lint && yarn prettier:check && yarn unit", | ||
"unit": "jest" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
}, | ||
"lint-staged": { | ||
"*.{js,json,md,yml}": [ | ||
"prettier --write", | ||
"git add" | ||
] | ||
}, | ||
"dependencies": { | ||
"chance": "1.1.0" | ||
}, | ||
"devDependencies": { | ||
"eslint": "6.2.1", | ||
"eslint-config-get-off-my-lawn": "5.0.1", | ||
"husky": "3.0.5", | ||
"jest": "24.9.0", | ||
"lint-staged": "9.2.5", | ||
"prettier": "1.18.2" | ||
}, | ||
"peerDependencies": { | ||
"chance": "^1.0.13" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4061
21
2
6
+ Addedchance@1.1.0(transitive)
- Removedchance@1.0.9(transitive)
Updatedchance@1.1.0