{"_id":"arr","_rev":"67664","name":"arr","description":"JavaScript utilities for arrays.","dist-tags":{"latest":"0.1.5"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T10:22:30.000Z","created":"2014-09-30T11:26:38.655Z","0.1.5":"2014-11-03T20:42:57.360Z","0.1.4":"2014-10-03T19:26:53.628Z","0.1.3":"2014-10-03T01:58:26.197Z","0.1.2":"2014-10-03T01:54:50.964Z","0.1.1":"2014-09-30T11:38:02.929Z","0.1.0":"2014-09-30T11:26:38.655Z"},"users":{},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/arr.git"},"versions":{"0.1.5":{"name":"arr","description":"JavaScript utilities for arrays.","version":"0.1.5","homepage":"https://github.com/jonschlinkert/arr","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/arr.git"},"bugs":{"url":"https://github.com/jonschlinkert/arr/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/arr/blob/master/LICENSE-MIT"}],"keywords":["array","arrays","filter","filterType","fn","functions","is","javascript","js","kind-of","last","map","match","node","node.js","numbers","obj","object","objects","sort","str","string","strings","type","type-of","typeof","util","utils","val"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"mocha":"*","should":"^4.0.4","verb":">= 0.2.6","verb-tag-jscomments":"^0.2.2"},"dependencies":{"kind-of":"^0.1.0","make-iterator":"^0.1.0"},"_id":"arr@0.1.5","_shasum":"c848643db7102330aaa363a0d3c1a5c812b09d27","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"c848643db7102330aaa363a0d3c1a5c812b09d27","size":6666,"noattachment":false,"key":"/arr/-/arr-0.1.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/arr/download/arr-0.1.5.tgz"},"directories":{},"publish_time":1415047377360,"_cnpm_publish_time":1415047377360,"_hasShrinkwrap":false},"0.1.4":{"name":"arr","description":"Simple JavaScript utilities for working with arrays.","version":"0.1.4","homepage":"https://github.com/jonschlinkert/arr","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/arr.git"},"bugs":{"url":"https://github.com/jonschlinkert/arr/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/arr/blob/master/LICENSE-MIT"}],"keywords":["array","arrays","filter","filterType","fn","functions","is","javascript","js","kind-of","last","map","match","node","node.js","numbers","obj","object","objects","sort","str","string","strings","type","type-of","typeof","util","utils","val"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"mocha":"*","should":"^4.0.4","verb":">= 0.2.6","verb-tag-jscomments":"^0.2.2"},"dependencies":{"kind-of":"^0.1.0","make-iterator":"^0.1.0"},"_id":"arr@0.1.4","_shasum":"f93a6a2de7253a430e725f9cd012213f0179635f","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"f93a6a2de7253a430e725f9cd012213f0179635f","size":5777,"noattachment":false,"key":"/arr/-/arr-0.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/arr/download/arr-0.1.4.tgz"},"directories":{},"publish_time":1412364413628,"_cnpm_publish_time":1412364413628,"_hasShrinkwrap":false},"0.1.3":{"name":"arr","description":"Simple JavaScript utilities for working with arrays.","version":"0.1.3","homepage":"https://github.com/jonschlinkert/arr","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/arr.git"},"bugs":{"url":"https://github.com/jonschlinkert/arr/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/arr/blob/master/LICENSE-MIT"}],"keywords":["array","arrays","filter","filterType","fn","functions","is","javascript","js","kind-of","last","map","match","node","node.js","numbers","obj","object","objects","sort","str","string","strings","type","type-of","typeof","util","utils","val"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"mocha":"*","should":"^4.0.4","verb":">= 0.2.6","verb-tag-jscomments":"^0.2.2"},"dependencies":{"kind-of":"^0.1.0","make-iterator":"^0.1.0"},"_id":"arr@0.1.3","_shasum":"9d82eb2b39d93f59a4a95adedbb74ca35e2185f3","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"9d82eb2b39d93f59a4a95adedbb74ca35e2185f3","size":5214,"noattachment":false,"key":"/arr/-/arr-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/arr/download/arr-0.1.3.tgz"},"directories":{},"publish_time":1412301506197,"_cnpm_publish_time":1412301506197,"_hasShrinkwrap":false},"0.1.2":{"name":"arr","description":"Simple JavaScript utilities for working with arrays.","version":"0.1.2","homepage":"https://github.com/jonschlinkert/arr","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/arr.git"},"bugs":{"url":"https://github.com/jonschlinkert/arr/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/arr/blob/master/LICENSE-MIT"}],"keywords":["array","arrays","filter","filterType","fn","functions","is","javascript","js","kind-of","last","map","match","node","node.js","numbers","obj","object","objects","sort","str","string","strings","type","type-of","typeof","util","utils","val"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"mocha":"*","should":"^4.0.4","verb":">= 0.2.6","verb-tag-jscomments":"^0.2.2"},"dependencies":{"kind-of":"^0.1.0","make-iterator":"^0.1.0"},"_id":"arr@0.1.2","_shasum":"7650db09ab1fec7390288c4ed99f86103305f60b","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"7650db09ab1fec7390288c4ed99f86103305f60b","size":5226,"noattachment":false,"key":"/arr/-/arr-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/arr/download/arr-0.1.2.tgz"},"directories":{},"publish_time":1412301290964,"_cnpm_publish_time":1412301290964,"_hasShrinkwrap":false},"0.1.1":{"name":"arr","description":"Simple JavaScript utilities for working with arrays.","version":"0.1.1","homepage":"https://github.com/jonschlinkert/arr","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/arr.git"},"bugs":{"url":"https://github.com/jonschlinkert/arr/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/arr/blob/master/LICENSE-MIT"}],"keywords":["array","arrays","filter","filterType","fn","functions","is","javascript","js","kind-of","last","map","match","node","node.js","numbers","obj","object","objects","sort","str","string","strings","type","type-of","typeof","util","utils","val"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"mocha":"*","should":"^4.0.4","verb":">= 0.2.6","verb-tag-jscomments":"^0.2.2"},"dependencies":{"kind-of":"^0.1.0"},"_id":"arr@0.1.1","_shasum":"cdb5a2f2ee0f507c9d1c18db9a800b42df6cb53f","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"cdb5a2f2ee0f507c9d1c18db9a800b42df6cb53f","size":4567,"noattachment":false,"key":"/arr/-/arr-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/arr/download/arr-0.1.1.tgz"},"directories":{},"publish_time":1412077082929,"_cnpm_publish_time":1412077082929,"_hasShrinkwrap":false},"0.1.0":{"name":"arr","description":"Simple JavaScript utilities for working with arrays.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/arr","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/arr.git"},"bugs":{"url":"https://github.com/jonschlinkert/arr/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/arr/blob/master/LICENSE-MIT"}],"keywords":["array","arrays","filter","filterType","fn","functions","is","javascript","js","kind-of","last","map","match","node","node.js","numbers","obj","object","objects","sort","str","string","strings","type","type-of","typeof","util","utils","val"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"mocha":"*","should":"^4.0.4","verb":">= 0.2.6","verb-tag-jscomments":"^0.2.2"},"dependencies":{"kind-of":"^0.1.0"},"_id":"arr@0.1.0","_shasum":"13995ef621aa9a6dbabc0dfe4e4ac9c0ebf10384","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"13995ef621aa9a6dbabc0dfe4e4ac9c0ebf10384","size":4431,"noattachment":false,"key":"/arr/-/arr-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/arr/download/arr-0.1.0.tgz"},"directories":{},"publish_time":1412076398655,"_cnpm_publish_time":1412076398655,"_hasShrinkwrap":false}},"readme":"# arr [![NPM version](https://badge.fury.io/js/arr.png)](http://badge.fury.io/js/arr)\n\n> JavaScript utilities for arrays.\n\n## Install\nInstall with [npm](npmjs.org):\n\n```bash\nnpm i arr --save-dev\n```\n\n## Usage\n\n```js\nvar utils = require('arr');\n```\n\n## API\n### [filterType](index.js#L129)\n\nFilter `array`, returning only the values of the given `type`.\n\n* `array` **{Array}**    \n* `type` **{String}**: Native type, e.g. `string`, `object`    \n* `returns`: {Boolean}  \n\n```js\nvar arr = ['a', {a: 'b'}, 1, 'b', 2, {c: 'd'}, 'c'];\n\nutils.filterType(arr, 'object');\n//=> [{a: 'b'}, {c: 'd'}]\n```\n\n### [firstIndex](index.js#L155)\n\nReturn the first index of the given `type`, or `-1` if not found.\n\n* `array` **{Array}**    \n* `type` **{String}**: Native type, e.g. `string`, `object`    \n* `returns`: {Boolean}  \n\n```js\nutils.firstIndex(['a', 1, 'b', 2, {c: 'd'}, 'c'], 'object');\n//=> 4\n```\n\n### [findFirst](index.js#L183)\n\nReturn the first index of the given `type`, or `-1` if not found.\n\n* `array` **{Array}**    \n* `type` **{String}**: Native type, e.g. `string`, `object`    \n* `returns`: {Boolean}  \n\n```js\nutils.firstIndex(['a', 1, 'b', 2, {c: 'd'}, 'c'], 'object');\n//=> 4\n```\n\n### [lastIndex](index.js#L202)\n\nReturn the first index of the given `type`, or `-1` if not found.\n\n* `array` **{Array}**    \n* `type` **{String}**: Native type, e.g. `string`, `object`    \n* `returns`: {Boolean}  \n\n```js\nutils.firstIndex(['a', 1, 'b', 2, {c: 'd'}, 'c'], 'object');\n//=> 4\n```\n\n### [findLast](index.js#L233)\n\nReturn the first index of the given `type`, or `-1` if not found.\n\n* `array` **{Array}**    \n* `type` **{String}**: Native type, e.g. `string`, `object`    \n* `returns`: {Boolean}  \n\n```js\nutils.firstIndex(['a', 1, 'b', 2, {c: 'd'}, 'c'], 'object');\n//=> 4\n```\n\n### [hasType](index.js#L254)\n\nFilter `array`, returning only the numbers.\n\n* `array` **{Array}**    \n* `index` **{Array}**: Optionally specify the index of the number to return, otherwise all numbers are returned.    \n* `returns` **{Array}**: Array of numbers or empty array.  \n\n```js\nvar arr = ['a', {a: 'b'}, 1, 'b', 2, {c: 'd'}, 'c'];\n\nutils.numbers(arr);\n//=> [1, 2]\n```\n\n### [numbers](index.js#L275)\n\nFilter `array`, returning only the numbers.\n\n* `array` **{Array}**    \n* `index` **{Array}**: Optionally specify the index of the number to return, otherwise all numbers are returned.    \n* `returns` **{Array}**: Array of numbers or empty array.  \n\n```js\nvar arr = ['a', {a: 'b'}, 1, 'b', 2, {c: 'd'}, 'c'];\n\nutils.numbers(arr);\n//=> [1, 2]\n```\n\n### [strings](index.js#L296)\n\nFilter `array`, returning only the strings.\n\n* `array` **{Array}**    \n* `index` **{Array}**: Optionally specify the index of the string to return, otherwise all strings are returned.    \n* `returns` **{Array}**: Array of strings or empty array.  \n\n```js\nvar arr = ['a', {a: 'b'}, 1, 'b', 2, {c: 'd'}, 'c'];\n\nutils.strings(arr);\n//=> ['a', 'b', 'c']\n```\n\n### [objects](index.js#L317)\n\nFilter `array`, returning only the objects.\n\n* `array` **{Array}**    \n* `index` **{Array}**: Optionally specify the index of the object to return, otherwise all objects are returned.    \n* `returns` **{Array}**: Array of objects or empty array.  \n\n```js\nvar arr = ['a', {a: 'b'}, 1, 'b', 2, {c: 'd'}, 'c'];\n\nutils.objects(arr);\n//=> [{a: 'b'}, {c: 'd'}]\n```\n\n### [functions](index.js#L340)\n\nFilter `array`, returning only the functions.\n\n* `array` **{Array}**    \n* `index` **{Array}**: Optionally specify the index of the function to return, otherwise all functions are returned.    \n* `returns` **{Array}**: Array of functions or empty array.  \n\n```js\nvar one = function() {};\nvar two = function() {};\nvar arr = ['a', {a: 'b'}, 1, one, 'b', 2, {c: 'd'}, two, 'c'];\n\nutils.functions(arr);\n//=> [one, two]\n```\n\n### [arrays](index.js#L361)\n\nFilter `array`, returning only the arrays.\n\n* `array` **{Array}**    \n* `index` **{Array}**: Optionally specify the index of the array to return, otherwise all arrays are returned.    \n* `returns` **{Array}**: Array of arrays or empty array.  \n\n```js\nvar arr = ['a', ['aaa'], 1, 'b', ['bbb'], 2, {c: 'd'}, 'c'];\n\nutils.objects(arr);\n//=> [['aaa'], ['bbb']]\n```\n\n### [first](index.js#L388)\n\nReturn the first element in `array`, or, if a callback is passed, return the first value for which the returns true.\n\n* `array` **{Array}**    \n* `returns`: {*}  \n\n```js\nvar arr = ['a', {a: 'b'}, 1, one, 'b', 2, {c: 'd'}, two, 'c'];\n\nutils.first(arr);\n//=> 'a'\n\nutils.first(arr, isType('object'));\n//=> {a: 'b'}\n\nutils.first(arr, 'object');\n//=> {a: 'b'}\n```\n\n### [last](index.js#L420)\n\nReturn the last element in `array`, or, if a callback is passed, return the last value for which the returns true.\n\n* `array` **{Array}**    \n* `returns`: {*}  \n\n```js\n// `one` and `two` are functions\nvar arr = ['a', {a: 'b'}, 1, one, 'b', 2, {c: 'd'}, two, 'c'];\n\nutils.last(arr);\n//=> 'c'\n\nutils.last(arr, isType('function'));\n//=> two\n\nutils.last(arr, 'object');\n//=> {c: 'd'}\n```\n\n### [lastOfType](index.js#L444)\n\nGet the last element in `array` of the given `type`.\n\n* `array` **{Array}**    \n* `type` **{String}**: The native type to get.    \n* `returns`: {*}  \n\n```js\nvar arr = ['a', {a: 'b'}, 1, 'b', 2, {c: 'd'}, 'c'];\nlastOfType(arr, 'number');\n//=> 2\n```\n\n### [firstOfType](index.js#L462)\n\nGet the first element in `array` of the given `type`.\n\n* `array` **{Array}**    \n* `type` **{String}**: The native type to get.    \n* `returns`: {*}  \n\n```js\nvar arr = ['a', {a: 'b'}, 1, 'b', 2, {c: 'd'}, 'c'];\nfirstOfType(arr, 'number');\n//=> 1\n```\n\n### [lastIsType](index.js#L480)\n\nReturns `true` if the last element in `array` is the given `type`.\n\n* `array` **{Array}**    \n* `type` **{String}**: The native type to check.    \n* `returns`: {Boolean}  \n\n```js\nvar arr = ['a', {a: 'b'}, 1, 'b', 2, {c: 'd'}, 'c'];\nlastIsType(arr, 'number');\n//=> false\n```\n\n### [firstIsType](index.js#L498)\n\nReturns `true` if the first element in `array` is the given `type`.\n\n* `array` **{Array}**    \n* `type` **{String}**: The native type to check.    \n* `returns`: {Boolean}  \n\n```js\nvar arr = ['a', {a: 'b'}, 1, 'b', 2, {c: 'd'}, 'c'];\nfirstIsType(arr, 'string');\n//=> true\n```\n\n### [firstString](index.js#L515)\n\nGet the first string in `array`.\n\n* `array` **{Array}**    \n* `returns`: {String}  \n\n```js\nvar arr = ['a', {a: 'b'}, 1, 'b', 2, {c: 'd'}, 'c'];\nfirstString(arr, 'string');\n//=> 'a'\n```\n\n### [lastString](index.js#L532)\n\nGet the last string in `array`.\n\n* `array` **{Array}**    \n* `returns`: {String}  \n\n```js\nvar arr = ['a', {a: 'b'}, 1, 'b', 2, {c: 'd'}, 'c'];\nlastString(arr, 'string');\n//=> 'c'\n```\n\n### [firstFunction](index.js#L549)\n\nGet the first function in `array`.\n\n* `array` **{Array}**    \n* `returns`: {Function}  \n\n```js\nvar arr = ['a', {a: 'b'}, 1, 'b', 2, {c: 'd'}, 'c'];\nfirstFunction(arr, 'function');\n//=> 'a'\n```\n\n### [lastFunction](index.js#L566)\n\nGet the last function in `array`.\n\n* `array` **{Array}**    \n* `returns`: {Function}  \n\n```js\nvar arr = ['a', {a: 'b'}, 1, 'b', 2, {c: 'd'}, 'c'];\nlastFunction(arr, 'function');\n//=> 'a'\n```\n\n### [firstNumber](index.js#L583)\n\nGet the first number in `array`.\n\n* `array` **{Array}**    \n* `returns`: {Function}  \n\n```js\nvar arr = ['a', {a: 'b'}, 1, 'b', 2, {c: 'd'}, 'c'];\nfirstNumber(arr, 'number');\n//=> '1'\n```\n\n### [lastNumber](index.js#L600)\n\nGet the last number in `array`.\n\n* `array` **{Array}**    \n* `returns`: {Function}  \n\n```js\nvar arr = ['a', {a: 'b'}, 1, 'b', 2, {c: 'd'}, 'c'];\nlastNumber(arr, 'number');\n//=> '2'\n```\n\n### [firstObject](index.js#L617)\n\nGet the first object in `array`.\n\n* `array` **{Array}**    \n* `returns`: {Object}  \n\n```js\nvar arr = ['a', {a: 'b'}, 1, 'b', 2, {c: 'd'}, 'c'];\nfirstObject(arr);\n//=> {a: 'b'}\n```\n\n### [lastObject](index.js#L634)\n\nGet the last object in `array`.\n\n* `array` **{Array}**    \n* `returns`: {Object}  \n\n```js\nvar arr = ['a', {a: 'b'}, 1, 'b', 2, {c: 'd'}, 'c'];\nlastObject(arr);\n//=> {c: 'd'}\n```\n\n## Author\n\n**Jon Schlinkert**\n \n+ [github/jonschlinkert](https://github.com/jonschlinkert)\n+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) \n\n### Other javascript/node.js utils\n\nOther projects that I maintain:\n\n  - [assemble](https://github.com/jonschlinkert/assemble)\n  - [verb](https://github.com/jonschlinkert/verb)\n  - [less.js](https://github.com/jonschlinkert/less.js)\n  - [handlebars-helpers](https://github.com/jonschlinkert/handlebars-helpers)\n  - [arr](https://github.com/jonschlinkert/arr)\n  - [arr-diff](https://github.com/jonschlinkert/arr-diff)\n  - [array-last](https://github.com/jonschlinkert/array-last)\n  - [array-slice](https://github.com/jonschlinkert/array-slice)\n  - [array-sum](https://github.com/jonschlinkert/array-sum)\n  - [arrayify-compact](https://github.com/jonschlinkert/arrayify-compact)\n  - [compact-object](https://github.com/jonschlinkert/compact-object)\n  - [delete](https://github.com/jonschlinkert/delete)\n  - [for-in](https://github.com/jonschlinkert/for-in)\n  - [for-own](https://github.com/jonschlinkert/for-own)\n  - [has-any](https://github.com/jonschlinkert/has-any)\n  - [has-value](https://github.com/jonschlinkert/has-value)\n  - [is-number](https://github.com/jonschlinkert/is-number)\n  - [is-plain-object](https://github.com/jonschlinkert/is-plain-object)\n  - [mixin-deep](https://github.com/jonschlinkert/mixin-deep)\n  - [mixin-object](https://github.com/jonschlinkert/mixin-object)\n  - [object-length](https://github.com/jonschlinkert/object-length)\n  - [omit-empty](https://github.com/jonschlinkert/omit-empty)\n  - [reduce-object](https://github.com/jonschlinkert/reduce-object)\n\n\n## License\nCopyright (c) 2014 Jon Schlinkert, contributors.  \nReleased under the MIT license\n\n***\n\n_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on November 03, 2014._","_attachments":{},"homepage":"https://github.com/jonschlinkert/arr","bugs":{"url":"https://github.com/jonschlinkert/arr/issues"}}