const _x25519Expected = { kid : 'urn:123' , alg : 'ECDH-ES+A256KW' , crv : 'X25519' , kty : 'OKP' } ; export function isRecipient ( { recipient , expected = _x25519Expected } ) { const { kid , alg , crv , kty } = expected ; expect ( recipient ) . toBeInstanceOf ( Object ) ; expect ( recipient . header ) . toBeDefined ( ) ; expect ( recipient . header ) . toBeInstanceOf ( Object ) ; const { header } = recipient ; expect ( header . kid ) . toBeDefined ( ) ; expect ( typeof header . kid ) . toBeDefined ( ) ; expect ( header . kid ) . toBe ( kid ) ; expect ( header . alg ) . toBeDefined ( ) ; expect ( typeof header . alg ) . toBeDefined ( ) ; expect ( header . alg ) . toBe ( alg ) ; expect ( header . apu ) . toBeDefined ( ) ; expect ( typeof header . apu ) . toBeDefined ( ) ; expect ( header . apv ) . toBeDefined ( ) ; expect ( typeof header . apv ) . toBeDefined ( ) ; expect ( header . epk ) . toBeDefined ( ) ; expect ( header . epk ) . toBeInstanceOf ( Object ) ; expect ( header . epk . crv ) . toBeDefined ( ) ; expect ( typeof header . epk . crv ) . toBeDefined ( ) ; expect ( header . epk . crv ) . toBe ( crv ) ; expect ( header . epk . kty ) . toBeDefined ( ) ; expect ( typeof header . epk . kty ) . toBeDefined ( ) ; expect ( header . epk . kty ) . toBe ( kty ) ; expect ( header . epk . x ) . toBeDefined ( ) ; expect ( typeof header . epk . x ) . toBeDefined ( ) ; }