@autorest/openapi-to-typespec
Version:
Autorest plugin to scaffold a Typespec definition from an OpenAPI document
14 lines • 631 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.getNamespace = exports.getNamespaceStatement = void 0;
const options_1 = require("../options");
function getNamespaceStatement(program) {
return `namespace ${getNamespace(program)};`;
}
exports.getNamespaceStatement = getNamespaceStatement;
function getNamespace(program) {
const { namespace } = (0, options_1.getOptions)();
return namespace !== null && namespace !== void 0 ? namespace : program.serviceInformation.name.replace(/ /g, "").replace(/-/g, "");
}
exports.getNamespace = getNamespace;
//# sourceMappingURL=namespace.js.map
;