diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-12-10 21:51:33 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-12-10 21:51:33 +0100 |
commit | 0469abd4a9c9270a1fdc962969e36e63699af8b4 (patch) | |
tree | f9864d4a4148621378958794cbbfdc2393733283 /node_modules/clone | |
parent | 6947e79bbc258f7bc96af424ddb71a511f0c15a3 (diff) | |
download | wallet-core-0469abd4a9c9270a1fdc962969e36e63699af8b4.tar.xz |
upgrade dependencies
Diffstat (limited to 'node_modules/clone')
-rw-r--r-- | node_modules/clone/.npmignore | 5 | ||||
-rw-r--r-- | node_modules/clone/.travis.yml | 3 | ||||
-rw-r--r-- | node_modules/clone/clone.iml | 10 | ||||
-rw-r--r-- | node_modules/clone/package.json | 2 | ||||
-rw-r--r-- | node_modules/clone/test-apart-ctx.html | 22 | ||||
-rw-r--r-- | node_modules/clone/test.html | 148 | ||||
-rw-r--r-- | node_modules/clone/test.js | 372 |
7 files changed, 15 insertions, 547 deletions
diff --git a/node_modules/clone/.npmignore b/node_modules/clone/.npmignore index c2658d7d1..c797cbf39 100644 --- a/node_modules/clone/.npmignore +++ b/node_modules/clone/.npmignore @@ -1 +1,4 @@ -node_modules/ +/node_modules/ +/test.js +/*.html +/.travis.yml diff --git a/node_modules/clone/.travis.yml b/node_modules/clone/.travis.yml deleted file mode 100644 index 20fd86b6a..000000000 --- a/node_modules/clone/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.10 diff --git a/node_modules/clone/clone.iml b/node_modules/clone/clone.iml new file mode 100644 index 000000000..30de8aee9 --- /dev/null +++ b/node_modules/clone/clone.iml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="WEB_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$" /> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="library" name="clone node_modules" level="project" /> + </component> +</module>
\ No newline at end of file diff --git a/node_modules/clone/package.json b/node_modules/clone/package.json index b0987ecfc..687fa645e 100644 --- a/node_modules/clone/package.json +++ b/node_modules/clone/package.json @@ -8,7 +8,7 @@ "function", "date" ], - "version": "1.0.2", + "version": "1.0.3", "repository": { "type": "git", "url": "git://github.com/pvorb/node-clone.git" diff --git a/node_modules/clone/test-apart-ctx.html b/node_modules/clone/test-apart-ctx.html deleted file mode 100644 index 4d532bb71..000000000 --- a/node_modules/clone/test-apart-ctx.html +++ /dev/null @@ -1,22 +0,0 @@ -<html> - <head> - <meta charset="utf-8"> - <title>Clone Test-Suite (Browser)</title> - </head> - <body> - <script> - var data = document.location.search.substr(1).split('&'); - try { - ctx = parent[data[0]]; - eval(decodeURIComponent(data[1])); - window.results = results; - } catch(e) { - var extra = ''; - if (e.name == 'SecurityError') - extra = 'This test suite needs to be run on an http server.'; - alert('Apart Context iFrame Error\n' + e + '\n\n' + extra); - throw e; - } - </script> - </body> -</html> diff --git a/node_modules/clone/test.html b/node_modules/clone/test.html deleted file mode 100644 index a95570251..000000000 --- a/node_modules/clone/test.html +++ /dev/null @@ -1,148 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <title>Clone Test-Suite (Browser)</title> - <script> - var module = {}; - var tests = exports = module.exports = {}; - - function require(moduleName) { - if (moduleName == './') { - return clone; - } - } - - function log(str) { - logList.innerHTML += '<li>' + str + '</li>'; - } - </script> - <script src="clone.js"></script> - <script src="test.js"></script> - </head> - <body> - <h1 id="nodeunit-header">Clone Test-Suite (Browser)</h1> - Tests started: <span id="testsStarted"></span>; - Tests finished: <span id="testsFinished"></span>. - <ul id="logList"></ul> - <script> - /* Methods copied from - * https://github.com/caolan/nodeunit/blob/master/lib/assert.js - */ - function isUndefinedOrNull(value) { - return value === null || value === undefined; - } - - function isArguments(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; - } - - var _keys = function (obj){ - if (Object.keys) return Object.keys(obj); - if (typeof obj != 'object' && typeof obj != 'function') { - throw new TypeError('-'); - } - var keys = []; - for(var k in obj) if(obj.hasOwnProperty(k)) keys.push(k); - return keys; - }; - - function objEquiv(a, b) { - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - - if (a.prototype !== b.prototype) - return false; - - if (isArguments(a)) { - if (!isArguments(b)) return false; - a = pSlice.call(a); - b = pSlice.call(b); - return _deepEqual(a, b); - } - - try { - var ka = _keys(a), kb = _keys(b), key, i; - } catch (e) { - return false - } - - if (ka.length != kb.length) - return false; - - ka.sort(); - kb.sort(); - - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) return false; - } - - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!_deepEqual(a[key], b[key] )) - return false; - } - - return true; - } - function _deepEqual(actual, expected) { - if (actual === expected) { - return true; - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - } else if (actual instanceof RegExp && expected instanceof RegExp) { - return actual.source === expected.source && - actual.global === expected.global && - actual.ignoreCase === expected.ignoreCase && - actual.multiline === expected.multiline; - } else if (typeof actual != 'object' && typeof expected != 'object') { - return actual == expected; - } else { - return objEquiv(actual, expected); - } - } - - for (var testName in tests) { - setTimeout((function (testName) { - try { - testsStarted.innerHTML = (parseInt(testsStarted.innerHTML) || 0) + 1; - function incFinished() { - testsFinished.innerHTML = (parseInt(testsFinished.innerHTML) || 0) + 1; - } - - tests[testName]({ - expect: function (num) { - this._expect = num - }, - ok: function (val) { - if(!val) throw new Error(val + ' is not ok.') - }, - equal: function (a,b) { - if (a != b) throw new Error(a + ' is not equal to ' + b) - }, - notEqual: function (a,b) { - if (a == b) throw new Error(a + ' is equal to ' + b) - }, - strictEqual: function (a,b) { - if (a !== b) throw new Error(a + ' is not strict equal to ' + b) - }, - deepEqual: function (a,b) { - if (!_deepEqual(a,b)) - throw new Error(JSON.stringify(a) + ' is not deep equal to ' + - JSON.stringify(b)) - }, - done: function () { - log(testName + ' <span style="color:blue">is ok</span>.'); - incFinished(); - } - }); - } catch(e) { - log(testName + ' <span style="color:red">FAIL.</span> <small>'+ e +'</small>'); - incFinished(); - console.log(e); - } - })(testName), 1); - } - </script> - </body> -</html> diff --git a/node_modules/clone/test.js b/node_modules/clone/test.js deleted file mode 100644 index e8b65b3fe..000000000 --- a/node_modules/clone/test.js +++ /dev/null @@ -1,372 +0,0 @@ -var clone = require('./'); - -function inspect(obj) { - seen = []; - return JSON.stringify(obj, function (key, val) { - if (val != null && typeof val == "object") { - if (seen.indexOf(val) >= 0) { - return '[cyclic]'; - } - - seen.push(val); - } - - return val; - }); -} - -// Creates a new VM in node, or an iframe in a browser in order to run the -// script -function apartContext(context, script, callback) { - var vm = require('vm'); - - if (vm) { - var ctx = vm.createContext({ ctx: context }); - callback(vm.runInContext(script, ctx)); - } else if (document && document.createElement) { - var iframe = document.createElement('iframe'); - iframe.style.display = 'none'; - document.body.appendChild(iframe); - - var myCtxId = 'tmpCtx' + Math.random(); - - window[myCtxId] = context; - iframe.src = 'test-apart-ctx.html?' + myCtxId + '&' + encodeURIComponent(script); - iframe.onload = function() { - try { - callback(iframe.contentWindow.results); - } catch (e) { - throw e; - } - }; - } else { - console.log('WARNING: cannot create an apart context.'); - } -} - -exports["clone string"] = function (test) { - test.expect(2); // how many tests? - - var a = "foo"; - test.strictEqual(clone(a), a); - a = ""; - test.strictEqual(clone(a), a); - - test.done(); -}; - -exports["clone number"] = function (test) { - test.expect(5); // how many tests? - - var a = 0; - test.strictEqual(clone(a), a); - a = 1; - test.strictEqual(clone(a), a); - a = -1000; - test.strictEqual(clone(a), a); - a = 3.1415927; - test.strictEqual(clone(a), a); - a = -3.1415927; - test.strictEqual(clone(a), a); - - test.done(); -}; - -exports["clone date"] = function (test) { - test.expect(3); // how many tests? - - var a = new Date; - var c = clone(a); - test.ok(!!a.getUTCDate && !!a.toUTCString); - test.ok(!!c.getUTCDate && !!c.toUTCString); - test.equal(a.getTime(), c.getTime()); - - test.done(); -}; - -exports["clone object"] = function (test) { - test.expect(1); // how many tests? - - var a = { foo: { bar: "baz" } }; - var b = clone(a); - - test.deepEqual(b, a); - - test.done(); -}; - -exports["clone array"] = function (test) { - test.expect(2); // how many tests? - - var a = [ - { foo: "bar" }, - "baz" - ]; - var b = clone(a); - - test.ok(b instanceof Array); - test.deepEqual(b, a); - - test.done(); -}; - -exports["clone buffer"] = function (test) { - if (typeof Buffer == 'undefined') { - return test.done(); - } - - test.expect(1); - - var a = new Buffer("this is a test buffer"); - var b = clone(a); - - // no underscore equal since it has no concept of Buffers - test.deepEqual(b, a); - test.done(); -}; - -exports["clone regexp"] = function (test) { - test.expect(5); - - var a = /abc123/gi; - var b = clone(a); - test.deepEqual(b, a); - - var c = /a/g; - test.ok(c.lastIndex === 0); - - c.exec('123a456a'); - test.ok(c.lastIndex === 4); - - var d = clone(c); - test.ok(d.global); - test.ok(d.lastIndex === 4); - - test.done(); -}; - -exports["clone object containing array"] = function (test) { - test.expect(1); // how many tests? - - var a = { - arr1: [ { a: '1234', b: '2345' } ], - arr2: [ { c: '345', d: '456' } ] - }; - - var b = clone(a); - - test.deepEqual(b, a); - - test.done(); -}; - -exports["clone object with circular reference"] = function (test) { - test.expect(8); // how many tests? - - var c = [1, "foo", {'hello': 'bar'}, function () {}, false, [2]]; - var b = [c, 2, 3, 4]; - - var a = {'b': b, 'c': c}; - a.loop = a; - a.loop2 = a; - c.loop = c; - c.aloop = a; - - var aCopy = clone(a); - test.ok(a != aCopy); - test.ok(a.c != aCopy.c); - test.ok(aCopy.c == aCopy.b[0]); - test.ok(aCopy.c.loop.loop.aloop == aCopy); - test.ok(aCopy.c[0] == a.c[0]); - - test.ok(eq(a, aCopy)); - aCopy.c[0] = 2; - test.ok(!eq(a, aCopy)); - aCopy.c = "2"; - test.ok(!eq(a, aCopy)); - - function eq(x, y) { - return inspect(x) === inspect(y); - } - - test.done(); -}; - -exports['clone prototype'] = function (test) { - test.expect(3); // how many tests? - - var a = { - a: "aaa", - x: 123, - y: 45.65 - }; - var b = clone.clonePrototype(a); - - test.strictEqual(b.a, a.a); - test.strictEqual(b.x, a.x); - test.strictEqual(b.y, a.y); - - test.done(); -}; - -exports['clone within an apart context'] = function (test) { - var results = apartContext({ clone: clone }, - "results = ctx.clone({ a: [1, 2, 3], d: new Date(), r: /^foo$/ig })", - function (results) { - test.ok(results.a.constructor.toString() === Array.toString()); - test.ok(results.d.constructor.toString() === Date.toString()); - test.ok(results.r.constructor.toString() === RegExp.toString()); - test.done(); - }); -}; - -exports['clone object with no constructor'] = function (test) { - test.expect(3); - - var n = null; - - var a = { foo: 'bar' }; - a.__proto__ = n; - test.ok(typeof a === 'object'); - test.ok(typeof a !== null); - - var b = clone(a); - test.ok(a.foo, b.foo); - - test.done(); -}; - -exports['clone object with depth argument'] = function (test) { - test.expect(6); - - var a = { - foo: { - bar : { - baz : 'qux' - } - } - }; - - var b = clone(a, false, 1); - test.deepEqual(b, a); - test.notEqual(b, a); - test.strictEqual(b.foo, a.foo); - - b = clone(a, true, 2); - test.deepEqual(b, a); - test.notEqual(b.foo, a.foo); - test.strictEqual(b.foo.bar, a.foo.bar); - - test.done(); -}; - -exports['maintain prototype chain in clones'] = function (test) { - test.expect(1); - - function T() {} - - var a = new T(); - var b = clone(a); - test.strictEqual(Object.getPrototypeOf(a), Object.getPrototypeOf(b)); - - test.done(); -}; - -exports['parent prototype is overriden with prototype provided'] = function (test) { - test.expect(1); - - function T() {} - - var a = new T(); - var b = clone(a, true, Infinity, null); - test.strictEqual(b.__defineSetter__, undefined); - - test.done(); -}; - -exports['clone object with null children'] = function (test) { - test.expect(1); - var a = { - foo: { - bar: null, - baz: { - qux: false - } - } - }; - - var b = clone(a); - - test.deepEqual(b, a); - test.done(); -}; - -exports['clone instance with getter'] = function (test) { - test.expect(1); - function Ctor() {}; - Object.defineProperty(Ctor.prototype, 'prop', { - configurable: true, - enumerable: true, - get: function() { - return 'value'; - } - }); - - var a = new Ctor(); - var b = clone(a); - - test.strictEqual(b.prop, 'value'); - test.done(); -}; - -exports['get RegExp flags'] = function (test) { - test.strictEqual(clone.__getRegExpFlags(/a/), '' ); - test.strictEqual(clone.__getRegExpFlags(/a/i), 'i' ); - test.strictEqual(clone.__getRegExpFlags(/a/g), 'g' ); - test.strictEqual(clone.__getRegExpFlags(/a/gi), 'gi'); - test.strictEqual(clone.__getRegExpFlags(/a/m), 'm' ); - - test.done(); -}; - -exports["recognize Array object"] = function (test) { - var results = apartContext(null, "results = [1, 2, 3]", function(alien) { - var local = [4, 5, 6]; - test.ok(clone.__isArray(alien)); // recognize in other context. - test.ok(clone.__isArray(local)); // recognize in local context. - test.ok(!clone.__isDate(alien)); - test.ok(!clone.__isDate(local)); - test.ok(!clone.__isRegExp(alien)); - test.ok(!clone.__isRegExp(local)); - test.done(); - }); -}; - -exports["recognize Date object"] = function (test) { - var results = apartContext(null, "results = new Date()", function(alien) { - var local = new Date(); - - test.ok(clone.__isDate(alien)); // recognize in other context. - test.ok(clone.__isDate(local)); // recognize in local context. - test.ok(!clone.__isArray(alien)); - test.ok(!clone.__isArray(local)); - test.ok(!clone.__isRegExp(alien)); - test.ok(!clone.__isRegExp(local)); - - test.done(); - }); -}; - -exports["recognize RegExp object"] = function (test) { - var results = apartContext(null, "results = /foo/", function(alien) { - var local = /bar/; - - test.ok(clone.__isRegExp(alien)); // recognize in other context. - test.ok(clone.__isRegExp(local)); // recognize in local context. - test.ok(!clone.__isArray(alien)); - test.ok(!clone.__isArray(local)); - test.ok(!clone.__isDate(alien)); - test.ok(!clone.__isDate(local)); - test.done(); - }); -}; |