Skip to content

Doesn't clone npm modules #112

Description

@narayanmp

I am trying to clone an npm object like below.

const obj1 = clone( require('an-npm-module'));
const obj2 = clone( require('an-npm-module'));

But after doing operations on both, the changes are reflected in both objects. I am doing this because the same npm is used by parent and other npm modules and I want their own copies to avoid other issues.

Based on the documentation it looks like clone supports deep copy by default. Any help in achieving it is appreciated.

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