mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
SerializerFileSystem: check for function name uniqueness across project
This commit is contained in:
parent
80d47ac525
commit
96c59ee22d
@ -249,9 +249,13 @@ class SerializerFileSystem {
|
||||
return func.load()
|
||||
.then(function(instance) {
|
||||
|
||||
if (component.functions[instance.name]) {
|
||||
// Check for function name uniqueness across project
|
||||
let components = component.getProject().getAllComponents();
|
||||
components.forEach(function(c) {
|
||||
if (c.functions[instance.name]) {
|
||||
throw new SError(`Function name is already taken in project: ${instance.name} Function names must be unique across a project as of Serverless v0.5`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
component.functions[instance.name] = instance;
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user