UNPKG

lasso

Version:

Lasso.js is a build tool and runtime library for building and bundling all of the resources needed by a web application

18 lines (14 loc) 345 B
module.exports = function stringifyAttributes (obj) { let str = ''; for (const key in obj) { const val = obj[key]; if (val === false || val == null) { continue; } str += ' ' + key; if (val !== true) { str += '=' + JSON.stringify(val); } } return str; };