Template Upload
This commit is contained in:
15
node_modules/zip-object/.npmignore
generated
vendored
Normal file
15
node_modules/zip-object/.npmignore
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
lib-cov
|
||||
*.seed
|
||||
*.log
|
||||
*.csv
|
||||
*.dat
|
||||
*.out
|
||||
*.pid
|
||||
*.gz
|
||||
|
||||
pids
|
||||
logs
|
||||
results
|
||||
|
||||
npm-debug.log
|
||||
node_modules
|
28
node_modules/zip-object/README.md
generated
vendored
Normal file
28
node_modules/zip-object/README.md
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
# zip-object
|
||||
|
||||
Create an object from from arrays of keys and values. (Inspired by [lodash's _.zipObject](http://devdocs.io/lodash/index#zipObject))
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
npm install zip-object --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Either takes two arrays or an array of arrays as the argument(s).
|
||||
|
||||
```js
|
||||
var zipObject = require('zip-object');
|
||||
var zipped = zipObject(['key1', 'key2'], ['value1', 'value2']);
|
||||
|
||||
console.log(zipped.key1); // outputs 'value1'
|
||||
console.log(zipped.key2); // outputs 'value2'
|
||||
```
|
||||
|
||||
## Run Tests
|
||||
|
||||
```
|
||||
npm install
|
||||
npm test
|
||||
```
|
17
node_modules/zip-object/index.js
generated
vendored
Normal file
17
node_modules/zip-object/index.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
var zipObject = function (keys, values) {
|
||||
if (arguments.length == 1) {
|
||||
values = keys[1];
|
||||
keys = keys[0];
|
||||
}
|
||||
|
||||
var result = {};
|
||||
var i = 0;
|
||||
|
||||
for (i; i < keys.length; i += 1) {
|
||||
result[keys[i]] = values[i];
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
module.exports = zipObject;
|
79
node_modules/zip-object/package.json
generated
vendored
Normal file
79
node_modules/zip-object/package.json
generated
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"zip-object@^0.1.0",
|
||||
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\typings-core"
|
||||
]
|
||||
],
|
||||
"_from": "zip-object@>=0.1.0-0 <0.2.0-0",
|
||||
"_id": "zip-object@0.1.0",
|
||||
"_inCache": true,
|
||||
"_location": "/zip-object",
|
||||
"_npmUser": {
|
||||
"email": "scottcorgan@gmail.com",
|
||||
"name": "scottcorgan"
|
||||
},
|
||||
"_npmVersion": "1.3.11",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "zip-object",
|
||||
"raw": "zip-object@^0.1.0",
|
||||
"rawSpec": "^0.1.0",
|
||||
"scope": null,
|
||||
"spec": ">=0.1.0-0 <0.2.0-0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/typings-core"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/zip-object/-/zip-object-0.1.0.tgz",
|
||||
"_shasum": "c1a0da04c88c837756e248680a03ff902ec3f53a",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "zip-object@^0.1.0",
|
||||
"_where": "C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\typings-core",
|
||||
"author": {
|
||||
"name": "Scott Corgan"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/scottcorgan/zip-object/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Create an object from from arrays of keys and values",
|
||||
"devDependencies": {
|
||||
"tap-spec": "~0.1.3",
|
||||
"tape": "~2.3.2"
|
||||
},
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"dist": {
|
||||
"shasum": "c1a0da04c88c837756e248680a03ff902ec3f53a",
|
||||
"tarball": "https://registry.npmjs.org/zip-object/-/zip-object-0.1.0.tgz"
|
||||
},
|
||||
"installable": true,
|
||||
"keywords": [
|
||||
"array",
|
||||
"lodash",
|
||||
"object",
|
||||
"object",
|
||||
"zip"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "scottcorgan",
|
||||
"email": "scottcorgan@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "zip-object",
|
||||
"optionalDependencies": {},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/scottcorgan/zip-object.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test/index.js | node_modules/.bin/tspec"
|
||||
},
|
||||
"version": "0.1.0"
|
||||
}
|
24
node_modules/zip-object/test/index.js
generated
vendored
Normal file
24
node_modules/zip-object/test/index.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
var zipObject = require('../');
|
||||
var test = require('tape');
|
||||
|
||||
test('creates object from list of arrays', function (t) {
|
||||
var obj = zipObject(['key1', 'key2'], ['value1', 'value2']);
|
||||
var expected = {
|
||||
key1: 'value1',
|
||||
key2: 'value2'
|
||||
};
|
||||
|
||||
t.deepEqual(obj, expected, 'created object');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('creates object from array of arrays', function (t) {
|
||||
var obj = zipObject([['key1', 'key2'], ['value1', 'value2']]);
|
||||
var expected = {
|
||||
key1: 'value1',
|
||||
key2: 'value2'
|
||||
};
|
||||
|
||||
t.deepEqual(obj, expected, 'created object');
|
||||
t.end();
|
||||
});
|
Reference in New Issue
Block a user