jarradseers/express-load — pull request #25 by NitroPye (2014-05-01 01:35:30+00:00)
Title: Fixing bad ! conditional in if statement checking for a RegExp or not

With no options passed to express-load the initial options.extlist never gets converted to a RegExp properly due to a bad if conditional.

This PR makes a tiny change to that if so that the default extlist gets converted to a RegExp. I assume this is the intended behavior.

This stack is thrown:

```
{
"date": "Wed Apr 30 2014 18:31:21 GMT-0700 (PDT)",
"process": {
"pid": 16988,
"uid": 502,
"gid": 20,
"cwd": "/Users/_user_/Documents/Work/_project_",
"execPath": "/usr/local/Cellar/node/0.10.26/bin/node",
"version": "v0.10.26",
"argv": [
"node",
"/Users/_user_/Documents/Work/_project_/lib/server.js"
],
"memoryUsage": {
"rss": 29999104,
"heapTotal": 28055552,
"heapUsed": 10749448
}
},
"os": {
"loadavg": [
2.0615234375,
1.90234375,
1.84228515625
],
"uptime": 13155
},
"trace": [
{
"column": 91,
"file": "/Users/_user_/Documents/Work/_project_/node_modules/express-load/lib/express-load.js",
"function": "ExpressLoad.then",
"line": 107,
"method": "then",
"native": false
},
{
"column": 8,
"file": "/Users/_user_/Documents/Work/_project_/node_modules/express-load/lib/express-load.js",
"function": "new ExpressLoad",
"line": 58,
"method": null,
"native": false
},
{
"column": 10,
"file": "/Users/_user_/Documents/Work/_project_/node_modules/express-load/lib/express-load.js",
"function": "module.exports",
"line": 287,
"method": "exports",
"native": false
},
{
"column": 1,
"file": "/Users/_user_/Documents/Work/_project_/lib/server.js",
"function": "",
"line": 171,
"method": null,
"native": false
},
{
"column": 26,
"file": "module.js",
"function": "Module._compile",
"line": 456,
"method": "_compile",
"native": false
},
{
"column": 10,
"file": "module.js",
"function": "Object.Module._extensions..js",
"line": 474,
"method": "Module._extensions..js",
"native": false
},
{
"column": 32,
"file": "module.js",
"function": "Module.load",
"line": 356,
"method": "load",
"native": false
},
{
"column": 12,
"file": "module.js",
"function": "Function.Module._load",
"line": 312,
"method": "Module._load",
"native": false
},
{
"column": 10,
"file": "module.js",
"function": "Function.Module.runMain",
"line": 497,
"method": "Module.runMain",
"native": false
},
{
"column": 16,
"file": "node.js",
"function": "startup",
"line": 119,
"method": null,
"native": false
}
],
"stack": [
"TypeError: Object .js,.node,.json,.coffee,.sjs has no method 'test'",
" at ExpressLoad.then (/Users/_user_/Documents/Work/_project_/node_modules/express-load/lib/express-load.js:107:91)",
" at new ExpressLoad (/Users/_user_/Documents/Work/_project_/node_modules/express-load/lib/express-load.js:58:8)",
" at module.exports (/Users/_user_/Documents/Work/_project_/node_modules/express-load/lib/express-load.js:287:10)",
" at Object. (/Users/_user_/Documents/Work/_project_/lib/server.js:171:1)",
" at Module._compile (module.js:456:26)",
" at Object.Module._extensions..js (module.js:474:10)",
" at Module.load (module.js:356:32)",
" at Function.Module._load (module.js:312:12)",
" at Function.Module.runMain (module.js:497:10)",
" at startup (node.js:119:16)"
],
"level": "error",
"message": "uncaughtException: Object .js,.node,.json,.coffee,.sjs has no method 'test'"
}
```