Skip to content

Commit e3a5d18

Browse files
fix: replace deprecated String.prototype.substr() (#155)
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher <[email protected]>
1 parent 837831a commit e3a5d18

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/ini.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,8 @@ const unsafe = (val, doUnesc) => {
182182
if (isQuoted(val)) {
183183
// remove the single quotes before calling JSON.parse
184184
if (val.charAt(0) === "'") {
185-
val = val.substr(1, val.length - 2)
185+
val = val.slice(1, -1)
186186
}
187-
188187
try {
189188
val = JSON.parse(val)
190189
} catch (_) {}

0 commit comments

Comments
 (0)