electrodb 3.4.0 → 3.4.2

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.d.ts CHANGED
@@ -2537,7 +2537,6 @@ export interface QueryOptions {
2537
2537
  logger?: ElectroEventListener;
2538
2538
  data?: "raw" | "includeKeys" | "attributes";
2539
2539
  order?: "asc" | "desc";
2540
-
2541
2540
  consistent?: boolean;
2542
2541
  }
2543
2542
 
@@ -3564,15 +3563,21 @@ export interface NumberSetAttribute {
3564
3563
  readonly watch?: ReadonlyArray<string> | "*";
3565
3564
  }
3566
3565
 
3567
- type CustomAttributeTypeName<T> = { readonly [CustomAttributeSymbol]: T };
3566
+ interface CustomAttributeTypeName<T> {
3567
+ readonly [CustomAttributeSymbol]: T;
3568
+ }
3569
+
3570
+ interface CustomPrimitiveTypeName<T> {
3571
+ readonly [OpaquePrimitiveSymbol]: T;
3572
+ }
3568
3573
 
3569
- type OpaquePrimitiveTypeName<T extends string | number | boolean> =
3574
+ export type OpaquePrimitiveTypeName<T extends string | number | boolean> =
3570
3575
  T extends string
3571
- ? "string" & { readonly [OpaquePrimitiveSymbol]: T }
3576
+ ? "string" & CustomPrimitiveTypeName<T>
3572
3577
  : T extends number
3573
- ? "number" & { readonly [OpaquePrimitiveSymbol]: T }
3578
+ ? "number" & CustomPrimitiveTypeName<T>
3574
3579
  : T extends boolean
3575
- ? "boolean" & { readonly [OpaquePrimitiveSymbol]: T }
3580
+ ? "boolean" & CustomPrimitiveTypeName<T>
3576
3581
  : never;
3577
3582
 
3578
3583
  type CustomAttribute = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electrodb",
3
- "version": "3.4.0",
3
+ "version": "3.4.2",
4
4
  "description": "A library to more easily create and interact with multiple entities and heretical relationships in dynamodb",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/entity.js CHANGED
@@ -943,9 +943,6 @@ class Entity {
943
943
  response.Item,
944
944
  config,
945
945
  );
946
- if (Object.keys(results).length === 0 && !config._objectOnEmpty) {
947
- results = null;
948
- }
949
946
  } else if (!config._objectOnEmpty) {
950
947
  results = null;
951
948
  }
@@ -965,9 +962,7 @@ class Entity {
965
962
  item,
966
963
  config,
967
964
  );
968
- if (Object.keys(record).length > 0 || config._objectOnEmpty) {
969
- results.push(record);
970
- }
965
+ results.push(record);
971
966
  }
972
967
  }
973
968
  } else if (response.Attributes) {
@@ -1732,9 +1727,6 @@ class Entity {
1732
1727
 
1733
1728
  if (Array.isArray(option.attributes)) {
1734
1729
  config.attributes = config.attributes.concat(option.attributes);
1735
- if (config.attributes.length > 0) {
1736
- config._objectOnEmpty = true;
1737
- }
1738
1730
  }
1739
1731
 
1740
1732
  if (option.preserveBatchOrder === true) {