Skip to content

Commit

Permalink
Fix documentation and only check relative path regex at start of path
Browse files Browse the repository at this point in the history
  • Loading branch information
amosyuen committed Dec 15, 2017
1 parent 0d87192 commit 9bc08ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ An array of extensions that will be stripped from file paths. Defaults to the `e
[
"module-resolver",
{
"extensions": [".js", ".jsx", ".es", ".es6", ".mjs"]
"stripExtensions": [".js", ".jsx", ".es", ".es6", ".mjs"]
}
]
]
Expand Down
4 changes: 4 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export function toPosixPath(modulePath) {
return modulePath.replace(/\\/g, '/');
}

export function isRelativePath(nodePath) {
return nodePath.match(/^\.?\.\//);
}

export function toLocalPath(modulePath) {
return modulePath
.replace(/\/index$/, '') // remove trailing /index
Expand Down

0 comments on commit 9bc08ac

Please sign in to comment.