14 lines
308 B
TypeScript
14 lines
308 B
TypeScript
|
|
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
|
||
|
|
}
|