{"name":"toggle-array","description":"In an array of objects, this enables a property on the object at the specified index, while disabling the property on all other objects.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/toggle-array","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/toggle-array.git"},"bugs":{"url":"https://github.com/jonschlinkert/toggle-array/issues"},"license":"Released under the MIT license.","files":["index.js","LICENSE"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"keywords":["array","toggle"],"devDependencies":{"gulp-format-md":"^0.1.10","mocha":"^3.0.2"},"dependencies":{"isobject":"^2.1.0"},"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"lint":{"reflinks":true},"related":{"list":[]},"reflinks":["verb","verb-generate-readme"]},"gitHead":"4e64860ce3b6cd0d4e2e84c965d98512c8dabebb","_id":"toggle-array@0.1.0","_shasum":"305c046b1b7b1b8d1d0398d0beb4fe9a19f134fb","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"305c046b1b7b1b8d1d0398d0beb4fe9a19f134fb","tarball":"http://registry-npm.ywwl.com/toggle-array/download/toggle-array-0.1.0.tgz","integrity":"sha512-wLQWgKl287HqUuDrv8hiyP8HjT3YOrSrugM9tLQBb+KmQ/O12ckAosarvPVmh3GO51PfzFn37blG7zkl35ABHQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhEV01mRXuegRASBmiByKNwBVCqNkd6TF415fjqV7lCQIgFDm/5hejzVn1cOcijlWzpMNXckOT9tUWcfAL1+SLfmU="}],"size":2160,"noattachment":false,"key":"/toggle-array/-/toggle-array-0.1.0.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/toggle-array-0.1.0.tgz_1472515763681_0.9451782100368291"},"directories":{},"readme":"# toggle-array [![NPM version](https://img.shields.io/npm/v/toggle-array.svg?style=flat)](https://www.npmjs.com/package/toggle-array) [![NPM monthly downloads](https://img.shields.io/npm/dm/toggle-array.svg?style=flat)](https://npmjs.org/package/toggle-array) [![NPM total downloads](https://img.shields.io/npm/dt/toggle-array.svg?style=flat)](https://npmjs.org/package/toggle-array) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/toggle-array.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/toggle-array)\n\n> In an array of objects, this enables a property on the object at the specified index, while disabling the property on all other objects.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save toggle-array\n```\n\n## Usage\n\n```js\nvar toggle = require('toggle-array');\nvar arr = [\n  {foo: true},\n  {foo: true},\n  {foo: true},\n  {foo: true},\n  {foo: true}\n];\n\nconsole.log(toggle(arr, 'foo', 2));\n// [ { foo: true },\n//   { foo: false },\n//   { foo: true },\n//   { foo: true },\n//   { foo: true } ]\n\nconsole.log(toggle(arr, 'foo', 2));\n// [ { foo: false },\n//   { foo: true },\n//   { foo: false },\n//   { foo: false },\n//   { foo: false } ]\n```\n\n## .enable\n\nEnables the element at the given index, and disables all other items:\n\n```js\nvar toggle = require('toggle-array');\nvar arr = [\n  {foo: true},\n  {foo: true},\n  {foo: true},\n  {foo: true},\n  {foo: true}\n];\n\nconsole.log(toggle.enable(arr, 'foo', 2));\n// [ { foo: false },\n//   { foo: false },\n//   { foo: true },\n//   { foo: false },\n//   { foo: false } ]\n```\n\n## .disable\n\nDisabled the element at the given index, and enables all other items:\n\n```js\nvar toggle = require('toggle-array');\nvar arr = [\n  {foo: false},\n  {foo: false},\n  {foo: false},\n  {foo: false},\n  {foo: false}\n];\n\nconsole.log(toggle.disable(arr, 'foo', 2));\n// [ { foo: true },\n//   { foo: true },\n//   { foo: false },\n//   { foo: true },\n//   { foo: true } ]\n```\n\n## About\n\n### Related projects\n\n* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. | [homepage](https://github.com/jonschlinkert/arr-flatten \"Recursively flatten an array or arrays.\")\n* [array-unique](https://www.npmjs.com/package/array-unique): Remove duplicate values from an array. Fastest ES5 implementation. | [homepage](https://github.com/jonschlinkert/array-unique \"Remove duplicate values from an array. Fastest ES5 implementation.\")\n* [prompt-choices](https://www.npmjs.com/package/prompt-choices): Create an array of multiple choice objects for use in prompts. | [homepage](https://github.com/enquirer/prompt-choices \"Create an array of multiple choice objects for use in prompts.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Building docs\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### Running tests\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### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [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.6.0, on May 07, 2017._","publish_time":1472515764994,"_cnpm_publish_time":1472515764994,"dist-tags":{"latest":"1.0.1"}}