@jplorg/jpl
Version:
JPL interpreter
21 lines (15 loc) • 421 B
JavaScript
import { JPLTypeError } from '../library';
async function builtin(runtime, signal, next, input) {
const t = runtime.type(input);
switch (t) {
case 'string':
return next(await runtime.alterValue(input, (value) => value.toUpperCase()));
default:
}
throw new JPLTypeError(
'%s (%*<100v) cannot be converted to upper case',
t,
runtime.unwrapValue(input),
);
}
export default builtin;