mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
fix: Fix functions[] validation (ignore null values)
This commit is contained in:
parent
daee1d5375
commit
922ec0093f
@ -211,6 +211,10 @@ class Service {
|
||||
);
|
||||
}
|
||||
Object.entries(this.functions).forEach(([functionName, functionObj]) => {
|
||||
if (functionObj == null) {
|
||||
delete this.functions[functionName];
|
||||
return;
|
||||
}
|
||||
if (!_.isObject(functionObj)) {
|
||||
throw new ServerlessError(
|
||||
`Unexpected "${functionName}" function configuration: Expected object received ${util.inspect(
|
||||
|
||||
@ -135,7 +135,7 @@ describe('Service', () => {
|
||||
command: 'package',
|
||||
configExt: {
|
||||
functions: {
|
||||
bar: null,
|
||||
bar: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user