Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chance-class-name

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chance-class-name - npm Package Compare versions

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
})
);
};
{
"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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc