summaryrefslogtreecommitdiffstats
path: root/node_modules/union-value
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/union-value')
-rw-r--r--node_modules/union-value/LICENSE21
-rw-r--r--node_modules/union-value/README.md73
-rw-r--r--node_modules/union-value/index.js30
-rw-r--r--node_modules/union-value/package.json101
4 files changed, 225 insertions, 0 deletions
diff --git a/node_modules/union-value/LICENSE b/node_modules/union-value/LICENSE
new file mode 100644
index 0000000..83b56e7
--- /dev/null
+++ b/node_modules/union-value/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015-2017, Jon Schlinkert
+
+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/union-value/README.md b/node_modules/union-value/README.md
new file mode 100644
index 0000000..1a90ffb
--- /dev/null
+++ b/node_modules/union-value/README.md
@@ -0,0 +1,73 @@
+# union-value [![NPM version](https://img.shields.io/npm/v/union-value.svg?style=flat)](https://www.npmjs.com/package/union-value) [![NPM monthly downloads](https://img.shields.io/npm/dm/union-value.svg?style=flat)](https://npmjs.org/package/union-value) [![NPM total downloads](https://img.shields.io/npm/dt/union-value.svg?style=flat)](https://npmjs.org/package/union-value) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/union-value.svg?style=flat&label=Travis)](https://travis-ci.org/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.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/):
+
+```sh
+$ npm install --save union-value
+```
+
+## Usage
+
+```js
+var union = require('union-value');
+
+var obj = {};
+
+union(obj, 'a.b.c', ['one', 'two']);
+union(obj, 'a.b.c', ['three']);
+
+console.log(obj);
+//=> {a: {b: {c: [ 'one', 'two', 'three' ] }}}
+```
+
+## About
+
+### Related projects
+
+* [assign-value](https://www.npmjs.com/package/assign-value): Assign a value or extend a deeply nested property of an object using object path… [more](https://github.com/jonschlinkert/assign-value) | [homepage](https://github.com/jonschlinkert/assign-value "Assign a value or extend a deeply nested property of an object using object path notation.")
+* [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.")
+* [has-value](https://www.npmjs.com/package/has-value): Returns true if a value exists, false if empty. Works with deeply nested values using… [more](https://github.com/jonschlinkert/has-value) | [homepage](https://github.com/jonschlinkert/has-value "Returns true if a value exists, false if empty. Works with deeply nested values using object paths.")
+* [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.")
+* [unset-value](https://www.npmjs.com/package/unset-value): Delete nested properties from an object using dot notation. | [homepage](https://github.com/jonschlinkert/unset-value "Delete nested properties from an object using dot notation.")
+
+### Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
+
+### Building docs
+
+_(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.)_
+
+To generate the readme, run the following command:
+
+```sh
+$ npm install -g verbose/verb#dev verb-generate-readme && verb
+```
+
+### Running tests
+
+Running 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:
+
+```sh
+$ npm install && npm test
+```
+
+### Author
+
+**Jon Schlinkert**
+
+* [github/jonschlinkert](https://github.com/jonschlinkert)
+* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
+
+### License
+
+Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
+Released under the [MIT License](LICENSE).
+
+***
+
+_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 25, 2017._ \ No newline at end of file
diff --git a/node_modules/union-value/index.js b/node_modules/union-value/index.js
new file mode 100644
index 0000000..9c5d8db
--- /dev/null
+++ b/node_modules/union-value/index.js
@@ -0,0 +1,30 @@
+'use strict';
+
+var isObject = require('is-extendable');
+var union = require('arr-union');
+var get = require('get-value');
+var set = require('set-value');
+
+module.exports = function unionValue(obj, prop, value) {
+ if (!isObject(obj)) {
+ throw new TypeError('union-value expects the first argument to be an object.');
+ }
+
+ if (typeof prop !== 'string') {
+ throw new TypeError('union-value expects `prop` to be a string.');
+ }
+
+ var arr = arrayify(get(obj, prop));
+ set(obj, prop, union(arr, arrayify(value)));
+ return obj;
+};
+
+function arrayify(val) {
+ if (val === null || typeof val === 'undefined') {
+ return [];
+ }
+ if (Array.isArray(val)) {
+ return val;
+ }
+ return [val];
+}
diff --git a/node_modules/union-value/package.json b/node_modules/union-value/package.json
new file mode 100644
index 0000000..383d359
--- /dev/null
+++ b/node_modules/union-value/package.json
@@ -0,0 +1,101 @@
+{
+ "_from": "union-value@^1.0.0",
+ "_id": "union-value@1.0.1",
+ "_inBundle": false,
+ "_integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==",
+ "_location": "/union-value",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "union-value@^1.0.0",
+ "name": "union-value",
+ "escapedName": "union-value",
+ "rawSpec": "^1.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.0"
+ },
+ "_requiredBy": [
+ "/cache-base"
+ ],
+ "_resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
+ "_shasum": "0b6fe7b835aecda61c6ea4d4f02c14221e109847",
+ "_spec": "union-value@^1.0.0",
+ "_where": "/home/pruss/Dev/3-minute-website/node_modules/cache-base",
+ "author": {
+ "name": "Jon Schlinkert",
+ "url": "https://github.com/jonschlinkert"
+ },
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/union-value/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "arr-union": "^3.1.0",
+ "get-value": "^2.0.6",
+ "is-extendable": "^0.1.1",
+ "set-value": "^2.0.1"
+ },
+ "deprecated": false,
+ "description": "Set an array of unique values as the property of an object. Supports setting deeply nested properties using using object-paths/dot notation.",
+ "devDependencies": {
+ "gulp-format-md": "^0.1.11",
+ "mocha": "^3.2.0",
+ "should": "^11.2.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "homepage": "https://github.com/jonschlinkert/union-value",
+ "keywords": [
+ "array",
+ "dot",
+ "get",
+ "has",
+ "nested",
+ "notation",
+ "object",
+ "path",
+ "prop",
+ "property",
+ "set",
+ "union",
+ "value"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "union-value",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jonschlinkert/union-value.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "verb": {
+ "toc": false,
+ "layout": "default",
+ "tasks": [
+ "readme"
+ ],
+ "plugins": [
+ "gulp-format-md"
+ ],
+ "related": {
+ "list": [
+ "assign-value",
+ "get-value",
+ "has-value",
+ "set-value",
+ "unset-value"
+ ]
+ },
+ "lint": {
+ "reflinks": true
+ }
+ },
+ "version": "1.0.1"
+}