You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to completely deep clone a JSDOM object? So you could make changes (add/delete nodes, change id's, etc) without affecting the original dom.
Example:
constjsdom=require("jsdom");constpage=newJSDOM(`<html> <head></head> <body> <div id='original_id'></div> </body></html>`);constpage2=page.clone();// Does something like this exist?// Make modifications to page2 without them affecting page page2.window.document.querySelector('div').id='new_id';console.log("page1 id: ",page1.window.document.querySelector('div').id);console.log("page2 id: ",page2.window.document.querySelector('div').id);
Expected output:
page1 id: original_id
page2 id: new_id
The text was updated successfully, but these errors were encountered:
Is there a way to completely deep clone a JSDOM object? So you could make changes (add/delete nodes, change id's, etc) without affecting the original dom.
Example:
Expected output:
The text was updated successfully, but these errors were encountered: