Files
str/src/vm/output.ts

14 lines
308 B
TypeScript
Raw Normal View History

import {StrRVal} from "./commands/command.js";
export const getSubjectDisplay = (sub: StrRVal): string => {
if ( sub.term === 'string' ) {
return sub.value
}
if ( sub.term === 'int' ) {
return String(sub.term)
}
return JSON.stringify(sub.value, null, '\t') // fixme
}