Commit f7898a9 1 parent e8d366a commit f7898a9 Copy full SHA for f7898a9
File tree 1 file changed +2
-10
lines changed
1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -47,14 +47,6 @@ function isJWKLike(key: unknown) {
47
47
return isObject < types . JWK > ( key )
48
48
}
49
49
50
- function clone < T > ( obj : T ) : T {
51
- if ( typeof structuredClone === 'function' ) {
52
- return structuredClone ( obj )
53
- }
54
-
55
- return JSON . parse ( JSON . stringify ( obj ) )
56
- }
57
-
58
50
class LocalJWKSet {
59
51
#jwks: types . JSONWebKeySet
60
52
@@ -65,7 +57,7 @@ class LocalJWKSet {
65
57
throw new JWKSInvalid ( 'JSON Web Key Set malformed' )
66
58
}
67
59
68
- this . #jwks = clone < types . JSONWebKeySet > ( jwks )
60
+ this . #jwks = structuredClone < types . JSONWebKeySet > ( jwks )
69
61
}
70
62
71
63
jwks ( ) : types . JSONWebKeySet {
@@ -261,7 +253,7 @@ export function createLocalJWKSet(
261
253
262
254
Object . defineProperties ( localJWKSet , {
263
255
jwks : {
264
- value : ( ) => clone ( set . jwks ( ) ) ,
256
+ value : ( ) => structuredClone ( set . jwks ( ) ) ,
265
257
enumerable : false ,
266
258
configurable : false ,
267
259
writable : false ,
You can’t perform that action at this time.
0 commit comments