UNPKG

@typespec/http-server-js

Version:

TypeSpec HTTP server code generator for JavaScript

31 lines 1.02 kB
// Copyright (c) Microsoft Corporation // Licensed under the MIT license. /** * Recursively collects all properties of a model, including inherited properties. */ export function getAllProperties(model, visited = new Set()) { if (visited.has(model)) return []; visited.add(model); const properties = [...model.properties.values()]; if (model.baseModel) { properties.push(...getAllProperties(model.baseModel, visited)); } return properties; } /** * Recursively collects all operations in an interface, including those inherited from source interfaces. */ export function getAllOperations(iface, visited = new Set()) { if (visited.has(iface)) return []; visited.add(iface); const operations = [...iface.operations.values()]; if (iface.sourceInterfaces) { for (const source of iface.sourceInterfaces) { operations.push(...getAllOperations(source, visited)); } } return operations; } //# sourceMappingURL=extends.js.map