contentful / contentful-resolve-response

Resolve items & includes of a Contentful API response into a proper object graph
MIT License
54 stars 15 forks source link

resolveResponse() mutates its input #192

Open jrr opened 1 year ago

jrr commented 1 year ago

Despite going through the trouble of making a copy:

https://github.com/contentful/contentful-resolve-response/blob/c6ef5713665dd08e19b1d537c96e8c88b385166e/index.js#L155

It seems that resolveResponse() is mutating its input.

See associated PR for a failing test.

jrr commented 1 year ago

Here's a one-line changes that fixes the unit test, but I haven't tested the change with a real app:

https://github.com/jrr/contentful-resolve-response/commit/e24524a983c7c3350df1a77715c924c58024f4a4