@nodesecure/js-x-ray
Version:
JavaScript AST XRay analysis
19 lines • 636 B
JavaScript
export class CollectableSetRegistry {
#collectableSets = new Map();
constructor(collectableSets) {
collectableSets.forEach((collectableSet) => {
this.#collectableSets.set(collectableSet.type, collectableSet);
});
}
add(type, { value, file, location, metadata }) {
const collectableSet = this.#collectableSets.get(type);
collectableSet?.add(value, { file, location, metadata });
}
has(type) {
return this.#collectableSets.has(type);
}
get(type) {
return this.#collectableSets.get(type);
}
}
//# sourceMappingURL=CollectableSetRegistry.js.map