@stdlib/esm
Version:
ES module distribution for Stdlib, a standard library for JavaScript and Node.js.
3 lines • 2.52 kB
JavaScript
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
import i from"./../define-nonenumerable-read-only-property.js";import r from"./../../assert/is-function.js";import e from"./../../constants/math/float64-pinf.js";import t from"./../../assert/is-plain-object.js";import n from"./../../assert/has-own-property.js";import o from"./../../assert/is-boolean.js";import s from"./../../assert/is-positive-integer.js";import a from"./../../vendor/debug.js";import l from"./../keys.js";var m=t,u=n,f=o.isPrimitive,p=s.isPrimitive;function c(i,r){return m(r)?(u(r,"thisArg")&&(i.thisArg=r.thisArg),u(r,"series")&&(i.series=r.series,!f(i.series))?new TypeError("invalid option. `series` option must be a boolean primitive. Option: `"+i.series+"`."):u(r,"limit")&&(i.limit=r.limit,!p(i.limit))?new TypeError("invalid option. `limit` option must be a positive integer. Option: `"+i.limit+"`."):null):new TypeError("invalid argument. Options must be an object. Value: `"+r+"`.")}var g=a,v=l,d=g("map-values-async:limit");function h(i,r,e,t){var n,o,s,a,l,m,u,f,p;if(s=v(i),m=s.length,d("Number of keys: %d",m),f={},0===m)return d("Finished processing an object."),t(null,f);for(l=m<r.limit?m:r.limit,d("Concurrency limit: %d",l),d("Number of arguments: %d",e.length),n=m-1,o=0,u=-1,p=0;p<l;p++)u<n&&c();function c(){var t,n;function o(i,r){if(!a){if(i)return a=!0,g(i);d("Transform result => %s: %s",r,JSON.stringify(t)),f[r]=t,g()}}n=s[u+=1],t=i[n],d("%s: %s",n,JSON.stringify(t)),2===e.length?e.call(r.thisArg,n,o):3===e.length?e.call(r.thisArg,n,t,o):e.call(r.thisArg,n,t,i,o)}function g(i){return i?(d("Encountered an error: %s",i.message),t(i)):(d("Processed %d of %d properties.",o+=1,m),u<n?c():o===m?(d("Finished processing an object."),t(null,f)):void 0)}}var b=r,y=e,j=c,w=h;function E(i,r){var e,t,n;if(e={},arguments.length>1){if(t=j(e,i))throw t;n=r}else n=i;if(!b(n))throw new TypeError("invalid argument. Last argument must be a function. Value: `"+n+"`.");return e.series?e.limit=1:e.limit||(e.limit=y),o;function o(i,r){if("object"!=typeof i||null===i)throw new TypeError("invalid argument. First argument must be an object. Value: `"+i+".`");if(!b(r))throw new TypeError("invalid argument. Last argument must be a function. Value: `"+r+"`.");return w(i,e,n,(function(i,e){if(i)return r(i);r(null,e)}))}}var T=E;function A(i,r,e,t){if(arguments.length<4)return T(r)(i,e);T(r,e)(i,t)}var O=i,N=A,V=E;O(N,"factory",V);export default N;
//# sourceMappingURL=map-keys.js.map