Skip to content

Instantly share code, notes, and snippets.

@banyudu
Created October 14, 2017 05:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save banyudu/533afdb46a0905d44f0fc3a610ae6d53 to your computer and use it in GitHub Desktop.
Save banyudu/533afdb46a0905d44f0fc3a610ae6d53 to your computer and use it in GitHub Desktop.
import Chance = require('chance')
interface IChance extends Chance.Chance {
password(): string
}
export const chance = new Chance() as IChance
// mixins
chance.mixin({
password: () => {
const length = chance.integer({min: 6, max: 30})
return chance.string({length})
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment