MCPcopy Index your code
hub / github.com/zenstackhq/zenstack / getDataModelAndTypeDefs

Function getDataModelAndTypeDefs

packages/language/src/utils.ts:525–532  ·  view source on GitHub ↗
(model: Model, includeIgnored = false)

Source from the content-addressed store, hash-verified

523 * Gets data models and type defs in the ZModel schema.
524 */
525export function getDataModelAndTypeDefs(model: Model, includeIgnored = false) {
526 const r = model.declarations.filter((d): d is DataModel | TypeDef => isDataModel(d) || isTypeDef(d));
527 if (includeIgnored) {
528 return r;
529 } else {
530 return r.filter((model) => !hasAttribute(model, '@@ignore'));
531 }
532}
533
534/**
535 * Gets all declarations of the given model and its transitive imports.

Callers 1

Calls 3

isDataModelFunction · 0.90
isTypeDefFunction · 0.90
hasAttributeFunction · 0.70

Tested by

no test coverage detected