quick-format-unescaped
quick-format-unescaped copied to clipboard
Breaking: take in custom formatter option
See https://github.com/pinojs/pino/issues/1376
Changes:
- instead of a default
formatfunction, export a builder for the format function instead (this is the breaking bit, and is needed to make this library configurable; I was not able to get it to work using the trick mentioned in the other thread) - take in a custom
formattersopt and run interpolation with it (the actual feature bit) - using predefined consts instead of using magic numbers (please feel free to revert this should you feel the need to)
- tons of code formatting, I'm really sorry about this, I was too weak to stop vscode/prettier
@davidmarkclements bump? https://github.com/pinojs/pino/issues/1376
You can make this non-breaking by doing:
function build(opts) { ... }
const formatter = build(theDefaultOpts)
module.exports = formatter
module.exports.build = build
hey thanks for this
- let’s not break the API if we don’t need to, @mcollina suggestions seems good to me
- 👍
- 👍
- If any code formatting is applied it will need to be
standardlinting or else originally formatted before we can merge