UNPKG

@stdlib/esm

Version:

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

3 lines 1.66 kB
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 import r from"./../assert/is-object-like.js";import t from"./../assert/is-function.js";import n from"./../assert/is-plain-object.js";import e from"./../assert/has-own-property.js";import s from"./index-of.js";var i=n,o=e,u=s,a=["values","keys","*"];function l(r,t){return i(t)?(o(t,"thisArg")&&(r.thisArg=t.thisArg),o(t,"returns")&&(r.returns=t.returns,-1===u(a,r.returns))?new TypeError('invalid option. `returns` option must be one of the following: "'+a.join('", "')+'". Option: `'+r.returns+"`."):null):new TypeError("invalid argument. Options must be an object. Value: `"+t+"`.")}var f=e;function p(r,t,n){var e,s,i,o,u;for(i in e=t.thisArg,s=[[],[]],o=!0,r)f(r,i)&&(o=!1,u=r[i],n.call(e,u,i)?s[0].push(u):s[1].push(u));return o&&(s.length=0),s}var h=e;function m(r,t,n){var e,s,i,o;for(i in e=t.thisArg,s=[[],[]],o=!0,r)h(r,i)&&(o=!1,n.call(e,r[i],i)?s[0].push(i):s[1].push(i));return o&&(s.length=0),s}var v=e;function g(r,t,n){var e,s,i,o,u;for(i in e=t.thisArg,s=[[],[]],o=!0,r)v(r,i)&&(o=!1,u=r[i],n.call(e,u,i)?s[0].push([i,u]):s[1].push([i,u]));return o&&(s.length=0),s}var c=r,j=t,w=l,b=p,y=m,d=g;function A(r,t,n){var e,s,i;if(!c(r))throw new TypeError("invalid argument. First argument must be an object. Value: `"+r+"`.");if(e={returns:"values"},2===arguments.length)i=t;else{if(s=w(e,t))throw s;i=n}if(!j(i))throw new TypeError("invalid argument. Last argument must be a function. Value: `"+i+"`.");return"values"===e.returns?b(r,e,i):"keys"===e.returns?y(r,e,i):d(r,e,i)}var E=A;export default E; //# sourceMappingURL=bifurcate-own.js.map