Search code examples
responselodashfetchclone

'cloneDeep' of 'lodash' vs 'clone' method of Response in 'Fetch API'


I want to know the difference between cloning a response object resolved by Fetch API using response.clone() and cloneDeep(response) (using cloneDeep method of lodash library)

The reason I ask this is because of this question raised by me earlier. click here


Solution

  • I don't think lodash supports copying stream objects which Response has one for the response body. There also could be hidden properties that lodash can't see that the user agent manages behind the scenes.