MCPcopy
hub / github.com/warp-drive-data/warp-drive / attr

Function attr

warp-drive-packages/legacy/src/model/-private/attr.ts:276–284  ·  view source on GitHub ↗
(
  type?: string | AttrOptions | object,
  options?: (AttrOptions & object) | string | symbol,
  desc?: PropertyDescriptor
)

Source from the content-addressed store, hash-verified

274export function attr(type: string, options?: AttrOptions & object): DataDecorator;
275export function attr(target: object, key: string | symbol, desc?: PropertyDescriptor): void; // see note on DataDecorator for why void
276export function attr(
277 type?: string | AttrOptions | object,
278 options?: (AttrOptions & object) | string | symbol,
279 desc?: PropertyDescriptor
280): DataDecorator | void {
281 const args = [type, options, desc];
282 // see note on DataDecorator for why void
283 return isElementDescriptor(args) ? (_attr()(...args) as void) : _attr(type, options as object);
284}

Callers 15

UserClass · 0.90
TestModelClass · 0.90
attr.type-test.tsFile · 0.90
UserClass · 0.90
UnbrandedUserClass · 0.90
BrandedUserClass · 0.90
BrandedTypedUserClass · 0.90
TestModelClass · 0.90
PostClass · 0.90
CommentClass · 0.90
AddressClass · 0.90

Calls 2

isElementDescriptorFunction · 0.90
_attrFunction · 0.85

Tested by

no test coverage detected