/app/node_modules/less/lib/less/tree/value.js

https://bitbucket.org/jorritposthuma/inventory-counter-mobile · JavaScript · 24 lines · 22 code · 2 blank · 0 comment · 2 complexity · 6a009a5b26cf9da2e75df41987e6587e MD5 · raw file

  1. (function (tree) {
  2. tree.Value = function (value) {
  3. this.value = value;
  4. this.is = 'value';
  5. };
  6. tree.Value.prototype = {
  7. eval: function (env) {
  8. if (this.value.length === 1) {
  9. return this.value[0].eval(env);
  10. } else {
  11. return new(tree.Value)(this.value.map(function (v) {
  12. return v.eval(env);
  13. }));
  14. }
  15. },
  16. toCSS: function (env) {
  17. return this.value.map(function (e) {
  18. return e.toCSS(env);
  19. }).join(env.compress ? ',' : ', ');
  20. }
  21. };
  22. })(require('../tree'));