Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/rewire.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/getMonkeyPatchSrc.js')
-rw-r--r--lib/getMonkeyPatchSrc.js33
1 files changed, 0 insertions, 33 deletions
diff --git a/lib/getMonkeyPatchSrc.js b/lib/getMonkeyPatchSrc.js
deleted file mode 100644
index 408b6ee..0000000
--- a/lib/getMonkeyPatchSrc.js
+++ /dev/null
@@ -1,33 +0,0 @@
-"use strict"; // run code in ES5 strict mode
-
-var toSrc = require("toSrc");
-
-function getMonkeyPatchSrc(obj) {
- function walkObj(obj, level) {
- var key,
- value,
- src = "";
-
- for (key in obj) {
- if (obj.hasOwnProperty(key)) {
- value = obj[key];
- if (typeof value === "object" && Array.isArray(value) === false) {
- src += key + ".";
- src += walkObj(value, level + 1);
- } else {
- if (level === 0) {
- src += "var "; // in the top level, we need a var statement to override variables
- }
- src += key + "=" + toSrc(value, 9999) + ";";
- }
- }
- }
-
-
- return src;
- }
-
- return walkObj(obj, 0);
-}
-
-module.exports = getMonkeyPatchSrc; \ No newline at end of file