UNPKG

utils

Version:

Fast, generic JavaScript/node.js utility functions.

12 lines (9 loc) 217 B
'use strict'; /** * If `val` is null or undefined returns an empty string, * otherwise `val` is cast it to a String. * */ module.exports = function toString(val) { return val == null ? '' : val.toString(); };