Closed gordielachance closed 1 year ago
Yes, ObjectModel can work with TypeScript, but the TS definitions have been recently added to the project and some improvements can still be added. Here, the assertion function arguments are not yet narrowed based on the type of the model.
Current workaround is to not assume the type of the variable in assertions:
function isTrimmedString(str: unknown): boolean {
return typeof str === "string" && str.trim() === str;
}
closed after inactivity
Can objectmodel work with TypeScript ?
This simple example returns an error :