'use strict';varisObject=require('is-extendable');varunion=require('arr-union');varget=require('get-value');varset=require('set-value');module.exports=functionunionValue(obj,prop,value){if(!isObject(obj)){thrownewTypeError('union-value expects the first argument to be an object.');}if(typeofprop!=='string'){thrownewTypeError('union-value expects `prop` to be a string.');}vararr=arrayify(get(obj,prop));set(obj,prop,union(arr,arrayify(value)));returnobj;};functionarrayify(val){if(val===null||typeofval==='undefined'){return[];}if(Array.isArray(val)){returnval;}return[val];}