pinojs / quick-format-unescaped

Solves a problem with util.format
MIT License
17 stars 13 forks source link

Compatibility with util.format #38

Open alexpts opened 3 years ago

alexpts commented 3 years ago

I have some problem with format. This is not convenient for testing

Example:

let util = require('util');
let format = require('quick-format-unescaped');

let a = util.format('foo %o', {name: "alex"}); // foo { name: 'alex' }
let b = format('foo %o', [{name: "alex"}]); // foo {"name":"alex"}

a === b // false

Is it possible add option for change formatting?