array-includes-polyfill
Version:
Exposing a richer set of Array features for JavaScript
29 lines (23 loc) • 1.21 kB
JavaScript
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var Trash = (function () {
function Trash() {
_classCallCheck(this, Trash);
}
_createClass(Trash, [{
key: 'trash',
value: function trash(obj) {
if (typeof obj == 'object' && Object.keys(obj).length != 0) {
if (this.lookup(obj)) {
var index = this.lookup(obj, true)._$$index_;
this.splice(index, 1);
return true;
}
return false;
}
}
}]);
return Trash;
})();
module.exports = Trash;
;