@excentone/spfx-value-types
Version:
Contain common value types used when developing SharePoint Framework (SPFx) Web components.
14 lines (12 loc) • 414 B
JavaScript
export class ValueObject {
value;
constructor(value) {
this.value = value;
this.validate();
}
/** Returns the string representation of the value object. */
toString = () => typeof this.value === 'string' ? this.value : this.value.toString();
/** Returns the underlying value of the value object. */
valueOf = () => this.value;
}
//# sourceMappingURL=ValueObject.js.map