Skip to content

site.queryPages is returning shallow copy of the pages instead of deep cloning #207

@Manvel

Description

@Manvel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions