Show a message if cloud functions are duplicated (#6963)

* Update triggers.js

* Update CloudCode.spec.js

* Logger changes

* Update CloudCode.spec.js
This commit is contained in:
dblythy
2020-10-23 12:06:25 +11:00
committed by GitHub
parent 7b7dd48c25
commit 68a1b30275
2 changed files with 20 additions and 0 deletions

View File

@@ -98,6 +98,11 @@ function getStore(category, name, applicationId) {
function add(category, name, handler, applicationId) {
const lastComponent = name.split('.').splice(-1);
const store = getStore(category, name, applicationId);
if (store[lastComponent]) {
logger.warn(
`Warning: Duplicate cloud functions exist for ${lastComponent}. Only the last one will be used and the others will be ignored.`
);
}
store[lastComponent] = handler;
}