@stdlib/esm
Version:
ES module distribution for Stdlib, a standard library for JavaScript and Node.js.
3 lines • 1.46 kB
JavaScript
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
import r from"./../utils/define-nonenumerable-read-only-property.js";import i from"./is-string.js";import e from"./is-array.js";import t from"./../utils/copy.js";import n from"./is-plain-object.js";import o from"./has-own-property.js";var a=i.isPrimitive,p=n,s=o;function u(r,i){return p(i)?s(i,"sep")&&(r.sep=i.sep,!a(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: `"+i+"`.")}var m=".",l={sep:m},f=o;function v(r,i){var e,t=i.length;if(0===t)return!1;for(e=0;e<t;e++){if(!f(r,i[e]))return!1;r=r[i[e]]}return!0}var y=i.isPrimitive,g=e,h=t,c=u,w=l,j=v;function b(r,i,e){var t,n,o,a;if(!(t=y(i))&&!g(i))throw new TypeError("invalid argument. Key path must be a string primitive or a key array. Value: `"+i+"`.");if(o=h(w),arguments.length>2&&(a=c(o,e)))throw a;return null!=r&&(n=t?i.split(o.sep):i,j(r,n))}var d=i.isPrimitive,E=e,T=t,P=u,V=l,k=v;function K(r,i){var e,t,n,o;if(!(e=d(r))&&!E(r))throw new TypeError("invalid argument. Key path must be a string primitive or a key array. Value: `"+r+"`.");if(n=T(V),arguments.length>1&&(o=P(n,i)))throw o;return t=e?r.split(n.sep):r,a;function a(r){return null!=r&&k(r,t)}}var O=r,x=b,q=K;O(x,"factory",q);export default x;
//# sourceMappingURL=deep-has-own-property.js.map