Awilix dependencies parser fails to detect factory function that is declared using arrow function with single parameter and no bracket enclosing the parameter.
How to reproduce:
Using CLASSIC resolution mode, declare following service. It will fail to parse the dependencies.
module.exports = config => {
return {
a: (b, c) => b
};
}
But service below will work (notice brackets that enclose the parameter):
module.exports = (config) => {
return {
a: (b, c) => b
};
}
I suspect this line causes the problem.
const DEPS_EXPR = /(\(\s*([^)]+?)\s*\)|\(\))/
Awilix version: 2.6.0
Node version: 8.2.1
Awilix dependencies parser fails to detect factory function that is declared using arrow function with single parameter and no bracket enclosing the parameter.
How to reproduce:
Using
CLASSICresolution mode, declare following service. It will fail to parse the dependencies.But service below will work (notice brackets that enclose the parameter):
I suspect this line causes the problem.
Awilix version: 2.6.0
Node version: 8.2.1