How to use the snyk-policy.demunge function in snyk-policy

To help you get started, we’ve selected a few snyk-policy 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 snyk / snyk / src / lib / display-policy.ts View on Github external
export async function display(policy) {
  const p = demunge(policy, config.ROOT);
  let res =
    chalk.bold(
      'Current Snyk policy, read from ' + policy.__filename + ' file',
    ) + '\n';
  res += 'Modified: ' + policy.__modified + '\n';
  res += 'Created:  ' + policy.__created + '\n';

  res += p.patch.map(displayRule('Patch vulnerability')).join('\n');
  if (p.patch.length && p.ignore.length) {
    res += '\n\n------------------------\n';
  }
  res += p.ignore.map(displayRule('Ignore')).join('\n');

  return Promise.resolve(res);
}

snyk-policy

Snyk's policy parser and matching logic

Apache-2.0
Latest version published 11 hours ago

Package Health Score

78 / 100
Full package analysis