[
  {
    "path": ".editorconfig",
    "content": "# http://editorconfig.org/\nroot = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\nindent_size = 2\nindent_style = space\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n\n[{**/{actual,fixtures,expected,templates}/**,*.md}]\ntrim_trailing_whitespace = false\ninsert_final_newline = false\n"
  },
  {
    "path": ".eslintrc.json",
    "content": "{\n  \"env\": {\n    \"browser\": false,\n    \"es6\": true,\n    \"node\": true,\n    \"mocha\": true\n  },\n\n  \"parserOptions\":{\n    \"parser\": \"@typescript-eslint/parser\",\n    \"ecmaVersion\": 2017,\n    \"sourceType\": \"module\",\n    \"ecmaFeatures\": {\n      \"modules\": true\n    }\n  },\n\n  \"plugins\": [\n    \"@typescript-eslint/eslint-plugin\"\n  ],\n\n  \"globals\": {\n    \"document\": false,\n    \"navigator\": false,\n    \"window\": false\n  },\n\n  \"rules\": {\n    \"accessor-pairs\": 2,\n    \"arrow-spacing\": [2, { \"before\": true, \"after\": true }],\n    \"block-spacing\": [2, \"always\"],\n    \"brace-style\": [2, \"1tbs\", { \"allowSingleLine\": true }],\n    \"comma-dangle\": [2, \"never\"],\n    \"comma-spacing\": [2, { \"before\": false, \"after\": true }],\n    \"comma-style\": [2, \"last\"],\n    \"constructor-super\": 2,\n    \"curly\": [2, \"multi-line\"],\n    \"dot-location\": [2, \"property\"],\n    \"eol-last\": 2,\n    \"eqeqeq\": [2, \"allow-null\"],\n    \"generator-star-spacing\": [2, { \"before\": true, \"after\": true }],\n    \"handle-callback-err\": [2, \"^(err|error)$\" ],\n    \"indent\": [2, 2, { \"SwitchCase\": 1 }],\n    \"key-spacing\": [2, { \"beforeColon\": false, \"afterColon\": true }],\n    \"keyword-spacing\": [2, { \"before\": true, \"after\": true }],\n    \"new-cap\": [2, { \"newIsCap\": true, \"capIsNew\": false }],\n    \"new-parens\": 2,\n    \"no-array-constructor\": 2,\n    \"no-caller\": 2,\n    \"no-class-assign\": 2,\n    \"no-cond-assign\": 2,\n    \"no-const-assign\": 2,\n    \"no-control-regex\": 2,\n    \"no-debugger\": 2,\n    \"no-delete-var\": 2,\n    \"no-dupe-args\": 2,\n    \"no-dupe-class-members\": 2,\n    \"no-dupe-keys\": 2,\n    \"no-duplicate-case\": 2,\n    \"no-empty-character-class\": 2,\n    \"no-eval\": 2,\n    \"no-ex-assign\": 2,\n    \"no-extend-native\": 2,\n    \"no-extra-bind\": 2,\n    \"no-extra-boolean-cast\": 2,\n    \"no-extra-parens\": [2, \"functions\"],\n    \"no-fallthrough\": 2,\n    \"no-floating-decimal\": 2,\n    \"no-func-assign\": 2,\n    \"no-implied-eval\": 2,\n    \"no-inner-declarations\": [2, \"functions\"],\n    \"no-invalid-regexp\": 2,\n    \"no-irregular-whitespace\": 2,\n    \"no-iterator\": 2,\n    \"no-label-var\": 2,\n    \"no-labels\": 2,\n    \"no-lone-blocks\": 2,\n    \"no-mixed-spaces-and-tabs\": 2,\n    \"no-multi-spaces\": 2,\n    \"no-multi-str\": 2,\n    \"no-multiple-empty-lines\": [2, { \"max\": 1 }],\n    \"no-native-reassign\": 0,\n    \"no-negated-in-lhs\": 2,\n    \"no-new\": 2,\n    \"no-new-func\": 2,\n    \"no-new-object\": 2,\n    \"no-new-require\": 2,\n    \"no-new-wrappers\": 2,\n    \"no-obj-calls\": 2,\n    \"no-octal\": 2,\n    \"no-octal-escape\": 2,\n    \"no-proto\": 0,\n    \"no-redeclare\": 2,\n    \"no-regex-spaces\": 2,\n    \"no-return-assign\": 2,\n    \"no-self-compare\": 2,\n    \"no-sequences\": 2,\n    \"no-shadow-restricted-names\": 2,\n    \"no-spaced-func\": 2,\n    \"no-sparse-arrays\": 2,\n    \"no-this-before-super\": 2,\n    \"no-throw-literal\": 2,\n    \"no-trailing-spaces\": 0,\n    \"no-undef\": 2,\n    \"no-undef-init\": 2,\n    \"no-unexpected-multiline\": 2,\n    \"no-unneeded-ternary\": [2, { \"defaultAssignment\": false }],\n    \"no-unreachable\": 2,\n    \"no-unused-vars\": [2, { \"vars\": \"all\", \"args\": \"none\" }],\n    \"no-useless-call\": 0,\n    \"no-with\": 2,\n    \"one-var\": [0, { \"initialized\": \"never\" }],\n    \"operator-linebreak\": [0, \"after\", { \"overrides\": { \"?\": \"before\", \":\": \"before\" } }],\n    \"padded-blocks\": [0, \"never\"],\n    \"quotes\": [2, \"single\", \"avoid-escape\"],\n    \"radix\": 2,\n    \"semi\": [2, \"always\"],\n    \"semi-spacing\": [2, { \"before\": false, \"after\": true }],\n    \"space-before-blocks\": [2, \"always\"],\n    \"space-before-function-paren\": [2, \"never\"],\n    \"space-in-parens\": [2, \"never\"],\n    \"space-infix-ops\": 2,\n    \"space-unary-ops\": [2, { \"words\": true, \"nonwords\": false }],\n    \"spaced-comment\": [0, \"always\", { \"markers\": [\"global\", \"globals\", \"eslint\", \"eslint-disable\", \"*package\", \"!\", \",\"] }],\n    \"use-isnan\": 2,\n    \"valid-typeof\": 2,\n    \"wrap-iife\": [2, \"any\"],\n    \"yoda\": [2, \"never\"]\n  }\n}\n"
  },
  {
    "path": ".gitattributes",
    "content": "# Enforce Unix newlines\n*.*     text eol=lf\n*.css   text eol=lf\n*.html  text eol=lf\n*.js    text eol=lf\n*.json  text eol=lf\n*.less  text eol=lf\n*.md    text eol=lf\n*.yml   text eol=lf\n\n*.jpg binary\n*.gif binary\n*.png binary\n*.jpeg binary"
  },
  {
    "path": ".gitignore",
    "content": "# always ignore files\n*.DS_Store\n.idea\n.vscode\n*.sublime-*\n\n# test related, or directories generated by tests\ntest/actual\nactual\ncoverage\n.nyc*\n\n# npm\nnode_modules\nnpm-debug.log\n\n# yarn\nyarn.lock\nyarn-error.log\n\n# misc\n_gh_pages\n_draft\n_drafts\nbower_components\nvendor\ntemp\ntmp\nTODO.md\npackage-lock.json"
  },
  {
    "path": ".travis.yml",
    "content": "sudo: false\nos:\n  - linux\n  - osx\nlanguage: node_js\nnode_js:\n  - node\n  - '9'\n  - '8'\n  - '7'\n  - '6'\n  - '5'\n  - '4'\n  - '0.12'\n  - '0.10'\n"
  },
  {
    "path": ".verb.md",
    "content": "## Usage\n\n```js\nvar randomize = require('{%= name %}');\n```\n\n## API\n\n```js\nrandomize(pattern, length, options);\nrandomize.isCrypto;\n```\n\n- `pattern` **{String}**: (required) The pattern to use for randomizing\n- `length` **{Number}**: (optional) The length of the string to generate\n- `options` **{Object}**: (optional) See available [options](#options)\n\n- `randomize.isCrypto` will be `true` when a cryptographically secure function is being used to generate random numbers. The value will be `false` when the function in use is `Math.random`.\n\n### pattern\n\n> The pattern to use for randomizing\n\nPatterns can contain any combination of the below characters, specified in any order.\n\n**Example:**\n\nTo generate a 10-character randomized string using all available characters:\n\n```js\nrandomize('*', 10);\n//=> 'x2_^-5_T[$'\n\nrandomize('Aa0!', 10);\n//=> 'LV3u~BSGhw'\n```\n\n* `a`: Lowercase alpha characters (`abcdefghijklmnopqrstuvwxyz'`)\n* `A`: Uppercase alpha characters (`ABCDEFGHIJKLMNOPQRSTUVWXYZ'`)\n* `0`: Numeric characters (`0123456789'`)\n* `!`: Special characters (`~!@#$%^&()_+-={}[];\\',.`)\n* `*`: All characters (all of the above combined)\n* `?`: Custom characters (pass a string of custom characters to the options)\n\n\n### length\n\n> The length of the string to generate\n\n**Examples:**\n\n* `randomize('A', 5)` will generate a 5-character, uppercase, alphabetical, randomized string, e.g. `KDJWJ`.\n* `randomize('0', 2)` will generate a 2-digit random number\n* `randomize('0', 3)` will generate a 3-digit random number\n* `randomize('0', 12)` will generate a 12-digit random number\n* `randomize('A0', 16)` will generate a 16-character, alpha-numeric randomized string\n\nIf `length` is left undefined, the length of the pattern in the first parameter will be used. For example:\n\n* `randomize('00')` will generate a 2-digit random number\n* `randomize('000')` will generate a 3-digit random number\n* `randomize('0000')` will generate a 4-digit random number...\n* `randomize('AAAAA')` will generate a 5-character, uppercase alphabetical random string...\n\nThese are just examples, [see the tests](./test.js) for more use cases and examples.\n\n\n\n## options\n\n> These are options that can be passed as the third argument.\n\n#### chars\nType: `String`\n\nDefault: `undefined`\n\nDefine a custom string to be randomized.\n\n**Example:**\n\n* `randomize('?', 20, {chars: 'jonschlinkert'})` will generate a 20-character randomized string from the letters contained in `jonschlinkert`.\n* `randomize('?', {chars: 'jonschlinkert'})` will generate a 13-character randomized string from the letters contained in `jonschlinkert`.\n\n#### exclude\nType: `String|Array`\n\nDefault: `undefined`\n\nSpecify a string or array of characters can are excluded from the possible characters used to generate the randomized string.\n\n**Example:**\n\n* `randomize('*', 20, { exclude: '0oOiIlL1' })` will generate a 20-character randomized string using all of possible characters except for `0oOiIlL1`.\n\n## Usage Examples\n\n* `randomize('A', 4)` (_whitespace insenstive_) would result in randomized 4-digit uppercase letters, like, `ZAKH`, `UJSL`... etc.\n* `randomize('AAAA')` is equivelant to `randomize('A', 4)`\n* `randomize('AAA0')` and `randomize('AA00')` and `randomize('A0A0')` are equivelant to `randomize('A0', 4)`\n* `randomize('aa')`: results in double-digit, randomized, lower-case letters (`abcdefghijklmnopqrstuvwxyz`)\n* `randomize('AAA')`: results in triple-digit, randomized, upper-case letters (`ABCDEFGHIJKLMNOPQRSTUVWXYZ`)\n* `randomize('0', 6)`: results in six-digit, randomized numbers (`0123456789`)\n* `randomize('!', 5)`: results in single-digit randomized, _valid_ non-letter characters (`~!@#$%^&()_+-={}[];\\',.`)\n* `randomize('A!a0', 9)`: results in nine-digit, randomized characters (any of the above)\n\n_The order in which the characters are defined is insignificant._\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2013-2017, Jon Schlinkert.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# randomatic [![NPM version](https://img.shields.io/npm/v/randomatic.svg?style=flat)](https://www.npmjs.com/package/randomatic) [![NPM monthly downloads](https://img.shields.io/npm/dm/randomatic.svg?style=flat)](https://npmjs.org/package/randomatic) [![NPM total downloads](https://img.shields.io/npm/dt/randomatic.svg?style=flat)](https://npmjs.org/package/randomatic) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/randomatic.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/randomatic)\n\n> Generate randomized strings of a specified length using simple character sequences. The original generate-password.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save randomatic\n```\n\n## Usage\n\n```js\nvar randomize = require('randomatic');\n```\n\n## API\n\n```js\nrandomize(pattern, length, options);\nrandomize.isCrypto;\n```\n\n* `pattern` **{String}**: (required) The pattern to use for randomizing\n* `length` **{Number}**: (optional) The length of the string to generate\n* `options` **{Object}**: (optional) See available [options](#options)\n* `randomize.isCrypto` will be `true` when a cryptographically secure function is being used to generate random numbers. The value will be `false` when the function in use is `Math.random`.\n\n### pattern\n\n> The pattern to use for randomizing\n\nPatterns can contain any combination of the below characters, specified in any order.\n\n**Example:**\n\nTo generate a 10-character randomized string using all available characters:\n\n```js\nrandomize('*', 10);\n//=> 'x2_^-5_T[$'\n\nrandomize('Aa0!', 10);\n//=> 'LV3u~BSGhw'\n```\n\n* `a`: Lowercase alpha characters (`abcdefghijklmnopqrstuvwxyz'`)\n* `A`: Uppercase alpha characters (`ABCDEFGHIJKLMNOPQRSTUVWXYZ'`)\n* `0`: Numeric characters (`0123456789'`)\n* `!`: Special characters (`~!@#$%^&()_+-={}[];\\',.`)\n* `*`: All characters (all of the above combined)\n* `?`: Custom characters (pass a string of custom characters to the options)\n\n### length\n\n> The length of the string to generate\n\n**Examples:**\n\n* `randomize('A', 5)` will generate a 5-character, uppercase, alphabetical, randomized string, e.g. `KDJWJ`.\n* `randomize('0', 2)` will generate a 2-digit random number\n* `randomize('0', 3)` will generate a 3-digit random number\n* `randomize('0', 12)` will generate a 12-digit random number\n* `randomize('A0', 16)` will generate a 16-character, alpha-numeric randomized string\n\nIf `length` is left undefined, the length of the pattern in the first parameter will be used. For example:\n\n* `randomize('00')` will generate a 2-digit random number\n* `randomize('000')` will generate a 3-digit random number\n* `randomize('0000')` will generate a 4-digit random number...\n* `randomize('AAAAA')` will generate a 5-character, uppercase alphabetical random string...\n\nThese are just examples, [see the tests](./test.js) for more use cases and examples.\n\n## options\n\n> These are options that can be passed as the third argument.\n\n#### chars\n\nType: `String`\n\nDefault: `undefined`\n\nDefine a custom string to be randomized.\n\n**Example:**\n\n* `randomize('?', 20, {chars: 'jonschlinkert'})` will generate a 20-character randomized string from the letters contained in `jonschlinkert`.\n* `randomize('?', {chars: 'jonschlinkert'})` will generate a 13-character randomized string from the letters contained in `jonschlinkert`.\n\n#### exclude\n\nType: `String|Array`\n\nDefault: `undefined`\n\nSpecify a string or array of characters can are excluded from the possible characters used to generate the randomized string.\n\n**Example:**\n\n* `randomize('*', 20, { exclude: '0oOiIlL1' })` will generate a 20-character randomized string using all of possible characters except for `0oOiIlL1`.\n\n## Usage Examples\n\n* `randomize('A', 4)` (_whitespace insensitive_) would result in randomized 4-digit uppercase letters, like, `ZAKH`, `UJSL`... etc.\n* `randomize('AAAA')` is equivalent to `randomize('A', 4)`\n* `randomize('AAA0')` and `randomize('AA00')` and `randomize('A0A0')` are equivalent to `randomize('A0', 4)`\n* `randomize('aa')`: results in double-digit, randomized, lower-case letters (`abcdefghijklmnopqrstuvwxyz`)\n* `randomize('AAA')`: results in triple-digit, randomized, upper-case letters (`ABCDEFGHIJKLMNOPQRSTUVWXYZ`)\n* `randomize('0', 6)`: results in six-digit, randomized numbers (`0123456789`)\n* `randomize('!', 5)`: results in single-digit randomized, _valid_ non-letter characters (`~!@#$%^&()_+-={}[]\n* `randomize('A!a0', 9)`: results in nine-digit, randomized characters (any of the above)\n\n_The order in which the characters are defined is insignificant._\n\n## About\n\n<details>\n<summary><strong>Contributing</strong></summary>\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n</details>\n\n<details>\n<summary><strong>Running Tests</strong></summary>\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n</details>\n\n<details>\n<summary><strong>Building docs</strong></summary>\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n</details>\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [pad-left](https://www.npmjs.com/package/pad-left): Left pad a string with zeros or a specified string. Fastest implementation. | [homepage](https://github.com/jonschlinkert/pad-left \"Left pad a string with zeros or a specified string. Fastest implementation.\")\n* [pad-right](https://www.npmjs.com/package/pad-right): Right pad a string with zeros or a specified string. Fastest implementation. | [homepage](https://github.com/jonschlinkert/pad-right \"Right pad a string with zeros or a specified string. Fastest implementation.\")\n* [repeat-string](https://www.npmjs.com/package/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string. | [homepage](https://github.com/jonschlinkert/repeat-string \"Repeat the given string n times. Fastest implementation for repeating a string.\")\n\n### Contributors\n\n| **Commits** | **Contributor** |  \n| --- | --- |  \n| 56 | [jonschlinkert](https://github.com/jonschlinkert) |  \n| 6  | [doowb](https://github.com/doowb) |  \n| 4  | [kivlor](https://github.com/kivlor) |  \n| 2  | [realityking](https://github.com/realityking) |  \n| 2  | [ywpark1](https://github.com/ywpark1) |  \n| 1  | [TrySound](https://github.com/TrySound) |  \n| 1  | [drag0s](https://github.com/drag0s) |  \n| 1  | [paulmillr](https://github.com/paulmillr) |  \n| 1  | [sunknudsen](https://github.com/sunknudsen) |  \n| 1  | [faizulhaque-tp](https://github.com/faizulhaque-tp) |  \n| 1  | [michaelrhodes](https://github.com/michaelrhodes) |  \n\n### Author\n\n**Jon Schlinkert**\n\n* [GitHub Profile](https://github.com/jonschlinkert)\n* [Twitter Profile](https://twitter.com/jonschlinkert)\n* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)\n\n### License\n\nCopyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on October 23, 2018._\n"
  },
  {
    "path": "benchmark/.gitignore",
    "content": "*.DS_Store\n"
  },
  {
    "path": "benchmark/check.js",
    "content": "'use strict';\n\nvar bold = require('ansi-bold');\nvar path = require('path');\nvar glob = require('glob');\n\n/**\n * Sanity check. Run to ensure that all fns return the same result.\n */\n\nvar fixtures = glob.sync(__dirname + '/fixtures/*.js');\n\nglob.sync(__dirname + '/code/*.js').forEach(function (fp) {\n  if (/\\.js/.test(fp)) {\n    var fn = require(path.resolve(__dirname, 'code', fp));\n    var name = path.basename(fp, path.extname(fp));\n    if (/.*/.test(name)) {\n\n      fixtures.forEach(function (fixture) {\n        if (/^.*\\.js/.test(path.basename(fixture))) {\n          console.log(bold(name) + ':', fn.apply(fn, require(fixture)));\n        }\n      });\n    }\n  }\n});\n"
  },
  {
    "path": "benchmark/code/current.js",
    "content": "'use strict';\n\nmodule.exports = require('../..');\n"
  },
  {
    "path": "benchmark/code/for.js",
    "content": "/*!\n * randomatic <https://github.com/jonschlinkert/randomatic>\n *\n * Copyright (c) 2014-2015, Jon Schlinkert.\n * Licensed under the MIT License (MIT)\n *\n * Many changes have been made, but this was originally\n * inspired by <http://stackoverflow.com/a/10727155/1267639>\n */\n\n'use strict';\n\nvar isNumber = require('is-number');\nvar typeOf = require('kind-of');\n\n/**\n * Expose `randomatic`\n */\n\nmodule.exports = randomatic;\n\n/**\n * Available mask characters\n */\n\nvar type = {\n  lower: 'abcdefghijklmnopqrstuvwxyz',\n  upper: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',\n  number: '0123456789',\n  special: '~!@#$%^&()_+-={}[];\\',.'\n};\n\ntype.all = type.lower + type.upper + type.number;\n\n/**\n * Generate random character sequences of a specified `length`,\n * based on the given `pattern`.\n *\n * @param {String} `pattern` The pattern to use for generating the random string.\n * @param {String} `length` The length of the string to generate.\n * @param {String} `options`\n * @return {String}\n * @api public\n */\n\nfunction randomatic(pattern, length, options) {\n  if (typeof pattern === 'undefined') {\n    throw new Error('randomatic expects a string or number.');\n  }\n\n  var custom = false;\n  if (arguments.length === 1) {\n    if (typeof pattern === 'string') {\n      length = pattern.length;\n\n    } else if (isNumber(pattern)) {\n      options = {};\n      length = pattern;\n      pattern = '*';\n    }\n  }\n\n  if(typeOf(length) === 'object' && length.hasOwnProperty('chars')) {\n    options = length;\n    pattern = options.chars;\n    length = pattern.length;\n    custom = true;\n  }\n\n  var opts = options || {};\n  var mask = '';\n  var res = '';\n\n  // Characters to be used\n  if (pattern.indexOf('?') !== -1) mask += opts.chars;\n  if (pattern.indexOf('a') !== -1) mask += type.lower;\n  if (pattern.indexOf('A') !== -1) mask += type.upper;\n  if (pattern.indexOf('0') !== -1) mask += type.number;\n  if (pattern.indexOf('!') !== -1) mask += type.special;\n  if (pattern.indexOf('*') !== -1) mask += type.all;\n  if (custom) mask += pattern;\n\n  for (var i = 0; i < length; i++) {\n    res += mask.charAt(parseInt(Math.random() * mask.length));\n  }\n\n  return res;\n};\n"
  },
  {
    "path": "benchmark/fixtures/10.js",
    "content": "module.exports = ['*', 10];\n"
  },
  {
    "path": "benchmark/fixtures/25-alpha-num.js",
    "content": "module.exports = ['0aA', 25];\n"
  },
  {
    "path": "benchmark/fixtures/25.js",
    "content": "module.exports = ['*', 25];\n"
  },
  {
    "path": "benchmark/fixtures/3.js",
    "content": "module.exports = ['*', 3];\n"
  },
  {
    "path": "benchmark/fixtures/5.js",
    "content": "module.exports = ['*', 5];\n"
  },
  {
    "path": "benchmark/fixtures/A-12.js",
    "content": "module.exports = ['A', 12];\n"
  },
  {
    "path": "benchmark/index.js",
    "content": "'use strict';\n\nvar Suite = require('benchmarked');\n\nvar suite = new Suite({\n  result: false,\n  fixtures: 'fixtures/*.js',\n  add: 'code/*.js',\n  cwd: __dirname\n});\n\nsuite.run();\n"
  },
  {
    "path": "benchmark/last.md",
    "content": "# 20,000x\n  repeat-string.js x 16,619,408 ops/sec ±1.05% (92 runs sampled)\n  repeating.js x 5,991,724 ops/sec ±0.62% (98 runs sampled)\n\n# 2,000x\n  repeat-string.js x 17,284,768 ops/sec ±0.71% (94 runs sampled)\n  repeating.js x 6,828,993 ops/sec ±0.87% (96 runs sampled)\n\n# 250x\n  repeat-string.js x 16,241,986 ops/sec ±0.78% (93 runs sampled)\n  repeating.js x 7,281,492 ops/sec ±0.76% (95 runs sampled)\n\n# 50x\n  repeat-string.js x 16,447,301 ops/sec ±1.12% (96 runs sampled)\n  repeating.js x 8,933,633 ops/sec ±0.64% (98 runs sampled)\n\n# 5x\n  repeat-string.js x 16,363,515 ops/sec ±1.09% (98 runs sampled)\n  repeating.js x 12,164,964 ops/sec ±0.74% (98 runs sampled)"
  },
  {
    "path": "bower.json",
    "content": "{\n  \"name\": \"randomatic\",\n  \"description\": \"Generate randomized strings of a specified length using simple character sequences. The original generate-password.\",\n  \"repository\": \"jonschlinkert/randomatic\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/jonschlinkert/randomatic\",\n  \"authors\": [\n    \"Jon Schlinkert (https://github.com/jonschlinkert)\"\n  ],\n  \"main\": [\n    \"index.js\"\n  ],\n  \"dependencies\": {\n    \"is-number\": \"^4.0.0\",\n    \"kind-of\": \"^6.0.0\",\n    \"math-random\": \"^1.0.1\"\n  },\n  \"devDependencies\": {\n    \"ansi-bold\": \"^0.1.1\",\n    \"benchmarked\": \"^1.1.1\",\n    \"glob\": \"^7.1.2\",\n    \"gulp-format-md\": \"^0.1.12\",\n    \"mocha\": \"^3.4.2\"\n  },\n  \"keywords\": [\n    \"alpha\",\n    \"alpha-numeric\",\n    \"alphanumeric\",\n    \"characters\",\n    \"chars\",\n    \"generate\",\n    \"generate-password\",\n    \"numeric\",\n    \"password\",\n    \"rand\",\n    \"random\",\n    \"randomatic\",\n    \"randomize\",\n    \"randomized\"\n  ],\n  \"version\": \"2.0.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/jonschlinkert/randomatic/issues\"\n  },\n  \"files\": [\n    \"index.js\"\n  ],\n  \"ignore\": [\n    \"actual\",\n    \"bower_components\",\n    \"fixtures\",\n    \"node_modules\",\n    \"temp\",\n    \"test\",\n    \"test.js\",\n    \"tmp\"\n  ],\n  \"contributors\": [\n    \"Bogdan Chadkin (https://github.com/TrySound)\",\n    \"Dragos Fotescu (http://dragosfotescu.com)\",\n    \"Faiz ul haque (http://www.10pearls.com)\",\n    \"Jon Schlinkert (http://twitter.com/jonschlinkert)\",\n    \"Paul Miller (paulmillr.com)\",\n    \"Rouven Weßling (www.rouvenwessling.de)\",\n    \"Sun Knudsen (https://sunknudsen.com)\"\n  ]\n}"
  },
  {
    "path": "examples.js",
    "content": "'use strict';\n\nvar rand = require('./');\n\n\n// Example replacement patterns.\nvar replacements = [{\n  pattern: /:random\\(([^)]*)\\)/,\n  replacement: function (match, args) {\n    if(args.match(/,/)) {\n      args = parse(args.split(','));\n      // console.log(args)\n      return rand.apply(rand, args);\n    } else {\n      return rand(args);\n    }\n  }\n}];\n\n\nfunction randomize(patterns, arr) {\n  var keys = Object.keys(patterns);\n  return keys.reduce(function(res, str) {\n    var desc = patterns[str];\n\n    var result = arr.reduce(function(acc, o) {\n      return acc.replace(o.pattern, o.replacement);\n    }, str);\n\n    res[desc] = {};\n    res[desc].result = result;\n    res[desc].length = result.length;\n    return res;\n  }, {});\n}\n\nvar patterns = {\n  // Pattern           // Should result in...\n  ':random(A, 10)'     : 'alpha, (10 digits)',\n  ':random(A, 5)'      : 'alpha, (5 digits)',\n  ':random(7, {chars: \"foo\\'s\"})' : 'special chars, (7 digits)',\n  ':random(AA, 10)'    : 'alpha, (10 digits)',\n  ':random(Aa, 12)'    : 'alpha, (12 digits)',\n  ':random(A, 3)'      : 'alpha, (3 digits)',\n  ':random(AAa)'       : 'alpha, (3 digits)',\n  ':random(AA, 3)'     : 'alpha, (3 digits)',\n  ':random(A0, 5)'     : 'alpha-numeric, (5 digits)',\n  ':random(AA00, 5)'   : 'alpha-numeric, (5 digits)',\n  ':random(A0A0, 5)'   : 'alpha-numeric, (5 digits)',\n  ':random(AaAa0000)'  : 'alpha-numeric, (8 digits)',\n  ':random(0, 1)'      : 'numeric, (1 digit)',\n  ':random(0, 8)'      : 'numeric, (8 digits)',\n  ':random(00000000)'  : 'numeric, (8 digits)',\n  ':random(A0!, 7)'    : 'special chars, (7 digits)',\n  ':random(A0!a0A0)'   : 'special chars, (7 digits)',\n  ':random(Aa0, 1)'    : 'alpha, (1 digit)',\n  ':random(*, 16)'     : 'all characters, (16 digits)',\n  ':random(?, 16, jonathan)' : 'custom chars, (16 digit)'\n};\n\nconsole.log(randomize(patterns, replacements));\n\nfunction parse(args) {\n  return args.map(function(arg) {\n    if (/\\{/.test(arg)) {\n      var start = /(['\"])/;\n      var i = arg.search(start);\n      var ch = arg[i];\n      var match;\n      var chars = '';\n\n      while ((match = arg.charAt(++i)) !== ch) {\n        chars += match;\n      }\n      console.log(chars);\n\n      return {chars: chars};\n    }\n    return arg;\n  });\n}\n\nconsole.log();\nconsole.log(rand('*', 20, { exclude: '0oOiIlL1' }));\nconsole.log();\n\n// function parse(args) {\n//   return args.map(function(arg) {\n//     if (/\\{/.test(arg)) {\n//       var match = /['\"]([^\"']+)[\"']/.exec(arg);\n//       if (match) {\n//         return {chars: match[1]};\n//       }\n//     }\n//     return arg;\n//   });\n// }\n\n"
  },
  {
    "path": "index.d.ts",
    "content": "// Type definitions for randomatic 3.1\n// Project: https://github.com/jonschlinkert/randomatic\n// Definitions by: Sang Dang <https://github.com/sangdth>\n\ninterface Options {\n  chars?: string;\n  exclude?: string | string[];\n}\n\ndeclare function randomatic(pattern: string, length?: number, options?: Options): string;\n\ndeclare namespace randomatic {\n  const isCrypto: boolean;\n}\n\nexport = randomatic;\n"
  },
  {
    "path": "index.js",
    "content": "/*!\n * randomatic <https://github.com/jonschlinkert/randomatic>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\n'use strict';\n\nvar isNumber = require('is-number');\nvar typeOf = require('kind-of');\nvar mathRandom = require('math-random');\n\n/**\n * Expose `randomatic`\n */\n\nmodule.exports = randomatic;\nmodule.exports.isCrypto = !!mathRandom.cryptographic;\n\n/**\n * Available mask characters\n */\n\nvar type = {\n  lower: 'abcdefghijklmnopqrstuvwxyz',\n  upper: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',\n  number: '0123456789',\n  special: '~!@#$%^&()_+-={}[];\\',.'\n};\n\ntype.all = type.lower + type.upper + type.number + type.special;\n\n/**\n * Generate random character sequences of a specified `length`,\n * based on the given `pattern`.\n *\n * @param {String} `pattern` The pattern to use for generating the random string.\n * @param {String} `length` The length of the string to generate.\n * @param {String} `options`\n * @return {String}\n * @api public\n */\n\nfunction randomatic(pattern, length, options) {\n  if (typeof pattern === 'undefined') {\n    throw new Error('randomatic expects a string or number.');\n  }\n\n  var custom = false;\n  if (arguments.length === 1) {\n    if (typeof pattern === 'string') {\n      length = pattern.length;\n\n    } else if (isNumber(pattern)) {\n      options = {};\n      length = pattern;\n      pattern = '*';\n    }\n  }\n\n  if (typeOf(length) === 'object' && length.hasOwnProperty('chars')) {\n    options = length;\n    pattern = options.chars;\n    length = pattern.length;\n    custom = true;\n  }\n\n  var opts = options || {};\n  var mask = '';\n  var res = '';\n\n  // Characters to be used\n  if (pattern.indexOf('?') !== -1) mask += opts.chars;\n  if (pattern.indexOf('a') !== -1) mask += type.lower;\n  if (pattern.indexOf('A') !== -1) mask += type.upper;\n  if (pattern.indexOf('0') !== -1) mask += type.number;\n  if (pattern.indexOf('!') !== -1) mask += type.special;\n  if (pattern.indexOf('*') !== -1) mask += type.all;\n  if (custom) mask += pattern;\n\n  // Characters to exclude\n  if (opts.exclude) {\n    var exclude = typeOf(opts.exclude) === 'string' ? opts.exclude : opts.exclude.join('');\n    exclude = exclude.replace(new RegExp('[\\\\]]+', 'g'), '');\n    mask = mask.replace(new RegExp('[' + exclude + ']+', 'g'), '');\n    \n    if(opts.exclude.indexOf(']') !== -1) mask = mask.replace(new RegExp('[\\\\]]+', 'g'), '');\n  }\n\n  while (length--) {\n    res += mask.charAt(parseInt(mathRandom() * mask.length, 10));\n  }\n  return res;\n};\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"randomatic\",\n  \"description\": \"Generate randomized strings of a specified length using simple character sequences. The original generate-password.\",\n  \"version\": \"3.1.1\",\n  \"homepage\": \"https://github.com/jonschlinkert/randomatic\",\n  \"author\": \"Jon Schlinkert (https://github.com/jonschlinkert)\",\n  \"contributors\": [\n    \"Bogdan Chadkin (https://github.com/TrySound)\",\n    \"Dragos Fotescu (http://dragosfotescu.com)\",\n    \"Faiz ul haque (http://www.10pearls.com)\",\n    \"Jon Schlinkert (http://twitter.com/jonschlinkert)\",\n    \"Michael Rhodes (http://michaelrhod.es)\",\n    \"Paul Miller (https://paulmillr.com)\",\n    \"Rouven Weßling (www.rouvenwessling.de)\",\n    \"Sun Knudsen (https://sunknudsen.com)\"\n  ],\n  \"repository\": \"jonschlinkert/randomatic\",\n  \"bugs\": {\n    \"url\": \"https://github.com/jonschlinkert/randomatic/issues\"\n  },\n  \"license\": \"MIT\",\n  \"files\": [\n    \"index.js\"\n  ],\n  \"main\": \"index.js\",\n  \"engines\": {\n    \"node\": \">= 0.10.0\"\n  },\n  \"scripts\": {\n    \"test\": \"mocha\"\n  },\n  \"dependencies\": {\n    \"is-number\": \"^4.0.0\",\n    \"kind-of\": \"^6.0.0\",\n    \"math-random\": \"^1.0.1\"\n  },\n  \"devDependencies\": {\n    \"@typescript-eslint/eslint-plugin\": \"^1.11.0\",\n    \"@typescript-eslint/parser\": \"^1.11.0\",\n    \"ansi-bold\": \"^0.1.1\",\n    \"benchmarked\": \"^1.1.1\",\n    \"glob\": \"^7.1.2\",\n    \"gulp-format-md\": \"^0.1.12\",\n    \"mocha\": \"^3.4.2\"\n  },\n  \"keywords\": [\n    \"alpha\",\n    \"alpha-numeric\",\n    \"alphanumeric\",\n    \"characters\",\n    \"chars\",\n    \"generate\",\n    \"generate-password\",\n    \"numeric\",\n    \"password\",\n    \"rand\",\n    \"random\",\n    \"randomatic\",\n    \"randomize\",\n    \"randomized\"\n  ],\n  \"verb\": {\n    \"toc\": false,\n    \"layout\": \"default\",\n    \"tasks\": [\n      \"readme\"\n    ],\n    \"plugins\": [\n      \"gulp-format-md\"\n    ],\n    \"related\": {\n      \"list\": [\n        \"pad-left\",\n        \"pad-right\",\n        \"repeat-string\"\n      ]\n    },\n    \"lint\": {\n      \"reflinks\": true\n    }\n  }\n}\n"
  },
  {
    "path": "test.js",
    "content": "/**\n * randomatic <https://github.com/jonschlinkert/randomatic>\n *\n * Copyright (c) 2014-2015, Jon Schlinkert.\n * Licensed under the MIT license.\n */\n\n'use strict';\n\nrequire('mocha');\nvar assert = require('assert');\nvar randomize = require('./');\n\nfunction test(re, str) {\n  return re.test(str);\n}\n\ndescribe('randomatic', function() {\n  it('should export an isCrypto boolean property', function() {\n    assert.equal(typeof randomize.isCrypto, 'boolean');\n  });\n\n  it('should throw an error when no arguments are passed:', function() {\n    assert.throws(function() {\n      randomize();\n    }, /randomatic expects a string or number\\./);\n  });\n\n  it('should generate a randomized string of the given length:', function() {\n    assert.equal(randomize(12).length, 12);\n    assert.equal(typeof randomize(5), 'string');\n  });\n\n  it('should generate a string with a length equal to the number passed as a second parameter', function() {\n    var actual = randomize('A', 12);\n    assert.equal(actual.length, 12);\n    assert(test(/[A-Z]{12}/, actual));\n  });\n\n  it('should generate a 12-character string, lowercase', function() {\n    var actual = randomize('a', 12);\n    assert(test(/[a-z]{12}/, actual));\n    assert.equal(actual.length, 12);\n  });\n\n  it('should generate 12-characters of ordered numbers', function() {\n    var actual = randomize('0', 12);\n    assert(test(/[\\d]{12}/, actual));\n    assert(!test(/[\\d]{13}/, actual));\n    assert.equal(actual.length, 12);\n  });\n\n  it('should generate a randomized 12-character string, uppercase and numbers', function() {\n    var actual = randomize('A0', 12);\n    assert(test(/[\\dA-Z]{12}/, actual));\n    assert(!test(/[\\dA-Z]{13}/, actual));\n    assert.equal(actual.length, 12);\n  });\n\n  it('should generate a 3-character string, all uppercase letters', function() {\n    assert(test(/[A-Z]{3}/, randomize('AAA')));\n    assert(!test(/[a-z]{3}/, randomize('AAA')));\n    assert.equal(randomize('AAA').length, 3);\n\n    assert(test(/[A-Z]{3}/, randomize('AAAAA', 3)));\n    assert(!test(/[a-z]{3}/, randomize('AAAAA', 3)));\n    assert.equal(randomize('AAAAA', 3).length, 3);\n  });\n\n  it('should generate an 12-character string of random uppercase and lowercase letters, and numbers', function() {\n    var actual = randomize('Aa0', 12);\n    assert.equal(actual.length, 12);\n    assert(test(/[\\dA-Za-z]{3}/, actual));\n  });\n\n  it('should generate an 3-character, random alpha-numeric string', function() {\n    var actual = randomize('Aa0');\n    assert(test(/[\\dA-Za-z]{3}/, actual));\n    assert.equal(actual.length, 3);\n  });\n\n  it('should generate 3-characters of numbers in order', function() {\n    var actual = randomize('000');\n    assert(test(/\\d{3}/, actual));\n    assert.equal(actual.length, 3);\n  });\n\n  it('should randomize a string from the characters on the `chars` option', function() {\n    var actual = randomize('?', {chars: 'jonschlinkert'});\n    assert(test(/[jonschlinkert]{13}/, actual));\n    assert.equal(actual.length, 13);\n  });\n\n  it('should generate a random string excluding characters on the `exclude` option', function() {\n    var actual = randomize('?', 16, {chars: 'jonschlinkert', exclude: '0Oo'});\n    assert(test(/[^oO0]{16}/, actual));\n    assert.equal(actual.length, 16);\n  });\n\n  it('should generate a random string excluding array of characters on the `exclude` option', function() {\n    var actual = randomize('?', 16, {chars: 'jonschlinkert', exclude: ['0','O','o']});\n    assert(test(/[^oO0]{16}/, actual));\n    assert.equal(actual.length, 16);\n  });\n\n  it('should generate a random string excluding right square bracket on the `exclude` option', function() {\n    var actual = randomize('*', 16, {exclude: ']'});\n    assert(test(/[^\\]]{16}/, actual));\n    assert.equal(actual.length, 16);\n  });\n\n  it('should generate a random string excluding array with one element(right square bracket) on the `exclude` option', function() {\n    var actual = randomize('*', 16, {exclude: [']']});\n    assert(test(/[^\\]]{16}/, actual));\n    assert.equal(actual.length, 16);\n  });\n\n  it('should generate a radomized 16-character string', function() {\n    assert.equal(randomize('*', 16).length, 16);\n  });\n\n  it('should generate Alpha (Upper/Lower), Numeric, Special Char 16-character string', function() {\n    var actual = randomize('*');\n    assert(test(/^[-~!@#$%^&()_+={}[\\];\\',.a-zA-Z0-9]$/, actual));\n  });\n\n  it('alphabetical, 10 digit:', function() {\n    assert.equal(randomize('A', 10).length, 10);\n  });\n\n  it('alphabetical, 5 digits:', function() {\n    var actual = randomize('A', 5);\n    assert(test(/[A-Z]{5}/, actual));\n    assert.equal(actual.length, 5);\n  });\n\n  it('alphabetical, 10 digits:', function() {\n    var actual = randomize('AA', 10);\n    assert(test(/[A-Z]{10}/, actual));\n    assert.equal(actual.length, 10);\n  });\n\n  it('alphabetical, 12 digits:', function() {\n    var actual = randomize('Aa', 12);\n    assert.equal(actual.length, 12);\n  });\n\n  it('alphabetical, 3 digits:', function() {\n    var actual = randomize('A', 3);\n    assert(test(/[A-Z]{3}/, actual));\n    assert.equal(actual.length, 3);\n  });\n\n  it('alphabetical, 3 digits:', function() {\n    var actual = randomize('AAa');\n    assert(test(/[A-Za-z]{3}/, actual));\n    assert.equal(actual.length, 3);\n  });\n\n  it('alphabetical, 3 digits:', function() {\n    var actual = randomize('AA', 3);\n    assert(test(/[A-Z]{3}/, actual));\n    assert.equal(actual.length, 3);\n  });\n\n  it('alphabetical, 3 digits:', function() {\n    var actual = randomize('AA');\n    assert(test(/[A-Z]{2}/, actual));\n    assert.equal(actual.length, 2);\n  });\n\n  it('alpha-numeric, 5 digits:', function() {\n    var actual = randomize('A0', 5);\n    assert(test(/[A-Z\\d]{5}/, actual));\n    assert.equal(actual.length, 5);\n  });\n\n  it('alpha-numeric, 5 digits:', function() {\n    var actual = randomize('AA00', 5);\n    assert(test(/[A-Z\\d]{5}/, actual));\n    assert.equal(actual.length, 5);\n  });\n\n  it('alpha-numeric, 5 digits:', function() {\n    var actual = randomize('A0A0', 5);\n    assert(test(/[A-Z\\d]{5}/, actual));\n    assert.equal(actual.length, 5);\n  });\n\n  it('alpha-numeric, 5 digits:', function() {\n    var actual = randomize('A0A0A0A0A0A', 5);\n    assert(test(/[A-Z\\d]{5}/, actual));\n    assert.equal(actual.length, 5);\n  });\n\n  it('alpha-numeric, 8 digits:', function() {\n    var actual = randomize('AaAa0000');\n    assert(test(/[A-Za-z0-9]{8}/, actual));\n    assert.equal(actual.length, 8);\n  });\n\n  it('numeric, 1 digit:\\t', function() {\n    var actual = randomize('0', 1);\n    assert(test(/\\d{1}/, actual));\n    assert.equal(actual.length, 1);\n  });\n\n  it('numeric, 8 digits:\\t', function() {\n    var actual = randomize('0', 8);\n    assert(test(/^\\d{8}/, actual));\n    assert.equal(actual.length, 8);\n  });\n\n  it('numeric, 8 digits:\\t', function() {\n    var actual = randomize('00000000');\n    assert(test(/^\\d{8}/, actual));\n    assert.equal(actual.length, 8);\n  });\n\n  it('special chars, 7 digits:', function() {\n    var actual = randomize('A0!', 7);\n    assert(test(/[\\s\\S]{7}/, actual));\n    assert.equal(actual.length, 7);\n  });\n\n  it('special chars, 7 digits:', function() {\n    var actual = randomize('A0!a0A0');\n    assert(test(/[\\s\\S]{7}/, actual));\n    assert(!test(/[\\s\\S]{8}/, actual));\n    assert.equal(actual.length, 7);\n  });\n\n  it('alphabetical, 1 digit:', function() {\n    var actual = randomize('Aa0');\n    assert(test(/[A-Za-z0-9]{3}/, actual));\n    assert.equal(actual.length, 3);\n  });\n\n  it('all characters, 16 digits:', function() {\n    assert.equal(randomize('*', 16).length, 16);\n  });\n\n  it('custom chars, 16 digit', function() {\n    var actual = randomize('?', 16, {chars: 'jonathan'});\n    assert(test(/[jonathan]/, actual));\n    assert.equal(actual.length, 16);\n  });\n});\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"allowJs\": true,\n    \"declaration\": true,\n    \"emitDeclarationOnly\": true,\n    \"module\": \"commonjs\",\n    \"declarationMap\": true,\n    \"rootDir\": \".\",\n    \"target\": \"es2017\"\n  },\n  \"include\": [\n    \"index.js\"\n  ]\n}\n"
  }
]