UNPKG

append-type

Version:

Stringify the value with appending its type: 10 → '10 (number)'

14 lines (10 loc) 202 B
'use strict'; module.exports = function appendType(val) { if (val === undefined) { return 'undefined'; } if (val === null) { return 'null'; } return String(val) + ' (' + typeof val + ')'; }