@dereekb/firebase 10.0.8 → 10.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +15 -2
- package/index.esm.js +17 -2
- package/package.json +1 -1
- package/test/CHANGELOG.md +8 -0
- package/test/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -6825,11 +6825,24 @@ function modelFirebaseFunctionMapFactory(configMap, crudConfigMap) {
|
|
|
6825
6825
|
excluded: specifiedCrudFunctionKeys
|
|
6826
6826
|
} = util.separateValues(config, x => x.indexOf(':') === -1);
|
|
6827
6827
|
const crudFunctions = new Set(crudFunctionKeys);
|
|
6828
|
-
const
|
|
6828
|
+
const specifiedCrudFunctionTuples = specifiedCrudFunctionKeys.map(x => {
|
|
6829
6829
|
const [crud, functionsSplit] = x.split(':', 2);
|
|
6830
6830
|
const functions = functionsSplit.split(MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_SPLITTER);
|
|
6831
6831
|
return [crud, functions];
|
|
6832
|
-
})
|
|
6832
|
+
});
|
|
6833
|
+
// check that there isn't a repeat crud key configured, which disallowed configuration and would cause some functions to be ignored
|
|
6834
|
+
const encounteredCruds = new Set();
|
|
6835
|
+
function assertCrudKeyNotEncountered(crud) {
|
|
6836
|
+
if (encounteredCruds.has(crud)) {
|
|
6837
|
+
throw new Error(`Cannot have multiple declarations of the same crud. Found repeat for crud: ${crud}`);
|
|
6838
|
+
} else {
|
|
6839
|
+
encounteredCruds.add(crud);
|
|
6840
|
+
}
|
|
6841
|
+
}
|
|
6842
|
+
crudFunctions.forEach(assertCrudKeyNotEncountered);
|
|
6843
|
+
specifiedCrudFunctionTuples.forEach(([crud]) => assertCrudKeyNotEncountered(crud));
|
|
6844
|
+
// build and add the functions
|
|
6845
|
+
const specifierFunctions = new Map(specifiedCrudFunctionTuples);
|
|
6833
6846
|
function addFunctions(crud, fn, modelType) {
|
|
6834
6847
|
let crudFns;
|
|
6835
6848
|
if (crudFunctions.has(crud)) {
|
package/index.esm.js
CHANGED
|
@@ -7542,11 +7542,26 @@ function modelFirebaseFunctionMapFactory(configMap, crudConfigMap) {
|
|
|
7542
7542
|
excluded: specifiedCrudFunctionKeys
|
|
7543
7543
|
} = separateValues(config, x => x.indexOf(':') === -1);
|
|
7544
7544
|
const crudFunctions = new Set(crudFunctionKeys);
|
|
7545
|
-
const
|
|
7545
|
+
const specifiedCrudFunctionTuples = specifiedCrudFunctionKeys.map(x => {
|
|
7546
7546
|
const [crud, functionsSplit] = x.split(':', 2);
|
|
7547
7547
|
const functions = functionsSplit.split(MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_SPLITTER);
|
|
7548
7548
|
return [crud, functions];
|
|
7549
|
-
})
|
|
7549
|
+
});
|
|
7550
|
+
|
|
7551
|
+
// check that there isn't a repeat crud key configured, which disallowed configuration and would cause some functions to be ignored
|
|
7552
|
+
const encounteredCruds = new Set();
|
|
7553
|
+
function assertCrudKeyNotEncountered(crud) {
|
|
7554
|
+
if (encounteredCruds.has(crud)) {
|
|
7555
|
+
throw new Error(`Cannot have multiple declarations of the same crud. Found repeat for crud: ${crud}`);
|
|
7556
|
+
} else {
|
|
7557
|
+
encounteredCruds.add(crud);
|
|
7558
|
+
}
|
|
7559
|
+
}
|
|
7560
|
+
crudFunctions.forEach(assertCrudKeyNotEncountered);
|
|
7561
|
+
specifiedCrudFunctionTuples.forEach(([crud]) => assertCrudKeyNotEncountered(crud));
|
|
7562
|
+
|
|
7563
|
+
// build and add the functions
|
|
7564
|
+
const specifierFunctions = new Map(specifiedCrudFunctionTuples);
|
|
7550
7565
|
function addFunctions(crud, fn, modelType) {
|
|
7551
7566
|
let crudFns;
|
|
7552
7567
|
if (crudFunctions.has(crud)) {
|
package/package.json
CHANGED
package/test/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [10.0.10](https://github.com/dereekb/dbx-components/compare/v10.0.9-dev...v10.0.10) (2024-01-21)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## [10.0.9](https://github.com/dereekb/dbx-components/compare/v10.0.8-dev...v10.0.9) (2024-01-15)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
5
13
|
## [10.0.8](https://github.com/dereekb/dbx-components/compare/v10.0.7-dev...v10.0.8) (2024-01-14)
|
|
6
14
|
|
|
7
15
|
|