UNPKG

@nodesecure/contact

Version:

Utilities to extract/fetch data on NPM contacts (author, maintainers ..)

31 lines 917 B
// Import Internal Dependencies import * as utils from "./utils/index.js"; export class UnlitContact { illuminated; extendedName = null; dependencies = new Set(); constructor(contact) { this.illuminated = structuredClone(contact); this.extendedName = typeof contact.name === "string" ? utils.parseRegExp(contact.name) : null; } compareTo(contact) { if (this.extendedName === null) { return utils.compareContact(this.illuminated, contact); } if (this.extendedName.test(contact.name)) { return true; } return utils.compareContact(this.illuminated, contact, { compareName: false }); } illuminate() { return { ...this.illuminated, dependencies: [...this.dependencies] }; } } //# sourceMappingURL=UnlitContact.class.js.map