Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to use default require.extensions #138

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = function resolve(x, options, callback) {
var isFile = opts.isFile || defaultIsFile;
var readFile = opts.readFile || fs.readFile;

var extensions = opts.extensions || ['.js'];
var extensions = opts.extensions || Object.keys(require.extensions);
var basedir = opts.basedir || path.dirname(caller());

opts.paths = opts.paths || [];
Expand Down
2 changes: 1 addition & 1 deletion lib/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = function (x, options) {
var isFile = opts.isFile || defaultIsFile;
var readFileSync = opts.readFileSync || fs.readFileSync;

var extensions = opts.extensions || ['.js'];
var extensions = opts.extensions || Object.keys(require.extensions);
var basedir = opts.basedir || path.dirname(caller());

opts.paths = opts.paths || [];
Expand Down
4 changes: 2 additions & 2 deletions readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ default `opts` values:
{
paths: [],
basedir: __dirname,
extensions: [ '.js' ],
extensions: Object.keys(require.extensions),
readFile: fs.readFile,
isFile: function isFile(file, cb) {
fs.stat(file, function (err, stat) {
Expand Down Expand Up @@ -136,7 +136,7 @@ default `opts` values:
{
paths: [],
basedir: __dirname,
extensions: [ '.js' ],
extensions: Object.keys(require.extensions),
readFileSync: fs.readFileSync,
isFile: function isFile(file) {
try {
Expand Down