Skip to content

Allow to clone expressions #61

Description

@viceice

We currently do some parallel queries and those use some general expressions.
We can't simply reuse them, we need to clone them.
One workaround is to use lodash.deepClone, but i want to get rid of that library.
So for now i always need to recreate the partial expressionen for every query.

sample

import caml from 'camljs';

const w1 = new caml().View(['ID']).Query().Where();
const w2 = new caml().View(['ID']).Query().Where();
const expr = [caml.Expression().IntegerField('FSObjType').EqualTo(1)];

const q1 = w1.All(expr);
const q2 = w2.All(expr);

console.assert(q1.get_viewXml() === q2.get_viewXml(), "Error: query mismatch");

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions