UNPKG

@udraft/core

Version:

uDraft is a language and stack agnostic code-generation tool that simplifies full-stack development by converting a single YAML file into code for rapid development.

33 lines (26 loc) 527 B
export class UAttribute<Type> { private _name: string; private _value?: Type; private _defaultValue?: Type; constructor(name: string, value?: Type) { this._name = name; this._value = value; } $name() { return this._name; } $value() { return this._value ?? this._defaultValue ?? null; } $default() { return this._defaultValue; } default(value?: Type) { this._defaultValue = value; return this; } value(value?: Type) { this._value = value; return this; } }