electrodb 2.3.2 → 2.3.4
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/README.md +26 -6046
- package/notes +8 -23
- package/package.json +1 -1
- package/src/clauses.js +1 -1
- package/src/entity.js +2 -2
- package/src/util.js +5 -0
package/notes
CHANGED
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- `validate()` - user validation
|
|
10
|
-
|
|
11
|
-
2. items added to clause state via `applyPut`
|
|
12
|
-
3. pk && sk are expected
|
|
13
|
-
put(batch)
|
|
14
|
-
create
|
|
15
|
-
1. checkCreate
|
|
16
|
-
2. items added to clause state via `applyPut`
|
|
17
|
-
upsert
|
|
18
|
-
1. checkCreate
|
|
19
|
-
update
|
|
20
|
-
patch
|
|
21
|
-
remove
|
|
22
|
-
delete
|
|
23
|
-
delete(batch)
|
|
1
|
+
- add hydrate option to query
|
|
2
|
+
- add hydrate option to collection
|
|
3
|
+
- implement hydrate on entity query
|
|
4
|
+
- implement hydrate on collection query
|
|
5
|
+
- add index property to signify only keys are present
|
|
6
|
+
- skip for match/find
|
|
7
|
+
- do not apply automatic filters on queries
|
|
8
|
+
- validate
|
package/package.json
CHANGED
package/src/clauses.js
CHANGED
package/src/entity.js
CHANGED
|
@@ -1494,7 +1494,7 @@ class Entity {
|
|
|
1494
1494
|
update.set(this.identifiers.entity, this.getName());
|
|
1495
1495
|
update.set(this.identifiers.version, this.getVersion());
|
|
1496
1496
|
for (const field of [...Object.keys(upsertAttributes), ...Object.keys(updatedKeys)]) {
|
|
1497
|
-
const value = upsertAttributes[field]
|
|
1497
|
+
const value = u.getFirstDefined(upsertAttributes[field], updatedKeys[field]);
|
|
1498
1498
|
if (!keyNames.includes(field)) {
|
|
1499
1499
|
update.set(field, value);
|
|
1500
1500
|
}
|
|
@@ -3023,7 +3023,7 @@ class Entity {
|
|
|
3023
3023
|
if (sk.isCustom) {
|
|
3024
3024
|
definitions[indexName].sk.push({name, label});
|
|
3025
3025
|
} else {
|
|
3026
|
-
definitions[indexName].sk.push({name, label: fromModel[name]
|
|
3026
|
+
definitions[indexName].sk.push({name, label: u.getFirstDefined(fromModel[name], name) });
|
|
3027
3027
|
}
|
|
3028
3028
|
}
|
|
3029
3029
|
}
|
package/src/util.js
CHANGED
|
@@ -233,6 +233,10 @@ function shiftSortOrder(str = '', codePoint) {
|
|
|
233
233
|
return newString;
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
+
function getFirstDefined(...params) {
|
|
237
|
+
return params.find(val => val !== undefined);
|
|
238
|
+
}
|
|
239
|
+
|
|
236
240
|
module.exports = {
|
|
237
241
|
getUnique,
|
|
238
242
|
batchItems,
|
|
@@ -241,6 +245,7 @@ module.exports = {
|
|
|
241
245
|
removeFixings,
|
|
242
246
|
parseJSONPath,
|
|
243
247
|
shiftSortOrder,
|
|
248
|
+
getFirstDefined,
|
|
244
249
|
getInstanceType,
|
|
245
250
|
getModelVersion,
|
|
246
251
|
formatKeyCasing,
|