Package Exports
- make-iterator
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (make-iterator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
make-iterator

Convert an argument into a valid iterator. Based on the
.makeIterator()
implementation in mout https://github.com/mout/mout.
Install
Install with npm
$ npm i make-iterator --save
Usage
var iterator = require('make-iterator');
function someFn(arr, cb, thisArg) {
cb = iterator(cb, thisArg);
var len = arr.length, i = -1;
var res;
while (++i < len) {
res = cb(arr[i], i, arr);
if (res === false) {
// do somethine
} else {
// do something else
}
}
return res;
}
Author
Jon Schlinkert
Related projects
- any: Returns
true
if a value exists in the given string, array or object. - arr-filter: Faster alternative to javascript's native filter method.
- arr-map: Faster, node.js focused alternative to JavaScript's native array map.
- array-every: Returns true if the callback returns truthy for all elements in the given array.
- collection-map: Returns an array of mapped values from an array or object.
- utils: Fast, generic JavaScript/node.js utility functions.
Running tests
Install dev dependencies:
$ npm i -d && npm test
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Author
Jon Schlinkert
License
Copyright © 2015 Jon Schlinkert Copyright (c) 2012, 2013 moutjs team and contributors (http://moutjs.com) Released under the MIT license.
This file was generated by verb-cli on July 17, 2015.