Skip to content

Commit a173abe

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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class Walker extends EE {
6464
this.entries = entries
6565
if (entries.length === 0) {
6666
if (this.includeEmpty) {
67-
this.result.add(this.path.substr(this.root.length + 1))
67+
this.result.add(this.path.slice(this.root.length + 1))
6868
}
6969
this.emit('done', this.result)
7070
} else {
@@ -156,7 +156,7 @@ class Walker extends EE {
156156
const abs = this.path + '/' + entry
157157
if (!st.isDirectory()) {
158158
if (file) {
159-
this.result.add(abs.substr(this.root.length + 1))
159+
this.result.add(abs.slice(this.root.length + 1))
160160
}
161161
then()
162162
} else {

0 commit comments

Comments
 (0)