@nestjs/graphql
Version:
Nest - modern, fast, powerful node.js web framework (@graphql)
31 lines (30 loc) • 822 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.MetadataByNameCollection = void 0;
class MetadataByNameCollection {
constructor() {
this.internalCollection = new Map();
this.all = [];
}
getAll() {
return [...this.all];
}
getByName(name) {
return this.internalCollection.get(name);
}
add(value, name) {
if (this.internalCollection.has(name)) {
return;
}
this.internalCollection.set(name, value);
this.all.push(value);
}
unshift(value, name) {
if (this.internalCollection.has(name)) {
return;
}
this.internalCollection.set(name, value);
this.all.unshift(value);
}
}
exports.MetadataByNameCollection = MetadataByNameCollection;
;