UNPKG

@push.rocks/lik

Version:

Provides a collection of lightweight helpers and utilities for Node.js projects.

24 lines (20 loc) 501 B
import * as plugins from './classes.plugins.js'; import { ObjectMap } from './classes.objectmap.js'; export class LoopTracker<T> { referenceObjectMap = new ObjectMap<any>(); constructor() { // nothing here } /** * checks and tracks an object * @param objectArg */ checkAndTrack(objectArg: T): boolean { if (!this.referenceObjectMap.checkForObject(objectArg)) { this.referenceObjectMap.add(objectArg); return true; } else { return false; } } }