This repository was archived by the owner on Dec 12, 2018. It is now read-only.

Description
The docs indicate that the iterator in collectionResource.detect must call it's next argument with the signature next(err, test) .
https://docs.stormpath.com/nodejs/jsdoc/CollectionResource.html#detect__anchor
However, printing out the next function reveals that it only accepts one argument, see below
function (v) {
if (cb && check(v)) {
cb(getResult(true, x));
cb = iterator = false;
}
callback();
}
Practically, it appears that the signature should be next(test) to get the described behavior.
For instance I was calling next(null, test) as I had no errors and that resulted in all resources being visited and null being passed as the foundResource argument of doneCallback