Skip to content

[F] getVisibility

function getVisibility(program, property): string[] | undefined

Returns the legacy visibility modifiers for a property.

For a property using the enum-driven visibility system, the active Lifecycle visibility modifiers will be converted to strings for backwards compatibility as follows:

  • If Lifecycle visibility is not explicitly set, and no legacy visibility is set, this function will return undefined.
  • If the property has no active Lifecycle visibility modifiers, this function will return ["none"].
  • Otherwise, this function will return an array of lowercase strings representing the active Lifecycle visibility modifiers (“create”, “read”, “update”).

Parameters

ParameterTypeDescription
programProgramthe program in which the property occurs
propertyModelPropertythe property to get legacy visibility modifiers for

Returns

string[] | undefined

Deprecated

Use getVisibilityForClass instead.