UNPKG

openapi-contract-validator-server

Version:

Use an HTTP proxy to validate HTTP interactions against an OpenAPI Schema

24 lines (20 loc) 434 B
/** * @module logger */ const c = require('ansi-colors'); const INDENT = ' │ '; exports.maxDepth = 10; /** * @param {number} depth * @param {string} message */ function log(depth, message) { if (depth >= exports.maxDepth) { return; } message.split('\n') .forEach((line) => { console.log(c.grey(INDENT.repeat(depth)) + line); }); } exports.log = log;