Addresses issue #69. Original code had a bug in it where it'd append a second .js extension if the path already had an extension, rather than appending the extension if the path didn't already have an extension.
I also went ahead and added handling for .json as well, since require.resolve() does the same.
Addresses issue #69. Original code had a bug in it where it'd append a second
.js
extension if the path already had an extension, rather than appending the extension if the path didn't already have an extension.I also went ahead and added handling for
.json
as well, sincerequire.resolve()
does the same.