Skip to content

Commit 71fd0e7

Browse files
authored
Merge pull request #82 from Dwolla/DEV-925
DEV-925: Replace `indexOf()` in favor of `startsWith()`
2 parents 4a3cd17 + 24321ef commit 71fd0e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/dwolla/Token.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ function getUrl(token, suppliedPath, suppliedQuery) {
3131
var url;
3232
if (typeof suppliedPath === "object") {
3333
url = suppliedPath._links.self.href;
34-
} else if (suppliedPath.indexOf(token.client.apiUrl) === 0) {
34+
} else if (suppliedPath.startsWith(token.client.apiUrl)) {
3535
url = suppliedPath;
36-
} else if (suppliedPath.indexOf("/") === 0) {
36+
} else if (suppliedPath.startsWith("/")) {
3737
url = [token.client.apiUrl, suppliedPath].join("");
3838
} else {
3939
url = [

0 commit comments

Comments
 (0)