Add deprecation util for the sprintf and vsprintf functions

pull/479/head
Jorik Tangelder 8 years ago
parent 7c03e8383e
commit 026a9f0ded

@ -530,11 +530,9 @@ words(" ")
#### sprintf(string format, ...arguments) => string
C like string formatting.
Credits goes to [Alexandru Marasteanu][o].
For more detailed documentation, see the [original page][o].
C like string formatting. Makes use of the [sprintf-js](https://npmjs.org/package/sprintf-js) package.
[o]: http://www.diveintojavascript.com/projects/javascript-sprintf
**This function will be removed in the next major release, use the [sprintf-js](https://npmjs.org/package/sprintf-js) package instead.**
```javascript
sprintf("%.1f", 1.17);

@ -61,6 +61,7 @@
}
},
"dependencies": {
"sprintf-js": "^1.0.3"
"sprintf-js": "^1.0.3",
"util-deprecate": "^1.0.2"
}
}

@ -1 +1,4 @@
module.exports = require('sprintf-js').sprintf;
var deprecate = require('util-deprecate');
module.exports = deprecate(require('sprintf-js').sprintf,
'sprintf() will be removed in the next major release, use the sprintf-js package instead.');

@ -1 +1,4 @@
module.exports = require('sprintf-js').vsprintf;
var deprecate = require('util-deprecate');
module.exports = deprecate(require('sprintf-js').vsprintf,
'vsprintf() will be removed in the next major release, use the sprintf-js package instead.');

Loading…
Cancel
Save