Skip to main content

reflectAttributes

@webda/content-mapper


Function: reflectAttributes()

reflectAttributes(ctx, sf, cls): Record<string, ReflectedAttribute>

Defined in: packages/content-mapper/src/module-discovery.ts:584

Reflect a model's attributes, as webda.module.json records them.

The recorded type is the written text rather than a resolved type: an inline object literal appears verbatim, comments and all. Generic types are the exception — their arguments are resolved through the checker so a type parameter is reported as its constraint.

Properties keyed by a symbol, carrying @ignore, or marked not-enumerable are excluded, matching the original.

Parameters​

ctx​

AnalysisContext

analysis context

sf​

any

file declaring the class

cls​

any

the class declaration

Returns​

Record<string, ReflectedAttribute>

attribute name to reflected type