summaryrefslogtreecommitdiff
path: root/node_modules/map-obj
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/map-obj')
-rw-r--r--node_modules/map-obj/index.js13
-rw-r--r--node_modules/map-obj/license21
-rw-r--r--node_modules/map-obj/package.json36
-rw-r--r--node_modules/map-obj/readme.md29
4 files changed, 99 insertions, 0 deletions
diff --git a/node_modules/map-obj/index.js b/node_modules/map-obj/index.js
new file mode 100644
index 0000000..8b7b4d6
--- /dev/null
+++ b/node_modules/map-obj/index.js
@@ -0,0 +1,13 @@
+'use strict';
+module.exports = function (obj, cb) {
+ var ret = {};
+ var keys = Object.keys(obj);
+
+ for (var i = 0; i < keys.length; i++) {
+ var key = keys[i];
+ var res = cb(key, obj[key], obj);
+ ret[res[0]] = res[1];
+ }
+
+ return ret;
+};
diff --git a/node_modules/map-obj/license b/node_modules/map-obj/license
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/node_modules/map-obj/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+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/map-obj/package.json b/node_modules/map-obj/package.json
new file mode 100644
index 0000000..d178305
--- /dev/null
+++ b/node_modules/map-obj/package.json
@@ -0,0 +1,36 @@
+{
+ "name": "map-obj",
+ "version": "1.0.1",
+ "description": "Map object keys and values into a new object",
+ "license": "MIT",
+ "repository": "sindresorhus/map-obj",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "node test.js"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "map",
+ "obj",
+ "object",
+ "key",
+ "keys",
+ "value",
+ "values",
+ "val",
+ "iterate",
+ "iterator"
+ ],
+ "devDependencies": {
+ "ava": "0.0.4"
+ }
+}
diff --git a/node_modules/map-obj/readme.md b/node_modules/map-obj/readme.md
new file mode 100644
index 0000000..fee03d9
--- /dev/null
+++ b/node_modules/map-obj/readme.md
@@ -0,0 +1,29 @@
+# map-obj [![Build Status](https://travis-ci.org/sindresorhus/map-obj.svg?branch=master)](https://travis-ci.org/sindresorhus/map-obj)
+
+> Map object keys and values into a new object
+
+
+## Install
+
+```
+$ npm install --save map-obj
+```
+
+
+## Usage
+
+```js
+var mapObj = require('map-obj');
+
+var newObject = mapObj({foo: 'bar'}, function (key, value, object) {
+ // first element is the new key and second is the new value
+ // here we reverse the order
+ return [value, key];
+});
+//=> {bar: 'foo'}
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)