aboutsummaryrefslogtreecommitdiff
path: root/node_modules/structured-clone/clone.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-03-27 21:01:33 +0100
committerFlorian Dold <florian.dold@gmail.com>2019-03-27 21:01:33 +0100
commitcc97a4dd2a967e1c2273bd5f4c5f49a5bf2e2585 (patch)
tree92c5d88706a6ffc654d1b133618d357890e7096b /node_modules/structured-clone/clone.js
parent3771b4d6b67b34c130f3a9a1a15f42deefdb2eda (diff)
remove node_modules
Diffstat (limited to 'node_modules/structured-clone/clone.js')
-rw-r--r--node_modules/structured-clone/clone.js38
1 files changed, 0 insertions, 38 deletions
diff --git a/node_modules/structured-clone/clone.js b/node_modules/structured-clone/clone.js
deleted file mode 100644
index df1e4884e..000000000
--- a/node_modules/structured-clone/clone.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Implement the clone algorithm directly.
-// https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/The_structured_clone_algorithm
-
-function clone (oToBeCloned, cloned, clonedpairs)
-{
- cloned = cloned || [];
- clonedpairs = clonedpairs || [];
-
- if (cloned.indexOf(oToBeCloned) > -1) {
- return clonedpairs[cloned.indexOf(oToBeCloned)];
- }
-
- if (oToBeCloned === null || !(oToBeCloned instanceof Object)) { return oToBeCloned; }
- var oClone, fConstr = oToBeCloned.constructor;
- switch (fConstr) {
- case RegExp:
- oClone = new fConstr(oToBeCloned.source, "g".substr(0, Number(oToBeCloned.global)) + "i".substr(0, Number(oToBeCloned.ignoreCase)) + "m".substr(0, Number(oToBeCloned.multiline)));
- break;
- case Date:
- oClone = new fConstr(oToBeCloned.getTime());
- break;
- // etc.
- default:
- if (Buffer.isBuffer(oToBeCloned)) {
- oClone = new Buffer(oToBeCloned.length);
- oToBeCloned.copy(oClone);
- } else if (oToBeCloned instanceof Error) {
- oClone = new Error(oToBeCloned.message);
- } else {
- oClone = new fConstr();
- cloned.push(oToBeCloned); clonedpairs.push(oClone);
- for (var sProp in oToBeCloned) { oClone[sProp] = clone(oToBeCloned[sProp], cloned, clonedpairs); }
- }
- }
- return oClone;
-}
-
-exports.clone = clone; \ No newline at end of file