How to use the indent-string.default function in indent-string

To help you get started, we’ve selected a few indent-string 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 uber / xviz / modules / cli / src / cmds / validate.js View on Github external
function printValidationError(msgType, err, msg, args) {
  if (msg && displayType(msgType, args)) {
    // TODO(jlisee): look into ajv-errors package to simplify this output
    const msgStr = indentString(JSON.stringify(msg, null, 4), 4);
    const errStr = indentString(err.toString(), 4);
    console.log(`VALIDATION ERROR:\n  TYPE: ${msgType}\n  DETAILS:\n${errStr}\n  MSG:\n${msgStr}`);
  }
}
github uber / xviz / modules / cli / src / cmds / validate.js View on Github external
function printValidationError(msgType, err, msg, args) {
  if (msg && displayType(msgType, args)) {
    // TODO(jlisee): look into ajv-errors package to simplify this output
    const msgStr = indentString(JSON.stringify(msg, null, 4), 4);
    const errStr = indentString(err.toString(), 4);
    console.log(`VALIDATION ERROR:\n  TYPE: ${msgType}\n  DETAILS:\n${errStr}\n  MSG:\n${msgStr}`);
  }
}

indent-string

Indent each line in a string

MIT
Latest version published 3 years ago

Package Health Score

70 / 100
Full package analysis

Popular indent-string functions