UNPKG

magister.js

Version:

A JavaScript implementation of the Magister 6 API

14 lines (13 loc) 256 B
/** * Returns the value as a string, or the value itself if it's `undefined` or * `null`. * @param {any} val * @returns {string|undefined|null} */ export function toString(val) { if (val == null) { return val } else { return val.toString() } }