blob: dceccea3d60be1ad9921a4e6c8b5f2b4a978c68b [file] [log] [blame]
Alex Fandriantob18ef962015-01-09 11:47:05 -08001var h = require('mercury').h;
2
Alex Fandrianto3844bec2014-09-30 11:29:24 -07003module.exports = {
4 'shouldFormat': shouldFormat,
5 'format': format
6};
7
8/*
9 * The input is empty in various cases.
10 */
11function shouldFormat(input) {
12 return input === undefined || input === null || input === '' ||
13 (input instanceof Array && input.length === 0);
14}
15
16/*
17 * Indicate that nothing was there.
18 */
19function format(input) {
Alex Fandriantob18ef962015-01-09 11:47:05 -080020 return h('span', '<no data>');
Alex Fandrianto3844bec2014-09-30 11:29:24 -070021}