@autorest/openapi-to-typespec
Version:
Autorest plugin to scaffold a Typespec definition from an OpenAPI document
18 lines • 855 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.addCorePageAlias = addCorePageAlias;
function addCorePageAlias(typespecObject) {
var _a, _b;
const value = (_a = typespecObject.properties) === null || _a === void 0 ? void 0 : _a.filter((p) => p.name === "value");
if (!((_b = typespecObject.properties) === null || _b === void 0 ? void 0 : _b.some((p) => p.name === "nextLink")) || !(value === null || value === void 0 ? void 0 : value.length)) {
return;
}
typespecObject.properties = typespecObject.properties.filter((p) => p.name !== "nextLink" && p.name !== "value");
typespecObject.alias = {
alias: "Azure.Core.Page",
params: [value[0].type.replace("[]", "")],
module: "@azure-tools/typespec-azure-core",
};
return;
}
//# sourceMappingURL=alias.js.map