diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-05-03 15:35:00 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-05-03 15:35:00 +0200 |
commit | de98e0b232509d5f40c135d540a70e415272ff85 (patch) | |
tree | a79222a5b58484ab3b80d18efcaaa7ccc4769b33 /node_modules/node-libs-browser/mock | |
parent | e0c9d480a73fa629c1e4a47d3e721f1d2d345406 (diff) | |
download | wallet-core-de98e0b232509d5f40c135d540a70e415272ff85.tar.xz |
node_modules
Diffstat (limited to 'node_modules/node-libs-browser/mock')
-rw-r--r-- | node_modules/node-libs-browser/mock/buffer.js | 10 | ||||
-rw-r--r-- | node_modules/node-libs-browser/mock/console.js | 12 | ||||
-rw-r--r-- | node_modules/node-libs-browser/mock/dns.js | 15 | ||||
-rw-r--r-- | node_modules/node-libs-browser/mock/empty.js | 0 | ||||
-rw-r--r-- | node_modules/node-libs-browser/mock/net.js | 10 | ||||
-rw-r--r-- | node_modules/node-libs-browser/mock/process.js | 30 | ||||
-rw-r--r-- | node_modules/node-libs-browser/mock/punycode.js | 6 | ||||
-rw-r--r-- | node_modules/node-libs-browser/mock/tls.js | 1 | ||||
-rw-r--r-- | node_modules/node-libs-browser/mock/tty.js | 2 |
9 files changed, 86 insertions, 0 deletions
diff --git a/node_modules/node-libs-browser/mock/buffer.js b/node_modules/node-libs-browser/mock/buffer.js new file mode 100644 index 000000000..76a2d1818 --- /dev/null +++ b/node_modules/node-libs-browser/mock/buffer.js @@ -0,0 +1,10 @@ +function Buffer() { + throw new Error("Buffer is not included."); +} +Buffer.isBuffer = function() { + return false; +}; + +exports.INSPECT_MAX_BYTES = 50; +exports.SlowBuffer = Buffer; +exports.Buffer = Buffer; diff --git a/node_modules/node-libs-browser/mock/console.js b/node_modules/node-libs-browser/mock/console.js new file mode 100644 index 000000000..2bc7d5f96 --- /dev/null +++ b/node_modules/node-libs-browser/mock/console.js @@ -0,0 +1,12 @@ +var console; +if (typeof global !== "undefined" && global.console) { + console = global.console +} else if (typeof window !== "undefined" && window.console) { + console = window.console +} else { + console = window.console = {} +} +module.exports = console; +for(var name in {log:1, info:1, error:1, warn:1, dir:1, trace:1, assert:1, time:1, timeEnd: 1}) + if(!console[name]) + console[name] = function() {}; diff --git a/node_modules/node-libs-browser/mock/dns.js b/node_modules/node-libs-browser/mock/dns.js new file mode 100644 index 000000000..f15a0040e --- /dev/null +++ b/node_modules/node-libs-browser/mock/dns.js @@ -0,0 +1,15 @@ +exports.lookup = exports.resolve4 = +exports.resolve6 = exports.resolveCname = +exports.resolveMx = exports.resolveNs = +exports.resolveTxt = exports.resolveSrv = +exports.resolveNaptr = exports.reverse = +exports.resolve = +function () { + if (!arguments.length) return; + + var callback = arguments[arguments.length - 1]; + if (callback && typeof callback === 'function') { + callback(null, '0.0.0.0') + } +} + diff --git a/node_modules/node-libs-browser/mock/empty.js b/node_modules/node-libs-browser/mock/empty.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/node_modules/node-libs-browser/mock/empty.js diff --git a/node_modules/node-libs-browser/mock/net.js b/node_modules/node-libs-browser/mock/net.js new file mode 100644 index 000000000..e42afc709 --- /dev/null +++ b/node_modules/node-libs-browser/mock/net.js @@ -0,0 +1,10 @@ +exports.createServer = +exports.createConnection = +exports.connect = +function () {}; + +exports.isIP = +exports.isIPv4 = +exports.isIPv6 = +function () { return true }; + diff --git a/node_modules/node-libs-browser/mock/process.js b/node_modules/node-libs-browser/mock/process.js new file mode 100644 index 000000000..04f795974 --- /dev/null +++ b/node_modules/node-libs-browser/mock/process.js @@ -0,0 +1,30 @@ +exports.nextTick = function nextTick(fn) { + setTimeout(fn, 0); +}; + +exports.platform = exports.arch = +exports.execPath = exports.title = 'browser'; +exports.pid = 1; +exports.browser = true; +exports.env = {}; +exports.argv = []; + +exports.binding = function (name) { + throw new Error('No such module. (Possibly not yet loaded)') +}; + +(function () { + var cwd = '/'; + var path; + exports.cwd = function () { return cwd }; + exports.chdir = function (dir) { + if (!path) path = require('path'); + cwd = path.resolve(dir, cwd); + }; +})(); + +exports.exit = exports.kill = +exports.umask = exports.dlopen = +exports.uptime = exports.memoryUsage = +exports.uvCounters = function() {}; +exports.features = {}; diff --git a/node_modules/node-libs-browser/mock/punycode.js b/node_modules/node-libs-browser/mock/punycode.js new file mode 100644 index 000000000..9f964a173 --- /dev/null +++ b/node_modules/node-libs-browser/mock/punycode.js @@ -0,0 +1,6 @@ +exports.ucs2 = {}; +exports.encode = exports.decode = +exports.ucs2.encode = exports.ucs2.decode = +exports.toUnicode = exports.toASCII = +function (s) { return s }; +exports.version = "0.0.0";
\ No newline at end of file diff --git a/node_modules/node-libs-browser/mock/tls.js b/node_modules/node-libs-browser/mock/tls.js new file mode 100644 index 000000000..65b3dba38 --- /dev/null +++ b/node_modules/node-libs-browser/mock/tls.js @@ -0,0 +1 @@ +// todo diff --git a/node_modules/node-libs-browser/mock/tty.js b/node_modules/node-libs-browser/mock/tty.js new file mode 100644 index 000000000..a674e0f7a --- /dev/null +++ b/node_modules/node-libs-browser/mock/tty.js @@ -0,0 +1,2 @@ +exports.isatty = function () {}; +exports.setRawMode = function () {}; |