Page MenuHomeSealhub

text-value.ts
No OneTemporary

Authored By
Unknown
Size
553 B
Referenced Files
None
Subscribers
None

text-value.ts

import escape from "escape-html";
import type { FieldValue } from "./field-value.js";
export class TextValue extends String implements FieldValue {
constructor(private original: string) {
super(original);
// Set the primitive value for proper string behavior
Object.setPrototypeOf(this, TextValue.prototype);
}
getOriginal(): string {
return this.original;
}
getHTMLSafe(): string {
return escape(this.original);
}
getRestAPIValue(): string {
return this.getHTMLSafe();
}
toString(): string {
return this.getHTMLSafe();
}
}

File Metadata

Mime Type
application/javascript
Expires
Fri, Nov 27, 16:23 (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1210217
Default Alt Text
text-value.ts (553 B)

Event Timeline