@nodesecure/scanner
Version:
A package API to run a static analysis of your module's dependencies.
27 lines • 798 B
JavaScript
export class Contacts {
level = "manifest";
#contacts = Object.create(null);
#packages = new Set();
#addContact(user) {
if (!user || !user.email) {
return;
}
this.#contacts[user.email] = user.email in this.#contacts ?
++this.#contacts[user.email] : 1;
}
next(_, version, parent) {
const { author } = version;
const { name, dependency } = parent;
this.#addContact(author);
if (!this.#packages.has(name)) {
dependency.metadata.maintainers.forEach((maintainer) => this.#addContact(maintainer));
this.#packages.add(name);
}
}
done() {
return {
contacts: this.#contacts
};
}
}
//# sourceMappingURL=ContactExtractor.class.js.map