UNPKG

@zkochan/pnpm

Version:

Fast, disk space efficient package manager

149 lines (148 loc) 8.78 kB
{ "_args": [ [ { "raw": "unset-value@^1.0.0", "scope": null, "escapedName": "unset-value", "name": "unset-value", "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, "/home/zkochan/src/pnpm/packages/pnpm/node_modules/cache-base" ] ], "_from": "unset-value@>=1.0.0 <2.0.0", "_id": "unset-value@1.0.0", "_inCache": true, "_location": "/unset-value", "_nodeVersion": "7.5.0", "_npmOperationalInternal": { "host": "packages-18-east.internal.npmjs.com", "tmp": "tmp/unset-value-1.0.0.tgz_1488061635259_0.42952891532331705" }, "_npmUser": { "name": "jonschlinkert", "email": "github@sellside.com" }, "_npmVersion": "4.1.2", "_phantomChildren": { "get-value": "2.0.6", "isarray": "1.0.0" }, "_requested": { "raw": "unset-value@^1.0.0", "scope": null, "escapedName": "unset-value", "name": "unset-value", "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, "_requiredBy": [ "/cache-base" ], "_resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", "_shasum": "8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559", "_shrinkwrap": null, "_spec": "unset-value@^1.0.0", "_where": "/home/zkochan/src/pnpm/packages/pnpm/node_modules/cache-base", "author": { "name": "Jon Schlinkert", "url": "https://github.com/jonschlinkert" }, "bugs": { "url": "https://github.com/jonschlinkert/unset-value/issues" }, "contributors": [ { "email": "wtgtybhertgeghgtwtg@gmail.com", "url": "https://github.com/wtgtybhertgeghgtwtg" }, { "name": "Jon Schlinkert", "email": "jon.schlinkert@sellside.com", "url": "http://twitter.com/jonschlinkert" } ], "dependencies": { "has-value": "^0.3.1", "isobject": "^3.0.0" }, "description": "Delete nested properties from an object using dot notation.", "devDependencies": { "gulp-format-md": "^0.1.11", "mocha": "*", "should": "*" }, "directories": {}, "dist": { "shasum": "8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559", "tarball": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz" }, "engines": { "node": ">=0.10.0" }, "files": [ "index.js" ], "gitHead": "36b62353cde18d6be17a1c0dc080fddcc262d2da", "homepage": "https://github.com/jonschlinkert/unset-value", "keywords": [ "del", "delete", "key", "object", "omit", "prop", "property", "remove", "unset", "value" ], "license": "MIT", "main": "index.js", "maintainers": [ { "name": "jonschlinkert", "email": "github@sellside.com" } ], "name": "unset-value", "optionalDependencies": {}, "readme": "# unset-value [![NPM version](https://img.shields.io/npm/v/unset-value.svg?style=flat)](https://www.npmjs.com/package/unset-value) [![NPM monthly downloads](https://img.shields.io/npm/dm/unset-value.svg?style=flat)](https://npmjs.org/package/unset-value) [![NPM total downloads](https://img.shields.io/npm/dt/unset-value.svg?style=flat)](https://npmjs.org/package/unset-value) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/unset-value.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/unset-value)\n\n> Delete nested properties from an object using dot notation.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save unset-value\n```\n\n## Usage\n\n```js\nvar unset = require('unset-value');\n\nvar obj = {a: {b: {c: 'd', e: 'f'}}};\nunset(obj, 'a.b.c');\nconsole.log(obj);\n//=> {a: {b: {e: 'f'}}};\n```\n\n## Examples\n\n### Updates the object when a property is deleted\n\n```js\nvar obj = {a: 'b'};\nunset(obj, 'a');\nconsole.log(obj);\n//=> {}\n```\n\n### Returns true when a property is deleted\n\n```js\nunset({a: 'b'}, 'a') // true\n```\n\n### Returns `true` when a property does not exist\n\nThis is consistent with `delete` behavior in that it does not\nthrow when a property does not exist.\n\n```js\nunset({a: {b: {c: 'd'}}}, 'd') // true\n```\n\n### delete nested values\n\n```js\nvar one = {a: {b: {c: 'd'}}};\nunset(one, 'a.b');\nconsole.log(one);\n//=> {a: {}}\n\nvar two = {a: {b: {c: 'd'}}};\nunset(two, 'a.b.c');\nconsole.log(two);\n//=> {a: {b: {}}}\n\nvar three = {a: {b: {c: 'd', e: 'f'}}};\nunset(three, 'a.b.c');\nconsole.log(three);\n//=> {a: {b: {e: 'f'}}}\n```\n\n### throws on invalid args\n\n```js\nunset();\n// 'expected an object.'\n```\n\n## About\n\n### Related projects\n\n* [get-value](https://www.npmjs.com/package/get-value): Use property paths (`a.b.c`) to get a nested value from an object. | [homepage](https://github.com/jonschlinkert/get-value \"Use property paths (`a.b.c`) to get a nested value from an object.\")\n* [get-values](https://www.npmjs.com/package/get-values): Return an array of all values from the given object. | [homepage](https://github.com/jonschlinkert/get-values \"Return an array of all values from the given object.\")\n* [omit-value](https://www.npmjs.com/package/omit-value): Omit properties from an object or deeply nested property of an object using object path… [more](https://github.com/jonschlinkert/omit-value) | [homepage](https://github.com/jonschlinkert/omit-value \"Omit properties from an object or deeply nested property of an object using object path notation.\")\n* [put-value](https://www.npmjs.com/package/put-value): Update only existing values from an object, works with dot notation paths like `a.b.c` and… [more](https://github.com/tunnckocore/put-value#readme) | [homepage](https://github.com/tunnckocore/put-value#readme \"Update only existing values from an object, works with dot notation paths like `a.b.c` and support deep nesting.\")\n* [set-value](https://www.npmjs.com/package/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/jonschlinkert/set-value \"Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths.\")\n* [union-value](https://www.npmjs.com/package/union-value): Set an array of unique values as the property of an object. Supports setting deeply… [more](https://github.com/jonschlinkert/union-value) | [homepage](https://github.com/jonschlinkert/union-value \"Set an array of unique values as the property of an object. Supports setting deeply nested properties using using object-paths/dot notation.\")\n* [upsert-value](https://www.npmjs.com/package/upsert-value): Update or set nested values and any intermediaries with dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/doowb/upsert-value \"Update or set nested values and any intermediaries with dot notation (`'a.b.c'`) paths.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Contributors\n\n| **Commits** | **Contributor** | \n| --- | --- |\n| 6 | [jonschlinkert](https://github.com/jonschlinkert) |\n| 2 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |\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.4.2, on February 25, 2017._", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git+https://github.com/jonschlinkert/unset-value.git" }, "scripts": { "test": "mocha" }, "verb": { "related": { "list": [ "get-value", "get-values", "omit-value", "put-value", "set-value", "union-value", "upsert-value" ] }, "toc": false, "layout": "default", "tasks": [ "readme" ], "plugins": [ "gulp-format-md" ], "lint": { "reflinks": true } }, "version": "1.0.0" }