for-ease
Version:
a simple library for itrating over anything
27 lines (26 loc) • 902 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const returnsOfCounterClass_1 = require("./../returnsOfCounterClass");
class ObjectArrayClass {
constructor(_objectArray) {
this._objectArray = _objectArray;
}
getCounter() {
let length = this._objectArray.length;
let changedArray = this._objectArray;
return {
do: (cb) => {
for (var i = 0; i < length; i++) {
let ret = cb && cb(i, changedArray[i], changedArray);
changedArray[i] = ret || changedArray[i];
}
return (new returnsOfCounterClass_1.ReturnsOfCounter(changedArray)).getReturns();
}
};
}
setMixedObj(mixed) {
this._objectArray = mixed;
return this;
}
}
exports.ObjectArrayClass = ObjectArrayClass;