@sd-jwt/types 0.17.2-next.0 → 0.17.2-next.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/package.json +2 -2
- package/src/type.ts +25 -23
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sd-jwt/types",
|
|
3
|
-
"version": "0.17.2-next.
|
|
3
|
+
"version": "0.17.2-next.2+4a4c1b0",
|
|
4
4
|
"description": "sd-jwt draft 7 implementation in typescript",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"esm"
|
|
53
53
|
]
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "4a4c1b0c04615bcf0e455d51cd1b9234cbcd0d78"
|
|
56
56
|
}
|
package/src/type.ts
CHANGED
|
@@ -165,20 +165,21 @@ export type DECOY = { [SD_DECOY]?: number };
|
|
|
165
165
|
* }
|
|
166
166
|
*
|
|
167
167
|
*/
|
|
168
|
-
type Frame<Payload> =
|
|
169
|
-
|
|
170
|
-
?
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
168
|
+
type Frame<Payload> =
|
|
169
|
+
Payload extends Array<infer U>
|
|
170
|
+
? U extends object
|
|
171
|
+
? Record<number, Frame<U>> & SD<Payload> & DECOY
|
|
172
|
+
: SD<Payload> & DECOY
|
|
173
|
+
: Payload extends Record<string, unknown>
|
|
174
|
+
? NonNever<
|
|
175
|
+
{
|
|
176
|
+
[K in keyof Payload]?: NonNullable<Payload[K]> extends object
|
|
177
|
+
? Frame<Payload[K]>
|
|
178
|
+
: never;
|
|
179
|
+
} & SD<Payload> &
|
|
180
|
+
DECOY
|
|
181
|
+
>
|
|
182
|
+
: SD<Payload> & DECOY;
|
|
182
183
|
|
|
183
184
|
/**
|
|
184
185
|
* This is a disclosureFrame type that is used to represent the structure of what is being disclosed.
|
|
@@ -230,14 +231,15 @@ export type DisclosureFrame<T extends Extensible> = Frame<T>;
|
|
|
230
231
|
data2: true,
|
|
231
232
|
};
|
|
232
233
|
*/
|
|
233
|
-
type PFrame<Payload> =
|
|
234
|
-
|
|
235
|
-
?
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
234
|
+
type PFrame<Payload> =
|
|
235
|
+
Payload extends Array<infer U>
|
|
236
|
+
? U extends object
|
|
237
|
+
? Record<number, PFrame<U> | boolean> | boolean
|
|
238
|
+
: Record<number, boolean> | boolean
|
|
239
|
+
: {
|
|
240
|
+
[K in keyof Payload]?: NonNullable<Payload[K]> extends object
|
|
241
|
+
? PFrame<Payload[K]> | boolean
|
|
242
|
+
: boolean;
|
|
243
|
+
};
|
|
242
244
|
|
|
243
245
|
export type PresentationFrame<T extends Extensible> = PFrame<T>;
|