rotorise 0.3.3 → 0.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.
@@ -1,8 +1,14 @@
1
1
  // Lighter Exact implementation — catches excess top-level properties only.
2
2
  // Does not recursively check nested objects/arrays. This is intentional:
3
3
  // DynamoDB entity shapes are flat at the key level.
4
+ // Uses DistributiveKeyof so that union-typed Shape (discriminated unions)
5
+ // exposes keys from ALL variants, not just the common keys.
6
+ type DistributiveKeyof<T> = T extends unknown ? keyof T : never
7
+
4
8
  type Exact<Shape, Candidate> = Candidate & {
5
- [K in keyof Candidate]: K extends keyof Shape ? Candidate[K] : never
9
+ [K in keyof Candidate]: K extends DistributiveKeyof<Shape>
10
+ ? Candidate[K]
11
+ : never
6
12
  }
7
13
 
8
14
  type ValueOf<
@@ -1,8 +1,14 @@
1
1
  // Lighter Exact implementation — catches excess top-level properties only.
2
2
  // Does not recursively check nested objects/arrays. This is intentional:
3
3
  // DynamoDB entity shapes are flat at the key level.
4
+ // Uses DistributiveKeyof so that union-typed Shape (discriminated unions)
5
+ // exposes keys from ALL variants, not just the common keys.
6
+ type DistributiveKeyof<T> = T extends unknown ? keyof T : never
7
+
4
8
  type Exact<Shape, Candidate> = Candidate & {
5
- [K in keyof Candidate]: K extends keyof Shape ? Candidate[K] : never
9
+ [K in keyof Candidate]: K extends DistributiveKeyof<Shape>
10
+ ? Candidate[K]
11
+ : never
6
12
  }
7
13
 
8
14
  type ValueOf<
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rotorise",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Supercharge your DynamoDB with Rotorise!",
5
5
  "main": "dist/Rotorise.cjs",
6
6
  "types": "dist/Rotorise.d.ts",
@@ -36,7 +36,7 @@
36
36
  "scripts": {
37
37
  "build": "tsup",
38
38
  "test": "vitest",
39
- "format": "biome lint --write ",
39
+ "format": "biome format --write ./src ",
40
40
  "format:ci": "biome ci ./src",
41
41
  "check": "tsc --noEmit"
42
42
  },