[Pkg-javascript-commits] [node-map-obj] 02/05: Imported Upstream version 1.0.1

Jonathan Horn jonathanh-guest at moszumanska.debian.org
Sun Jun 5 00:15:42 UTC 2016


This is an automated email from the git hooks/post-receive script.

jonathanh-guest pushed a commit to branch master
in repository node-map-obj.

commit 14c8e69e4f0c1da889267c48adc3fe681486cce9
Author: Jonathan Horn <info at autoit4you.de>
Date:   Sat Jun 4 13:04:00 2016 +0200

    Imported Upstream version 1.0.1
---
 .editorconfig        | 15 +++++++++++++++
 .gitattributes       |  1 +
 .gitignore           |  1 +
 .jshintrc            | 12 ++++++++++++
 .travis.yml          |  6 ++++++
 debian/changelog     |  6 ------
 debian/compat        |  1 -
 debian/control       | 24 ------------------------
 debian/copyright     | 34 ----------------------------------
 debian/docs          |  1 -
 debian/install       |  2 --
 debian/rules         | 15 ---------------
 debian/source/format |  1 -
 debian/tests/control |  2 --
 debian/tests/require |  3 ---
 debian/watch         |  5 -----
 index.js             | 13 +++++++++++++
 license              | 21 +++++++++++++++++++++
 package.json         | 36 ++++++++++++++++++++++++++++++++++++
 readme.md            | 29 +++++++++++++++++++++++++++++
 test.js              | 19 +++++++++++++++++++
 21 files changed, 153 insertions(+), 94 deletions(-)

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..8f9d77e
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,15 @@
+root = true
+
+[*]
+indent_style = tab
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[{package.json,*.yml}]
+indent_style = space
+indent_size = 2
+
+[*.md]
+trim_trailing_whitespace = false
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..176a458
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+* text=auto
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+node_modules
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 0000000..9fe1be2
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,12 @@
+{
+	"node": true,
+	"esnext": true,
+	"bitwise": true,
+	"curly": true,
+	"immed": true,
+	"newcap": true,
+	"noarg": true,
+	"undef": true,
+	"unused": "vars",
+	"strict": true
+}
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..dedfc07
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,6 @@
+sudo: false
+language: node_js
+node_js:
+  - 'iojs'
+  - '0.12'
+  - '0.10'
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644
index 27dc3fb..0000000
--- a/debian/changelog
+++ /dev/null
@@ -1,6 +0,0 @@
-node-map-obj (1.0.1-1) UNRELEASED; urgency=low
-
-  * Initial release (Closes: #nnnn)
-
- -- Jonathan Ulrich Horn <debian at autoit4you.de>  Sat, 04 Jun 2016 13:00:44 +0200
-
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index 45a4fb7..0000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-8
diff --git a/debian/control b/debian/control
deleted file mode 100644
index 7796e78..0000000
--- a/debian/control
+++ /dev/null
@@ -1,24 +0,0 @@
-Source: node-map-obj
-Section: web
-Priority: extra
-Maintainer: Debian Javascript Maintainers <pkg-javascript-devel at lists.alioth.debian.org>
-Uploaders: Jonathan Ulrich Horn <debian at autoit4you.de>
-Build-Depends:
- debhelper (>= 8)
- , dh-buildinfo
- , nodejs
-Standards-Version: 3.9.6
-Homepage: https://github.com/sindresorhus/map-obj
-Vcs-Git: git://anonscm.debian.org/pkg-javascript/node-map-obj.git
-Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-javascript/node-map-obj.git
-XS-Testsuite: autopkgtest
-
-Package: node-map-obj
-Architecture: all
-Depends:
- ${misc:Depends}
- , nodejs
-Description: Map object keys and values into a new object
- FIX_ME long description
- .
- Node.js is an event-based server-side JavaScript engine.
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644
index b9902cd..0000000
--- a/debian/copyright
+++ /dev/null
@@ -1,34 +0,0 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: map-obj
-Upstream-Contact: https://github.com/sindresorhus/map-obj/issues
-Source: https://github.com/sindresorhus/map-obj
-
-Files: *
-Copyright: 2016 Sindre Sorhus <sindresorhus at gmail.com> (sindresorhus.com)
-License: Expat
-
-Files: debian/*
-Copyright: 2016 Jonathan Ulrich Horn <debian at autoit4you.de>
-License: Expat
-
-License: Expat
- 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/debian/docs b/debian/docs
deleted file mode 100644
index cdb5f04..0000000
--- a/debian/docs
+++ /dev/null
@@ -1 +0,0 @@
-readme.md
diff --git a/debian/install b/debian/install
deleted file mode 100644
index 12e9598..0000000
--- a/debian/install
+++ /dev/null
@@ -1,2 +0,0 @@
-package.json usr/lib/nodejs/map-obj/
-index.js usr/lib/nodejs/map-obj/
diff --git a/debian/rules b/debian/rules
deleted file mode 100755
index de57af0..0000000
--- a/debian/rules
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-%:
-	dh $@
-
-#override_dh_auto_build:
-
-#override_dh_auto_test:
-
-
-
diff --git a/debian/source/format b/debian/source/format
deleted file mode 100644
index 163aaf8..0000000
--- a/debian/source/format
+++ /dev/null
@@ -1 +0,0 @@
-3.0 (quilt)
diff --git a/debian/tests/control b/debian/tests/control
deleted file mode 100644
index 1c8e702..0000000
--- a/debian/tests/control
+++ /dev/null
@@ -1,2 +0,0 @@
-Tests: require
-Depends: node-map-obj
diff --git a/debian/tests/require b/debian/tests/require
deleted file mode 100644
index 9927822..0000000
--- a/debian/tests/require
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-set -e
-nodejs -e "require('map-obj');"
diff --git a/debian/watch b/debian/watch
deleted file mode 100644
index b393b19..0000000
--- a/debian/watch
+++ /dev/null
@@ -1,5 +0,0 @@
-version=3
-opts=\
-dversionmangle=s/\+(debian|dfsg|ds|deb)(\.\d+)?$//,\
-filenamemangle=s/.*\/v?([\d\.-]+)\.tar\.gz/node-map-obj-$1.tar.gz/ \
- https://github.com/sindresorhus/map-obj/tags .*/archive/v?([\d\.]+).tar.gz
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..8b7b4d6
--- /dev/null
+++ b/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/license b/license
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus at 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/package.json b/package.json
new file mode 100644
index 0000000..d178305
--- /dev/null
+++ b/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 at 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/readme.md b/readme.md
new file mode 100644
index 0000000..fee03d9
--- /dev/null
+++ b/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)
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..f8311be
--- /dev/null
+++ b/test.js
@@ -0,0 +1,19 @@
+'use strict';
+var test = require('ava');
+var mapObj = require('./');
+
+test(function (t) {
+	t.assert(mapObj({foo: 'bar'}, function (key, val) {
+		return [key, 'unicorn'];
+	}).foo === 'unicorn');
+
+	t.assert(mapObj({foo: 'bar'}, function (key, val) {
+		return ['unicorn', val];
+	}).unicorn === 'bar');
+
+	t.assert(mapObj({foo: 'bar'}, function (key, val) {
+		return [val, key];
+	}).bar === 'foo');
+
+	t.end();
+});

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-map-obj.git



More information about the Pkg-javascript-commits mailing list