{"_id":"filled-array","_rev":"2187285","name":"filled-array","description":"Returns an array filled with the specified input","dist-tags":{"latest":"2.1.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2022-01-05T18:56:18.000Z","created":"2015-11-04T12:33:12.228Z","2.1.0":"2022-01-05T18:54:55.070Z","2.0.0":"2021-04-15T05:57:49.399Z","1.1.0":"2015-11-07T08:28:24.342Z","1.0.2":"2015-11-04T13:38:36.642Z","1.0.1":"2015-11-04T12:48:31.297Z","1.0.0":"2015-11-04T12:33:12.228Z"},"users":{"rocket0191":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/filled-array.git"},"versions":{"2.1.0":{"name":"filled-array","version":"2.1.0","description":"Returns an array filled with the specified input","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/filled-array.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava"},"keywords":["array","elements","filled","repeat","repeating","string","text","fill"],"devDependencies":{"ava":"^4.0.0","xo":"^0.47.0"},"gitHead":"3529bc985247d0f84db4080fecd8276643838d0c","bugs":{"url":"https://github.com/sindresorhus/filled-array/issues"},"homepage":"https://github.com/sindresorhus/filled-array#readme","_id":"filled-array@2.1.0","_nodeVersion":"12.22.1","_npmVersion":"8.1.0","dist":{"shasum":"d5fcb026b121cc6277cf5b62224cb4988d675ae9","size":1788,"noattachment":false,"key":"/filled-array/-/filled-array-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/filled-array/download/filled-array-2.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/filled-array_2.1.0_1641408894904_0.31965783492363475"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-01-05T18:55:01.021Z","publish_time":1641408895070,"_cnpm_publish_time":1641408895070},"2.0.0":{"name":"filled-array","version":"2.0.0","description":"Returns an array filled with the specified input","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/filled-array.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava"},"keywords":["array","elements","filled","repeat","repeating","string","text","fill"],"devDependencies":{"ava":"^3.15.0","xo":"^0.38.2"},"gitHead":"c99505eedb710f01a6ef6da3b1a29f811c63641c","bugs":{"url":"https://github.com/sindresorhus/filled-array/issues"},"homepage":"https://github.com/sindresorhus/filled-array#readme","_id":"filled-array@2.0.0","_nodeVersion":"15.12.0","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"225cf9b2c129d92074984089e925ab792ef28c6f","size":1703,"noattachment":false,"key":"/filled-array/-/filled-array-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/filled-array/download/filled-array-2.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/filled-array_2.0.0_1618466269267_0.678658679942937"},"_hasShrinkwrap":false,"publish_time":1618466269399,"_cnpm_publish_time":1618466269399},"1.1.0":{"name":"filled-array","version":"1.1.0","description":"Returns an array filled with the specified input","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/filled-array"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["array","elements","el","filled","repeat","repeating","string","str","text","fill"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"e5069f67db8683c2eac402d5062b05b2cffa5789","bugs":{"url":"https://github.com/sindresorhus/filled-array/issues"},"homepage":"https://github.com/sindresorhus/filled-array","_id":"filled-array@1.1.0","_shasum":"c3c4f6c663b923459a9aa29912d2d031f1507f84","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"c3c4f6c663b923459a9aa29912d2d031f1507f84","size":1781,"noattachment":false,"key":"/filled-array/-/filled-array-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/filled-array/download/filled-array-1.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1446884904342,"_cnpm_publish_time":1446884904342,"_hasShrinkwrap":false},"1.0.2":{"name":"filled-array","version":"1.0.2","description":"Returns an array filled with the specified input","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/filled-array"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["array","elements","el","filled","repeat","repeating","string","str","text","fill"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"8a8247a443bddd61f67a195a4bcc41361b9cac41","bugs":{"url":"https://github.com/sindresorhus/filled-array/issues"},"homepage":"https://github.com/sindresorhus/filled-array","_id":"filled-array@1.0.2","_shasum":"bfca45d43b6208108d636164f4eb5f035abe6df4","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"bfca45d43b6208108d636164f4eb5f035abe6df4","size":1476,"noattachment":false,"key":"/filled-array/-/filled-array-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/filled-array/download/filled-array-1.0.2.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1446644316642,"_cnpm_publish_time":1446644316642,"_hasShrinkwrap":false},"1.0.1":{"name":"filled-array","version":"1.0.1","description":"Returns an array filled with the specified input","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/filled-array"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["array","elements","el","filled","repeat","repeating","string","str","text","fill"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"ae55ecd6b999b2d4968165e29ecb502cd54f7f29","bugs":{"url":"https://github.com/sindresorhus/filled-array/issues"},"homepage":"https://github.com/sindresorhus/filled-array","_id":"filled-array@1.0.1","_shasum":"c737e5f4d5cdc01f6d5ab9028b7475772d2df367","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"c737e5f4d5cdc01f6d5ab9028b7475772d2df367","size":1438,"noattachment":false,"key":"/filled-array/-/filled-array-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/filled-array/download/filled-array-1.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1446641311297,"_cnpm_publish_time":1446641311297,"_hasShrinkwrap":false},"1.0.0":{"name":"filled-array","version":"1.0.0","description":"Returns an array filled with the specified input","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/filled-array"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["array","elements","el","filled","repeat","repeating","string","str","text","fill"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"40bbf90ea7d4244f2a1f5d090ad0d7cdaacedc84","bugs":{"url":"https://github.com/sindresorhus/filled-array/issues"},"homepage":"https://github.com/sindresorhus/filled-array","_id":"filled-array@1.0.0","_shasum":"ad92f9f9b2cd0bf4f8be836999a1ed95ba3a4680","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"ad92f9f9b2cd0bf4f8be836999a1ed95ba3a4680","size":1481,"noattachment":false,"key":"/filled-array/-/filled-array-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/filled-array/download/filled-array-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1446640392228,"_cnpm_publish_time":1446640392228,"_hasShrinkwrap":false}},"readme":"# filled-array\n\n> Returns an array filled with the specified input\n\n## Install\n\n```\n$ npm install filled-array\n```\n\n## Usage\n\n```js\nimport filledArray from 'filled-array';\n\nfilledArray('x', 3);\n//=> ['x', 'x', 'x']\n\nfilledArray(0, 3);\n//=> [0, 0, 0]\n\nfilledArray(index => {\n\treturn (++index % 3 ? '' : 'Fizz') + (index % 5 ? '' : 'Buzz') || index;\n}, 15);\n//=> [1, 2, 'Fizz', 4, 'Buzz', 'Fizz', 7, 8, 'Fizz', 'Buzz', 11, 'Fizz', 13, 14, 'FizzBuzz']\n```\n\n## API\n\n### filledArray(fillValue, count)\n\n#### fillValue\n\nType: `unknown`\n\nValue to fill the array with.\n\nYou can pass a function to generate the array items dynamically. The function is expected to return the value for each iteration and will be called with the following arguments: index, the count you passed in, and the filled array thus far.\n\n#### count\n\nType: `number`\n\nNumber of items to fill the array with.\n","_attachments":{},"homepage":"https://github.com/sindresorhus/filled-array#readme","bugs":{"url":"https://github.com/sindresorhus/filled-array/issues"},"license":"MIT"}