I slightly modified the test that you requested. I narrowed the type of one["img-src"] to an array of ContentSecurityPolicyDirectiveValue in order to have access to the push method. So I had to export the ContentSecurityPolicyDirectiveValue type.
In this 7b1a20a the original code written using the spread operator fails the test.
While this one acf4268 which utilizes the structuredClone API passes the test.
I slightly modified the test that you requested. I narrowed the type of
one["img-src"]
to an array ofContentSecurityPolicyDirectiveValue
in order to have access to the push method. So I had to export theContentSecurityPolicyDirectiveValue
type. In this 7b1a20a the original code written using the spread operator fails the test. While this one acf4268 which utilizes thestructuredClone
API passes the test.