How to use the private/core.print function in private

To help you get started, we’ve selected a few private examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github seedjs / seed / lib / commands / config.js View on Github external
function pp(obj, indent) {
  var v, key;

  
  if (!indent) indent = '';

  if (obj===undefined) return;
  
  if (isHash(obj)) {
    CORE.println('');
    for(key in obj) {
      if (!obj.hasOwnProperty(key)) continue;
      v = obj[key];
      CORE.print(indent+key+': ');
      if (isHash(v) || isArray(v)) {
        pp(v, indent+'  ');
      } else {
        CORE.println(v);
      }
    }
  } else if (isArray(obj)) {
    if (obj.some(function(x) { return isHash(x) || isArray(x); })) {
      obj.forEach(function(x) { 
        pp(x, indent+'  ');
        CORE.println('');
      });
    } else {
      CORE.print(obj.join(', '));
    }
  } else {
github seedjs / seed / lib / commands / config.js View on Github external
v = obj[key];
      CORE.print(indent+key+': ');
      if (isHash(v) || isArray(v)) {
        pp(v, indent+'  ');
      } else {
        CORE.println(v);
      }
    }
  } else if (isArray(obj)) {
    if (obj.some(function(x) { return isHash(x) || isArray(x); })) {
      obj.forEach(function(x) { 
        pp(x, indent+'  ');
        CORE.println('');
      });
    } else {
      CORE.print(obj.join(', '));
    }
  } else {
    CORE.println(indent+obj);
  }
}