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/getInjectionSrc.js')
-rw-r--r--lib/getInjectionSrc.js37
1 files changed, 0 insertions, 37 deletions
diff --git a/lib/getInjectionSrc.js b/lib/getInjectionSrc.js
deleted file mode 100644
index 74174d0..0000000
--- a/lib/getInjectionSrc.js
+++ /dev/null
@@ -1,37 +0,0 @@
-"use strict"; // run code in ES5 strict mode
-
-var toSrc = require("toSrc");
-
-/**
- * Returns the source code for injecting vars.
- *
- * e.g.:
- * "var console=123;"
- *
- * @param {Object} obj
- * @return {String}
- */
-function getInjectionSrc(obj) {
- function walkObj(obj, level) {
- var key,
- value,
- src = "";
-
- for (key in obj) {
- if (obj.hasOwnProperty(key)) {
- value = obj[key];
- if (level === 0) {
- src += "var "; // on the top level we need a var statement
- }
- src += key + "=" + toSrc(value, 9999) + ";";
- }
- }
-
-
- return src;
- }
-
- return walkObj(obj, 0);
-}
-
-module.exports = getInjectionSrc; \ No newline at end of file