UNPKG

@protocolnebula/ts-openapi-generator

Version:

Build API and models from Swagger/OpenAPI to use in any project type

25 lines 768 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ParameterStore = void 0; class ParameterStore { constructor() { this._parameters = new Set(); } get parameters() { return [...this._parameters]; } add(attribute) { if (!this._parameters.has(attribute)) { console.debug('Added parameter attribute to the store:', attribute.usedIn, attribute.uri); this._parameters.add(attribute); } else { throw `Model ${attribute.uri} declared twice`; } } getByUri(uri) { return this.parameters.find((attribute) => attribute.uri === uri); } } exports.ParameterStore = ParameterStore; //# sourceMappingURL=parameter.store.js.map