diff options
Diffstat (limited to 'node_modules/invert-kv')
-rw-r--r-- | node_modules/invert-kv/index.js | 12 | ||||
-rw-r--r-- | node_modules/invert-kv/license | 9 | ||||
-rw-r--r-- | node_modules/invert-kv/package.json | 35 | ||||
-rw-r--r-- | node_modules/invert-kv/readme.md | 8 |
4 files changed, 28 insertions, 36 deletions
diff --git a/node_modules/invert-kv/index.js b/node_modules/invert-kv/index.js index 27f9cbb8e..61e219611 100644 --- a/node_modules/invert-kv/index.js +++ b/node_modules/invert-kv/index.js @@ -1,14 +1,14 @@ 'use strict'; -module.exports = object => { - if (typeof object !== 'object') { +module.exports = function (obj) { + if (typeof obj !== 'object') { throw new TypeError('Expected an object'); } - const ret = {}; + var ret = {}; - for (const key of Object.keys(object)) { - const value = object[key]; - ret[value] = key; + for (var key in obj) { + var val = obj[key]; + ret[val] = key; } return ret; diff --git a/node_modules/invert-kv/license b/node_modules/invert-kv/license deleted file mode 100644 index e7af2f771..000000000 --- a/node_modules/invert-kv/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/invert-kv/package.json b/node_modules/invert-kv/package.json index beb77fa37..b8d24986c 100644 --- a/node_modules/invert-kv/package.json +++ b/node_modules/invert-kv/package.json @@ -1,44 +1,43 @@ { - "_from": "invert-kv@^2.0.0", - "_id": "invert-kv@2.0.0", + "_from": "invert-kv@^1.0.0", + "_id": "invert-kv@1.0.0", "_inBundle": false, - "_integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "_integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", "_location": "/invert-kv", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "invert-kv@^2.0.0", + "raw": "invert-kv@^1.0.0", "name": "invert-kv", "escapedName": "invert-kv", - "rawSpec": "^2.0.0", + "rawSpec": "^1.0.0", "saveSpec": null, - "fetchSpec": "^2.0.0" + "fetchSpec": "^1.0.0" }, "_requiredBy": [ "/lcid" ], - "_resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "_shasum": "7393f5afa59ec9ff5f67a27620d11c226e3eec02", - "_spec": "invert-kv@^2.0.0", - "_where": "/Users/mperrotte/npminc/cli/node_modules/lcid", + "_resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "_shasum": "104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6", + "_spec": "invert-kv@^1.0.0", + "_where": "/Users/isaacs/dev/npm/cli/node_modules/lcid", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" + "url": "http://sindresorhus.com" }, "bugs": { "url": "https://github.com/sindresorhus/invert-kv/issues" }, "bundleDependencies": false, "deprecated": false, - "description": "Invert the key/value of an object. Example: `{foo: 'bar'}` → `{bar: 'foo'}`", + "description": "Invert the key/value of an object. Example: {foo: 'bar'} → {bar: 'foo'}", "devDependencies": { - "ava": "*", - "xo": "*" + "mocha": "*" }, "engines": { - "node": ">=4" + "node": ">=0.10.0" }, "files": [ "index.js" @@ -46,8 +45,10 @@ "homepage": "https://github.com/sindresorhus/invert-kv#readme", "keywords": [ "object", + "obj", "key", "value", + "val", "kv", "invert" ], @@ -58,7 +59,7 @@ "url": "git+https://github.com/sindresorhus/invert-kv.git" }, "scripts": { - "test": "xo && ava" + "test": "mocha" }, - "version": "2.0.0" + "version": "1.0.0" } diff --git a/node_modules/invert-kv/readme.md b/node_modules/invert-kv/readme.md index 365a97997..039fc7cfa 100644 --- a/node_modules/invert-kv/readme.md +++ b/node_modules/invert-kv/readme.md @@ -5,15 +5,15 @@ ## Install -``` -$ npm install invert-kv +```sh +$ npm install --save invert-kv ``` ## Usage ```js -const invertKv = require('invert-kv'); +var invertKv = require('invert-kv'); invertKv({foo: 'bar', unicorn: 'rainbow'}); //=> {bar: 'foo', rainbow: 'unicorn'} @@ -22,4 +22,4 @@ invertKv({foo: 'bar', unicorn: 'rainbow'}); ## License -MIT © [Sindre Sorhus](https://sindresorhus.com) +MIT © [Sindre Sorhus](http://sindresorhus.com) |