@beenotung/tslib
Version:
utils library in Typescript
28 lines • 901 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PolyfillArray = void 0;
/**
* Created by beenotung on 5/18/17.
* Updated by beenotung on 29/1/19.
* Date format: d/m/y
*/
if (!Array.isArray) {
Array.isArray = function isArray(arg) {
return Object.prototype.toString.call(arg) === '[object Array]';
};
}
// tslint:enable
const prototype = Object.assign({
peek: function peek(callbackfn, thisArg) {
// tslint:disable-next-line:no-invalid-this
const self = thisArg || this;
self.forEach((value, index, array) => {
callbackfn(value, index, array);
}, self);
return self;
},
}, Array.prototype);
exports.PolyfillArray = Array;
exports.PolyfillArray.fromArray = exports.PolyfillArray.from;
Object.assign(exports.PolyfillArray.prototype, prototype);
//# sourceMappingURL=polyfill-array.js.map