ts-simple-ast
Version:
TypeScript compiler wrapper for AST navigation and code generation.
28 lines (26 loc) • 676 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class ArrayUtils {
constructor() {
}
static *getIterator(a) {
for (const item of a) {
yield item;
}
}
static isNullOrEmpty(a) {
return !(a instanceof Array) || a.length === 0;
}
static getUniqueItems(a) {
return a.filter((item, index) => a.indexOf(item) === index);
}
static removeFirst(a, item) {
const index = a.indexOf(item);
if (index === -1)
return false;
a.splice(index, 1);
return true;
}
}
exports.ArrayUtils = ArrayUtils;
//# sourceMappingURL=ArrayUtils.js.map