Background
Currently site.queryPages using array.filter() to filter the queried pages, which does return a new array, but which will in the end contain shallow copy of the page objects.
On one hand it's a powerful tool that allows modifying the pages data, but it also may introduce an unexpected behavior introduced by directly modifying the pages data.
What to do
Ensure that page objects are deep cloned before returning them using site.queryPages.
Background
Currently
site.queryPagesusing array.filter() to filter the queried pages, which does return a new array, but which will in the end contain shallow copy of the page objects.On one hand it's a powerful tool that allows modifying the pages data, but it also may introduce an unexpected behavior introduced by directly modifying the pages data.
What to do
Ensure that page objects are deep cloned before returning them using
site.queryPages.