You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to have the message string as a template against the other properties of the object... (suggest ES6 string template format, lodash has an implementation)
example:
errors.create({name: 'DocumentNotFound',message: 'The document "${document}" was not found.'});console.log(newerrors.DocumentNotFound({document: 'path/to/document.ext'}))
would output:
code: 6xx
name: 'DocumentNotFound'
message: 'The document "path/to/document.ext" was not found'
//using lodash's _.template
...
if((/\$\{[^\}]+\}/).test(this.message)){this.message=_.template(this.message,this);}}//end of constructor method
Making lodash a dependency without a version specified to allow for npm dedupe in a hosting package to always work, with a very slim risk of an incompatible version.
The text was updated successfully, but these errors were encountered:
It would be nice to have the message string as a template against the other properties of the object... (suggest ES6 string template format, lodash has an implementation)
example:
would output:
Idea burrowed from error/typed
Making lodash a dependency without a version specified to allow for
npm dedupe
in a hosting package to always work, with a very slim risk of an incompatible version.The text was updated successfully, but these errors were encountered: