libmodulor
Version:
A TypeScript library to create platform-agnostic applications
21 lines (20 loc) • 468 B
JavaScript
import { TString } from '../base/TString.js';
export class TYesNo extends TString {
static OPTIONS = ['N', 'Y'];
constructor() {
super({
maxLength: 1,
minLength: 1,
});
this.setOptions(TYesNo.OPTIONS.map((v) => ({
label: v,
value: v,
})), { shouldTranslateLabels: true });
}
tName() {
return 'YesNo';
}
example() {
return 'Y'; // Yes Man !
}
}