3 var isObject = require('is-extendable');
4 var union = require('arr-union');
5 var get = require('get-value');
6 var set = require('set-value');
8 module.exports = function unionValue(obj, prop, value) {
10 throw new TypeError('union-value expects the first argument to be an object.');
13 if (typeof prop !== 'string') {
14 throw new TypeError('union-value expects `prop` to be a string.');
17 var arr = arrayify(get(obj, prop));
18 set(obj, prop, union(arr, arrayify(value)));
22 function arrayify(val) {
23 if (val === null || typeof val === 'undefined') {
26 if (Array.isArray(val)) {