@stdlib/esm
Version:
ES module distribution for Stdlib, a standard library for JavaScript and Node.js.
3 lines • 803 B
JavaScript
// 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-collection.js";import e from"./../assert/is-positive-integer.js";import t from"./../assert/is-function.js";var i=r,n=e.isPrimitive,o=t;function a(r,e,t,a){var s,u,l;if(!i(r))throw new TypeError("invalid argument. First argument must be a collection. Value: `"+r+"`.");if(!n(e))throw new TypeError("invalid argument. Second argument must be a positive integer. Value: `"+e+"`.");if(!o(t))throw new TypeError("invalid argument. Third argument must be a function. Value: `"+t+"`.");for(s=0,l=(u=r.length)-1;l>=0;l--){if(t.call(a,r[l],l,r)&&(s+=1)===e)return!0;u!==r.length&&(l+=r.length-u,u=r.length)}return!1}var s=a;export default s;
//# sourceMappingURL=some-by-right.js.map