sprintf.js icon indicating copy to clipboard operation
sprintf.js copied to clipboard

Configurable errors

Open ArmorDarks opened this issue 10 years ago • 0 comments

It would be great to have possibility to switch off errors for empty placeholders in some cases

Especially in case of named placeholders, since, actually, they are the only one type of placeholders, which throw error:

Error: [sprintf] property 'val' does not exist

It's possible to make it configurable, just like I've described it in my comment here:

https://github.com/alexei/sprintf.js/issues/49#issuecomment-148887605

Or on sprontf() function invocation:

sprintf = require('sprintf-js').sprintf({
  errorOnUndefined: false
})

ArmorDarks avatar Oct 30 '15 20:10 ArmorDarks