tuskar-ui/bin/lib/less/tree.js
Gabriel Hurley 6f990c9ce4 Readding bin dir which was mistakenly deleted.
Change-Id: Ia8989da47a55f7c932115a976b6d799714b8dc56
2012-10-12 15:35:19 -07:00

18 lines
442 B
JavaScript

(function (tree) {
tree.find = function (obj, fun) {
for (var i = 0, r; i < obj.length; i++) {
if (r = fun.call(obj, obj[i])) { return r }
}
return null;
};
tree.jsify = function (obj) {
if (Array.isArray(obj.value) && (obj.value.length > 1)) {
return '[' + obj.value.map(function (v) { return v.toCSS(false) }).join(', ') + ']';
} else {
return obj.toCSS(false);
}
};
})(require('./tree'));