diff --git a/util.js b/util.js index 6eea657..6db393e 100644 --- a/util.js +++ b/util.js @@ -410,7 +410,7 @@ function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { if (array) { str = str.split('\n').map(function(line) { return ' ' + line; - }).join('\n').substr(2); + }).join('\n').slice(2); } else { str = '\n' + str.split('\n').map(function(line) { return ' ' + line; @@ -427,7 +427,7 @@ function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { } name = JSON.stringify('' + key); if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { - name = name.substr(1, name.length - 2); + name = name.slice(1, -1); name = ctx.stylize(name, 'name'); } else { name = name.replace(/'/g, "\\'")