Skip to content

Commit

Permalink
feat: add stack to deprecate message
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Oct 12, 2020
1 parent 30d6a2b commit 01265d0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions public/src/utils.js
Expand Up @@ -343,10 +343,11 @@

// http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript/
slugify: function (str, preserveCase) {
var stack = new Error('utils.slugify').stack.split('\n')[1];
if (typeof module === 'object' && module.exports) {
console.warn('[deprecated] utils.slugify deprecated. Use `require("slugify")` instead');
console.warn('[deprecated] utils.slugify deprecated. Use `require("slugify")` instead.\n' + stack);
} else {
console.warn('[deprecated] utils.slugify deprecated. Use `require(["slugify"], function (slugify) { ... })` instead');
console.warn('[deprecated] utils.slugify deprecated. Use `require(["slugify"], function (slugify) { ... })` instead.\n' + stack);
}

if (!str) {
Expand Down

0 comments on commit 01265d0

Please sign in to comment.