Skip to content

Z-Schema deep cloning #213

@littlejedi

Description

@littlejedi

Hi there,
We've been using Sway in our project, and during memory profiling, we've found the following line that's taking a lot of time (in lib/helper.js)

module.exports.validateAgainstSchema = function (validator, schema, value, schemaPath, isResponse, options) {
schema = _.cloneDeep(schema); // Clone the schema as z-schema alters the provided document

I'm curious as to why z-schema alters the provided schema, could you provide an example where schema is modified? We are looking for a way to either improve deep clone performance or get rid of it

Thank you very much

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