UNPKG

@stdlib/esm

Version:

ES module distribution for Stdlib, a standard library for JavaScript and Node.js.

3 lines 1.2 kB
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 import r from"./deep-get.js";import o from"./../assert/is-array.js";import e from"./copy.js";import t from"./../assert/is-boolean.js";import i from"./../assert/is-string.js";import p from"./../assert/is-plain-object.js";import s from"./../assert/has-own-property.js";var n=!0,a=".",m={copy:n,sep:a},y=t.isPrimitive,u=i.isPrimitive,l=p,c=s;function f(r,o){return l(o)?c(o,"copy")&&(r.copy=o.copy,!y(r.copy))?new TypeError("invalid option. `copy` option must be a boolean primitive. Option: `"+r.copy+"`."):c(o,"sep")&&(r.sep=o.sep,!u(r.sep))?new TypeError("invalid option. `sep` option must be a string primitive. Option: `"+r.sep+"`."):null:new TypeError("invalid argument. Options argument must be an object. Value: `"+o+"`.")}var v=r.factory,g=o,j=e,b=m,w=f;function d(r,o,e){var t,i,p,s,n;if(!g(r))throw new TypeError("invalid argument. First argument must be an array. Value: `"+r+"`.");if(i=j(b),arguments.length>2&&(s=w(i,e)))throw s;for(p=i.copy?new Array(r.length):r,t=v(o,{sep:i.sep}),n=0;n<r.length;n++)p[n]=t(r[n]);return p}var h=d;export default h; //# sourceMappingURL=deep-pluck.js.map