http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/example/two.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/example/two.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/example/two.js new file mode 100644 index 0000000..78e49c3 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/example/two.js @@ -0,0 +1,18 @@ +var test = require('../'); + +test('one', function (t) { + t.plan(2); + t.ok(true); + setTimeout(function () { + t.equal(1+3, 4); + }, 100); +}); + +test('two', function (t) { + t.plan(3); + t.equal(5, 2+3); + setTimeout(function () { + t.equal('a'.charCodeAt(0), 97); + t.ok(true); + }, 50); +});
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/index.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/index.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/index.js new file mode 100644 index 0000000..a44daf9 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/index.js @@ -0,0 +1,140 @@ +var defined = require('defined'); +var createDefaultStream = require('./lib/default_stream'); +var Test = require('./lib/test'); +var createResult = require('./lib/results'); +var through = require('through'); + +var canEmitExit = typeof process !== 'undefined' && process + && typeof process.on === 'function' && process.browser !== true +; +var canExit = typeof process !== 'undefined' && process + && typeof process.exit === 'function' +; + +var nextTick = typeof setImmediate !== 'undefined' + ? setImmediate + : process.nextTick +; + +exports = module.exports = (function () { + var harness; + var lazyLoad = function () { + return getHarness().apply(this, arguments); + }; + + lazyLoad.only = function () { + return getHarness().only.apply(this, arguments); + }; + + lazyLoad.createStream = function (opts) { + if (!opts) opts = {}; + if (!harness) { + var output = through(); + getHarness({ stream: output, objectMode: opts.objectMode }); + return output; + } + return harness.createStream(opts); + }; + + return lazyLoad + + function getHarness (opts) { + if (!opts) opts = {}; + opts.autoclose = !canEmitExit; + if (!harness) harness = createExitHarness(opts); + return harness; + } +})(); + +function createExitHarness (conf) { + if (!conf) conf = {}; + var harness = createHarness({ + autoclose: defined(conf.autoclose, false) + }); + + var stream = harness.createStream({ objectMode: conf.objectMode }); + var es = stream.pipe(conf.stream || createDefaultStream()); + if (canEmitExit) { + es.on('error', function (err) { harness._exitCode = 1 }); + } + + var ended = false; + stream.on('end', function () { ended = true }); + + if (conf.exit === false) return harness; + if (!canEmitExit || !canExit) return harness; + + var inErrorState = false; + + process.on('exit', function (code) { + // let the process exit cleanly. + if (code !== 0) { + return + } + + if (!ended) { + var only = harness._results._only; + for (var i = 0; i < harness._tests.length; i++) { + var t = harness._tests[i]; + if (only && t.name !== only) continue; + t._exit(); + } + } + harness.close(); + process.exit(code || harness._exitCode); + }); + + return harness; +} + +exports.createHarness = createHarness; +exports.Test = Test; +exports.test = exports; // tap compat +exports.test.skip = Test.skip; + +var exitInterval; + +function createHarness (conf_) { + if (!conf_) conf_ = {}; + var results = createResult(); + if (conf_.autoclose !== false) { + results.once('done', function () { results.close() }); + } + + var test = function (name, conf, cb) { + var t = new Test(name, conf, cb); + test._tests.push(t); + + (function inspectCode (st) { + st.on('test', function sub (st_) { + inspectCode(st_); + }); + st.on('result', function (r) { + if (!r.ok) test._exitCode = 1 + }); + })(t); + + results.push(t); + return t; + }; + test._results = results; + + test._tests = []; + + test.createStream = function (opts) { + return results.createStream(opts); + }; + + var only = false; + test.only = function (name) { + if (only) throw new Error('there can only be one only test'); + results.only(name); + only = true; + return test.apply(null, arguments); + }; + test._exitCode = 0; + + test.close = function () { results.close() }; + + return test; +} http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/lib/default_stream.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/lib/default_stream.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/lib/default_stream.js new file mode 100644 index 0000000..c8e9918 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/lib/default_stream.js @@ -0,0 +1,31 @@ +var through = require('through'); +var fs = require('fs'); + +module.exports = function () { + var line = ''; + var stream = through(write, flush); + return stream; + + function write (buf) { + for (var i = 0; i < buf.length; i++) { + var c = typeof buf === 'string' + ? buf.charAt(i) + : String.fromCharCode(buf[i]) + ; + if (c === '\n') flush(); + else line += c; + } + } + + function flush () { + if (fs.writeSync && /^win/.test(process.platform)) { + try { fs.writeSync(1, line + '\n'); } + catch (e) { stream.emit('error', e) } + } + else { + try { console.log(line) } + catch (e) { stream.emit('error', e) } + } + line = ''; + } +}; http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/lib/results.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/lib/results.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/lib/results.js new file mode 100644 index 0000000..fa414f4 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/lib/results.js @@ -0,0 +1,189 @@ +var EventEmitter = require('events').EventEmitter; +var inherits = require('inherits'); +var through = require('through'); +var resumer = require('resumer'); +var inspect = require('object-inspect'); +var nextTick = typeof setImmediate !== 'undefined' + ? setImmediate + : process.nextTick +; + +module.exports = Results; +inherits(Results, EventEmitter); + +function Results () { + if (!(this instanceof Results)) return new Results; + this.count = 0; + this.fail = 0; + this.pass = 0; + this._stream = through(); + this.tests = []; +} + +Results.prototype.createStream = function (opts) { + if (!opts) opts = {}; + var self = this; + var output, testId = 0; + if (opts.objectMode) { + output = through(); + self.on('_push', function ontest (t, extra) { + if (!extra) extra = {}; + var id = testId++; + t.once('prerun', function () { + var row = { + type: 'test', + name: t.name, + id: id + }; + if (has(extra, 'parent')) { + row.parent = extra.parent; + } + output.queue(row); + }); + t.on('test', function (st) { + ontest(st, { parent: id }); + }); + t.on('result', function (res) { + res.test = id; + res.type = 'assert'; + output.queue(res); + }); + t.on('end', function () { + output.queue({ type: 'end', test: id }); + }); + }); + self.on('done', function () { output.queue(null) }); + } + else { + output = resumer(); + output.queue('TAP version 13\n'); + self._stream.pipe(output); + } + + nextTick(function next() { + var t; + while (t = getNextTest(self)) { + t.run(); + if (!t.ended) return t.once('end', function(){ nextTick(next); }); + } + self.emit('done'); + }); + + return output; +}; + +Results.prototype.push = function (t) { + var self = this; + self.tests.push(t); + self._watch(t); + self.emit('_push', t); +}; + +Results.prototype.only = function (name) { + if (this._only) { + self.count ++; + self.fail ++; + write('not ok ' + self.count + ' already called .only()\n'); + } + this._only = name; +}; + +Results.prototype._watch = function (t) { + var self = this; + var write = function (s) { self._stream.queue(s) }; + t.once('prerun', function () { + write('# ' + t.name + '\n'); + }); + + t.on('result', function (res) { + if (typeof res === 'string') { + write('# ' + res + '\n'); + return; + } + write(encodeResult(res, self.count + 1)); + self.count ++; + + if (res.ok) self.pass ++ + else self.fail ++ + }); + + t.on('test', function (st) { self._watch(st) }); +}; + +Results.prototype.close = function () { + var self = this; + if (self.closed) self._stream.emit('error', new Error('ALREADY CLOSED')); + self.closed = true; + var write = function (s) { self._stream.queue(s) }; + + write('\n1..' + self.count + '\n'); + write('# tests ' + self.count + '\n'); + write('# pass ' + self.pass + '\n'); + if (self.fail) write('# fail ' + self.fail + '\n') + else write('\n# ok\n') + + self._stream.queue(null); +}; + +function encodeResult (res, count) { + var output = ''; + output += (res.ok ? 'ok ' : 'not ok ') + count; + output += res.name ? ' ' + res.name.toString().replace(/\s+/g, ' ') : ''; + + if (res.skip) output += ' # SKIP'; + else if (res.todo) output += ' # TODO'; + + output += '\n'; + if (res.ok) return output; + + var outer = ' '; + var inner = outer + ' '; + output += outer + '---\n'; + output += inner + 'operator: ' + res.operator + '\n'; + + if (has(res, 'expected') || has(res, 'actual')) { + var ex = inspect(res.expected); + var ac = inspect(res.actual); + + if (Math.max(ex.length, ac.length) > 65) { + output += inner + 'expected:\n' + inner + ' ' + ex + '\n'; + output += inner + 'actual:\n' + inner + ' ' + ac + '\n'; + } + else { + output += inner + 'expected: ' + ex + '\n'; + output += inner + 'actual: ' + ac + '\n'; + } + } + if (res.at) { + output += inner + 'at: ' + res.at + '\n'; + } + if (res.operator === 'error' && res.actual && res.actual.stack) { + var lines = String(res.actual.stack).split('\n'); + output += inner + 'stack:\n'; + output += inner + ' ' + lines[0] + '\n'; + for (var i = 1; i < lines.length; i++) { + output += inner + lines[i] + '\n'; + } + } + + output += outer + '...\n'; + return output; +} + +function getNextTest (results) { + if (!results._only) { + return results.tests.shift(); + } + + do { + var t = results.tests.shift(); + if (!t) continue; + if (results._only === t.name) { + return t; + } + } while (results.tests.length !== 0) +} + +function has (obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/lib/test.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/lib/test.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/lib/test.js new file mode 100644 index 0000000..b9d6111 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/lib/test.js @@ -0,0 +1,496 @@ +var deepEqual = require('deep-equal'); +var defined = require('defined'); +var path = require('path'); +var inherits = require('inherits'); +var EventEmitter = require('events').EventEmitter; + +module.exports = Test; + +var nextTick = typeof setImmediate !== 'undefined' + ? setImmediate + : process.nextTick +; + +inherits(Test, EventEmitter); + +var getTestArgs = function (name_, opts_, cb_) { + var name = '(anonymous)'; + var opts = {}; + var cb; + + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + var t = typeof arg; + if (t === 'string') { + name = arg; + } + else if (t === 'object') { + opts = arg || opts; + } + else if (t === 'function') { + cb = arg; + } + } + return { name: name, opts: opts, cb: cb }; +}; + +function Test (name_, opts_, cb_) { + if (! (this instanceof Test)) { + return new Test(name_, opts_, cb_); + } + + var args = getTestArgs(name_, opts_, cb_); + + this.readable = true; + this.name = args.name || '(anonymous)'; + this.assertCount = 0; + this.pendingCount = 0; + this._skip = args.opts.skip || false; + this._plan = undefined; + this._cb = args.cb; + this._progeny = []; + this._ok = true; + + if (args.opts.timeout !== undefined) { + this.timeoutAfter(args.opts.timeout); + } + + for (var prop in this) { + this[prop] = (function bind(self, val) { + if (typeof val === 'function') { + return function bound() { + return val.apply(self, arguments); + }; + } + else return val; + })(this, this[prop]); + } +} + +Test.prototype.run = function () { + if (!this._cb || this._skip) { + return this._end(); + } + this.emit('prerun'); + this._cb(this); + this.emit('run'); +}; + +Test.prototype.test = function (name, opts, cb) { + var self = this; + var t = new Test(name, opts, cb); + this._progeny.push(t); + this.pendingCount++; + this.emit('test', t); + t.on('prerun', function () { + self.assertCount++; + }) + + if (!self._pendingAsserts()) { + nextTick(function () { + self._end(); + }); + } + + nextTick(function() { + if (!self._plan && self.pendingCount == self._progeny.length) { + self._end(); + } + }); +}; + +Test.prototype.comment = function (msg) { + this.emit('result', msg.trim().replace(/^#\s*/, '')); +}; + +Test.prototype.plan = function (n) { + this._plan = n; + this.emit('plan', n); +}; + +Test.prototype.timeoutAfter = function(ms) { + if (!ms) throw new Error('timeoutAfter requires a timespan'); + var self = this; + var timeout = setTimeout(function() { + self.fail('test timed out after ' + ms + 'ms'); + self.end(); + }, ms); + this.once('end', function() { + clearTimeout(timeout); + }); +} + +Test.prototype.end = function (err) { + var self = this; + if (arguments.length >= 1) { + this.ifError(err); + } + + if (this.calledEnd) { + this.fail('.end() called twice'); + } + this.calledEnd = true; + this._end(); +}; + +Test.prototype._end = function (err) { + var self = this; + if (this._progeny.length) { + var t = this._progeny.shift(); + t.on('end', function () { self._end() }); + t.run(); + return; + } + + if (!this.ended) this.emit('end'); + var pendingAsserts = this._pendingAsserts(); + if (!this._planError && this._plan !== undefined && pendingAsserts) { + this._planError = true; + this.fail('plan != count', { + expected : this._plan, + actual : this.assertCount + }); + } + this.ended = true; +}; + +Test.prototype._exit = function () { + if (this._plan !== undefined && + !this._planError && this.assertCount !== this._plan) { + this._planError = true; + this.fail('plan != count', { + expected : this._plan, + actual : this.assertCount, + exiting : true + }); + } + else if (!this.ended) { + this.fail('test exited without ending', { + exiting: true + }); + } +}; + +Test.prototype._pendingAsserts = function () { + if (this._plan === undefined) { + return 1; + } + else { + return this._plan - (this._progeny.length + this.assertCount); + } +}; + +Test.prototype._assert = function assert (ok, opts) { + var self = this; + var extra = opts.extra || {}; + + var res = { + id : self.assertCount ++, + ok : Boolean(ok), + skip : defined(extra.skip, opts.skip), + name : defined(extra.message, opts.message, '(unnamed assert)'), + operator : defined(extra.operator, opts.operator) + }; + if (has(opts, 'actual') || has(extra, 'actual')) { + res.actual = defined(extra.actual, opts.actual); + } + if (has(opts, 'expected') || has(extra, 'expected')) { + res.expected = defined(extra.expected, opts.expected); + } + this._ok = Boolean(this._ok && ok); + + if (!ok) { + res.error = defined(extra.error, opts.error, new Error(res.name)); + } + + if (!ok) { + var e = new Error('exception'); + var err = (e.stack || '').split('\n'); + var dir = path.dirname(__dirname) + '/'; + + for (var i = 0; i < err.length; i++) { + var m = /^[^\s]*\s*\bat\s+(.+)/.exec(err[i]); + if (!m) { + continue; + } + + var s = m[1].split(/\s+/); + var filem = /(\/[^:\s]+:(\d+)(?::(\d+))?)/.exec(s[1]); + if (!filem) { + filem = /(\/[^:\s]+:(\d+)(?::(\d+))?)/.exec(s[2]); + + if (!filem) { + filem = /(\/[^:\s]+:(\d+)(?::(\d+))?)/.exec(s[3]); + + if (!filem) { + continue; + } + } + } + + if (filem[1].slice(0, dir.length) === dir) { + continue; + } + + res.functionName = s[0]; + res.file = filem[1]; + res.line = Number(filem[2]); + if (filem[3]) res.column = filem[3]; + + res.at = m[1]; + break; + } + } + + self.emit('result', res); + + var pendingAsserts = self._pendingAsserts(); + if (!pendingAsserts) { + if (extra.exiting) { + self._end(); + } else { + nextTick(function () { + self._end(); + }); + } + } + + if (!self._planError && pendingAsserts < 0) { + self._planError = true; + self.fail('plan != count', { + expected : self._plan, + actual : self._plan - pendingAsserts + }); + } +}; + +Test.prototype.fail = function (msg, extra) { + this._assert(false, { + message : msg, + operator : 'fail', + extra : extra + }); +}; + +Test.prototype.pass = function (msg, extra) { + this._assert(true, { + message : msg, + operator : 'pass', + extra : extra + }); +}; + +Test.prototype.skip = function (msg, extra) { + this._assert(true, { + message : msg, + operator : 'skip', + skip : true, + extra : extra + }); +}; + +Test.prototype.ok += Test.prototype['true'] += Test.prototype.assert += function (value, msg, extra) { + this._assert(value, { + message : msg, + operator : 'ok', + expected : true, + actual : value, + extra : extra + }); +}; + +Test.prototype.notOk += Test.prototype['false'] += Test.prototype.notok += function (value, msg, extra) { + this._assert(!value, { + message : msg, + operator : 'notOk', + expected : false, + actual : value, + extra : extra + }); +}; + +Test.prototype.error += Test.prototype.ifError += Test.prototype.ifErr += Test.prototype.iferror += function (err, msg, extra) { + this._assert(!err, { + message : defined(msg, String(err)), + operator : 'error', + actual : err, + extra : extra + }); +}; + +Test.prototype.equal += Test.prototype.equals += Test.prototype.isEqual += Test.prototype.is += Test.prototype.strictEqual += Test.prototype.strictEquals += function (a, b, msg, extra) { + this._assert(a === b, { + message : defined(msg, 'should be equal'), + operator : 'equal', + actual : a, + expected : b, + extra : extra + }); +}; + +Test.prototype.notEqual += Test.prototype.notEquals += Test.prototype.notStrictEqual += Test.prototype.notStrictEquals += Test.prototype.isNotEqual += Test.prototype.isNot += Test.prototype.not += Test.prototype.doesNotEqual += Test.prototype.isInequal += function (a, b, msg, extra) { + this._assert(a !== b, { + message : defined(msg, 'should not be equal'), + operator : 'notEqual', + actual : a, + notExpected : b, + extra : extra + }); +}; + +Test.prototype.deepEqual += Test.prototype.deepEquals += Test.prototype.isEquivalent += Test.prototype.same += function (a, b, msg, extra) { + this._assert(deepEqual(a, b, { strict: true }), { + message : defined(msg, 'should be equivalent'), + operator : 'deepEqual', + actual : a, + expected : b, + extra : extra + }); +}; + +Test.prototype.deepLooseEqual += Test.prototype.looseEqual += Test.prototype.looseEquals += function (a, b, msg, extra) { + this._assert(deepEqual(a, b), { + message : defined(msg, 'should be equivalent'), + operator : 'deepLooseEqual', + actual : a, + expected : b, + extra : extra + }); +}; + +Test.prototype.notDeepEqual += Test.prototype.notEquivalent += Test.prototype.notDeeply += Test.prototype.notSame += Test.prototype.isNotDeepEqual += Test.prototype.isNotDeeply += Test.prototype.isNotEquivalent += Test.prototype.isInequivalent += function (a, b, msg, extra) { + this._assert(!deepEqual(a, b, { strict: true }), { + message : defined(msg, 'should not be equivalent'), + operator : 'notDeepEqual', + actual : a, + notExpected : b, + extra : extra + }); +}; + +Test.prototype.notDeepLooseEqual += Test.prototype.notLooseEqual += Test.prototype.notLooseEquals += function (a, b, msg, extra) { + this._assert(!deepEqual(a, b), { + message : defined(msg, 'should be equivalent'), + operator : 'notDeepLooseEqual', + actual : a, + expected : b, + extra : extra + }); +}; + +Test.prototype['throws'] = function (fn, expected, msg, extra) { + if (typeof expected === 'string') { + msg = expected; + expected = undefined; + } + + var caught = undefined; + + try { + fn(); + } catch (err) { + caught = { error : err }; + var message = err.message; + delete err.message; + err.message = message; + } + + var passed = caught; + + if (expected instanceof RegExp) { + passed = expected.test(caught && caught.error); + expected = String(expected); + } + + if (typeof expected === 'function') { + passed = caught.error instanceof expected; + caught.error = caught.error.constructor; + } + + this._assert(passed, { + message : defined(msg, 'should throw'), + operator : 'throws', + actual : caught && caught.error, + expected : expected, + error: !passed && caught && caught.error, + extra : extra + }); +}; + +Test.prototype.doesNotThrow = function (fn, expected, msg, extra) { + if (typeof expected === 'string') { + msg = expected; + expected = undefined; + } + var caught = undefined; + try { + fn(); + } + catch (err) { + caught = { error : err }; + } + this._assert(!caught, { + message : defined(msg, 'should not throw'), + operator : 'throws', + actual : caught && caught.error, + expected : expected, + error : caught && caught.error, + extra : extra + }); +}; + +function has (obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +Test.skip = function (name_, _opts, _cb) { + var args = getTestArgs.apply(null, arguments); + args.opts.skip = true; + return Test(args.name, args.opts, args.cb); +}; + +// vim: set softtabstop=4 shiftwidth=4: + http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/.travis.yml ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/.travis.yml b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/.travis.yml new file mode 100644 index 0000000..f1d0f13 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.4 + - 0.6 http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/LICENSE ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/LICENSE b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/LICENSE new file mode 100644 index 0000000..ee27ba4 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/example/cmp.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/example/cmp.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/example/cmp.js new file mode 100644 index 0000000..67014b8 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/example/cmp.js @@ -0,0 +1,11 @@ +var equal = require('../'); +console.dir([ + equal( + { a : [ 2, 3 ], b : [ 4 ] }, + { a : [ 2, 3 ], b : [ 4 ] } + ), + equal( + { x : 5, y : [6] }, + { x : 5, y : 6 } + ) +]); http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/index.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/index.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/index.js new file mode 100644 index 0000000..dbc11f2 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/index.js @@ -0,0 +1,94 @@ +var pSlice = Array.prototype.slice; +var objectKeys = require('./lib/keys.js'); +var isArguments = require('./lib/is_arguments.js'); + +var deepEqual = module.exports = function (actual, expected, opts) { + if (!opts) opts = {}; + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + + } else if (actual instanceof Date && expected instanceof Date) { + return actual.getTime() === expected.getTime(); + + // 7.3. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if (typeof actual != 'object' && typeof expected != 'object') { + return opts.strict ? actual === expected : actual == expected; + + // 7.4. For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else { + return objEquiv(actual, expected, opts); + } +} + +function isUndefinedOrNull(value) { + return value === null || value === undefined; +} + +function isBuffer (x) { + if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; + if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { + return false; + } + if (x.length > 0 && typeof x[0] !== 'number') return false; + return true; +} + +function objEquiv(a, b, opts) { + var i, key; + if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) + return false; + // an identical 'prototype' property. + if (a.prototype !== b.prototype) return false; + //~~~I've managed to break Object.keys through screwy arguments passing. + // Converting to array solves the problem. + if (isArguments(a)) { + if (!isArguments(b)) { + return false; + } + a = pSlice.call(a); + b = pSlice.call(b); + return deepEqual(a, b, opts); + } + if (isBuffer(a)) { + if (!isBuffer(b)) { + return false; + } + if (a.length !== b.length) return false; + for (i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return false; + } + return true; + } + try { + var ka = objectKeys(a), + kb = objectKeys(b); + } catch (e) {//happens when one is a string literal and the other isn't + return false; + } + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!deepEqual(a[key], b[key], opts)) return false; + } + return typeof a === typeof b; +} http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/lib/is_arguments.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/lib/is_arguments.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/lib/is_arguments.js new file mode 100644 index 0000000..1ff150f --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/lib/is_arguments.js @@ -0,0 +1,20 @@ +var supportsArgumentsClass = (function(){ + return Object.prototype.toString.call(arguments) +})() == '[object Arguments]'; + +exports = module.exports = supportsArgumentsClass ? supported : unsupported; + +exports.supported = supported; +function supported(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; +}; + +exports.unsupported = unsupported; +function unsupported(object){ + return object && + typeof object == 'object' && + typeof object.length == 'number' && + Object.prototype.hasOwnProperty.call(object, 'callee') && + !Object.prototype.propertyIsEnumerable.call(object, 'callee') || + false; +}; http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/lib/keys.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/lib/keys.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/lib/keys.js new file mode 100644 index 0000000..13af263 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/lib/keys.js @@ -0,0 +1,9 @@ +exports = module.exports = typeof Object.keys === 'function' + ? Object.keys : shim; + +exports.shim = shim; +function shim (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +} http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/package.json ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/package.json b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/package.json new file mode 100644 index 0000000..97e0572 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/package.json @@ -0,0 +1,84 @@ +{ + "name": "deep-equal", + "version": "0.2.2", + "description": "node's assert.deepEqual algorithm", + "main": "index.js", + "directories": { + "lib": ".", + "example": "example", + "test": "test" + }, + "scripts": { + "test": "tape test/*.js" + }, + "devDependencies": { + "tape": "^3.5.0" + }, + "repository": { + "type": "git", + "url": "http://github.com/substack/node-deep-equal.git" + }, + "keywords": [ + "equality", + "equal", + "compare" + ], + "author": { + "name": "James Halliday", + "email": "[email protected]", + "url": "http://substack.net" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": { + "ie": [ + 6, + 7, + 8, + 9 + ], + "ff": [ + 3.5, + 10, + 15 + ], + "chrome": [ + 10, + 22 + ], + "safari": [ + 5.1 + ], + "opera": [ + 12 + ] + } + }, + "gitHead": "05cd26a25f0d7babf0c2758827b4dafec9d0582e", + "bugs": { + "url": "https://github.com/substack/node-deep-equal/issues" + }, + "homepage": "https://github.com/substack/node-deep-equal", + "_id": "[email protected]", + "_shasum": "84b745896f34c684e98f2ce0e42abaf43bba017d", + "_from": "deep-equal@~0.2.0", + "_npmVersion": "2.3.0", + "_nodeVersion": "0.10.35", + "_npmUser": { + "name": "substack", + "email": "[email protected]" + }, + "maintainers": [ + { + "name": "substack", + "email": "[email protected]" + } + ], + "dist": { + "shasum": "84b745896f34c684e98f2ce0e42abaf43bba017d", + "tarball": "http://registry.npmjs.org/deep-equal/-/deep-equal-0.2.2.tgz" + }, + "_resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-0.2.2.tgz", + "readme": "ERROR: No README data found!" +} http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/readme.markdown ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/readme.markdown b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/readme.markdown new file mode 100644 index 0000000..f489c2a --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/readme.markdown @@ -0,0 +1,61 @@ +# deep-equal + +Node's `assert.deepEqual() algorithm` as a standalone module. + +This module is around [5 times faster](https://gist.github.com/2790507) +than wrapping `assert.deepEqual()` in a `try/catch`. + +[](https://ci.testling.com/substack/node-deep-equal) + +[](https://travis-ci.org/substack/node-deep-equal) + +# example + +``` js +var equal = require('deep-equal'); +console.dir([ + equal( + { a : [ 2, 3 ], b : [ 4 ] }, + { a : [ 2, 3 ], b : [ 4 ] } + ), + equal( + { x : 5, y : [6] }, + { x : 5, y : 6 } + ) +]); +``` + +# methods + +``` js +var deepEqual = require('deep-equal') +``` + +## deepEqual(a, b, opts) + +Compare objects `a` and `b`, returning whether they are equal according to a +recursive equality algorithm. + +If `opts.strict` is `true`, use strict equality (`===`) to compare leaf nodes. +The default is to use coercive equality (`==`) because that's how +`assert.deepEqual()` works by default. + +# install + +With [npm](http://npmjs.org) do: + +``` +npm install deep-equal +``` + +# test + +With [npm](http://npmjs.org) do: + +``` +npm test +``` + +# license + +MIT. Derived largely from node's assert module. http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/test/cmp.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/test/cmp.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/test/cmp.js new file mode 100644 index 0000000..d141256 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/deep-equal/test/cmp.js @@ -0,0 +1,89 @@ +var test = require('tape'); +var equal = require('../'); +var isArguments = require('../lib/is_arguments.js'); +var objectKeys = require('../lib/keys.js'); + +test('equal', function (t) { + t.ok(equal( + { a : [ 2, 3 ], b : [ 4 ] }, + { a : [ 2, 3 ], b : [ 4 ] } + )); + t.end(); +}); + +test('not equal', function (t) { + t.notOk(equal( + { x : 5, y : [6] }, + { x : 5, y : 6 } + )); + t.end(); +}); + +test('nested nulls', function (t) { + t.ok(equal([ null, null, null ], [ null, null, null ])); + t.end(); +}); + +test('strict equal', function (t) { + t.notOk(equal( + [ { a: 3 }, { b: 4 } ], + [ { a: '3' }, { b: '4' } ], + { strict: true } + )); + t.end(); +}); + +test('non-objects', function (t) { + t.ok(equal(3, 3)); + t.ok(equal('beep', 'beep')); + t.ok(equal('3', 3)); + t.notOk(equal('3', 3, { strict: true })); + t.notOk(equal('3', [3])); + t.end(); +}); + +test('arguments class', function (t) { + t.ok(equal( + (function(){return arguments})(1,2,3), + (function(){return arguments})(1,2,3), + "compares arguments" + )); + t.notOk(equal( + (function(){return arguments})(1,2,3), + [1,2,3], + "differenciates array and arguments" + )); + t.end(); +}); + +test('test the arguments shim', function (t) { + t.ok(isArguments.supported((function(){return arguments})())); + t.notOk(isArguments.supported([1,2,3])); + + t.ok(isArguments.unsupported((function(){return arguments})())); + t.notOk(isArguments.unsupported([1,2,3])); + + t.end(); +}); + +test('test the keys shim', function (t) { + t.deepEqual(objectKeys.shim({ a: 1, b : 2 }), [ 'a', 'b' ]); + t.end(); +}); + +test('dates', function (t) { + var d0 = new Date(1387585278000); + var d1 = new Date('Fri Dec 20 2013 16:21:18 GMT-0800 (PST)'); + t.ok(equal(d0, d1)); + t.end(); +}); + +test('buffers', function (t) { + t.ok(equal(Buffer('xyz'), Buffer('xyz'))); + t.end(); +}); + +test('booleans and arrays', function (t) { + t.notOk(equal(true, [])); + t.end(); +}) http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/.travis.yml ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/.travis.yml b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/.travis.yml new file mode 100644 index 0000000..895dbd3 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.6 + - 0.8 http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/LICENSE ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/LICENSE b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/LICENSE new file mode 100644 index 0000000..ee27ba4 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/example/defined.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/example/defined.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/example/defined.js new file mode 100644 index 0000000..7b5d982 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/example/defined.js @@ -0,0 +1,4 @@ +var defined = require('../'); +var opts = { y : false, w : 4 }; +var x = defined(opts.x, opts.y, opts.w, 8); +console.log(x); http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/index.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/index.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/index.js new file mode 100644 index 0000000..f8a2219 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/index.js @@ -0,0 +1,5 @@ +module.exports = function () { + for (var i = 0; i < arguments.length; i++) { + if (arguments[i] !== undefined) return arguments[i]; + } +}; http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/package.json ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/package.json b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/package.json new file mode 100644 index 0000000..2452447 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/package.json @@ -0,0 +1,60 @@ +{ + "name": "defined", + "version": "0.0.0", + "description": "return the first argument that is `!== undefined`", + "main": "index.js", + "directories": { + "example": "example", + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "~0.3.0", + "tape": "~0.0.2" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/substack/defined.git" + }, + "homepage": "https://github.com/substack/defined", + "keywords": [ + "undefined", + "short-circuit", + "||", + "or", + "//", + "defined-or" + ], + "author": { + "name": "James Halliday", + "email": "[email protected]", + "url": "http://substack.net" + }, + "license": "MIT", + "_id": "[email protected]", + "dist": { + "shasum": "f35eea7d705e933baf13b2f03b3f83d921403b3e", + "tarball": "http://registry.npmjs.org/defined/-/defined-0.0.0.tgz" + }, + "_npmVersion": "1.1.59", + "_npmUser": { + "name": "substack", + "email": "[email protected]" + }, + "maintainers": [ + { + "name": "substack", + "email": "[email protected]" + } + ], + "_shasum": "f35eea7d705e933baf13b2f03b3f83d921403b3e", + "_from": "defined@~0.0.0", + "_resolved": "https://registry.npmjs.org/defined/-/defined-0.0.0.tgz", + "bugs": { + "url": "https://github.com/substack/defined/issues" + }, + "readme": "ERROR: No README data found!" +} http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/readme.markdown ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/readme.markdown b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/readme.markdown new file mode 100644 index 0000000..2280351 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/readme.markdown @@ -0,0 +1,51 @@ +# defined + +return the first argument that is `!== undefined` + +[](http://travis-ci.org/substack/defined) + +Most of the time when I chain together `||`s, I actually just want the first +item that is not `undefined`, not the first non-falsy item. + +This module is like the defined-or (`//`) operator in perl 5.10+. + +# example + +``` js +var defined = require('defined'); +var opts = { y : false, w : 4 }; +var x = defined(opts.x, opts.y, opts.w, 100); +console.log(x); +``` + +``` +$ node example/defined.js +false +``` + +The return value is `false` because `false` is the first item that is +`!== undefined`. + +# methods + +``` js +var defined = require('defined') +``` + +## var x = defined(a, b, c...) + +Return the first item in the argument list `a, b, c...` that is `!== undefined`. + +If all the items are `=== undefined`, return undefined. + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install defined +``` + +# license + +MIT http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/test/def.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/test/def.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/test/def.js new file mode 100644 index 0000000..48da517 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/defined/test/def.js @@ -0,0 +1,22 @@ +var defined = require('../'); +var test = require('tape'); + +test('defined-or', function (t) { + var u = undefined; + + t.equal(defined(), u, 'empty arguments'); + t.equal(defined(u), u, '1 undefined'); + t.equal(defined(u, u), u, '2 undefined'); + t.equal(defined(u, u, u, u), u, '4 undefineds'); + + t.equal(defined(undefined, false, true), false, 'false[0]'); + t.equal(defined(false, true), false, 'false[1]'); + t.equal(defined(undefined, 0, true), 0, 'zero[0]'); + t.equal(defined(0, true), 0, 'zero[1]'); + + t.equal(defined(3, undefined, 4), 3, 'first arg'); + t.equal(defined(undefined, 3, 4), 3, 'second arg'); + t.equal(defined(undefined, undefined, 3), 3, 'third arg'); + + t.end(); +}); http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/.npmignore ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/.npmignore b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/.npmignore new file mode 100644 index 0000000..2af4b71 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/.npmignore @@ -0,0 +1,2 @@ +.*.swp +test/a/ http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/.travis.yml ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/.travis.yml b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/.travis.yml new file mode 100644 index 0000000..baa0031 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - 0.8 http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/LICENSE ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/LICENSE b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/LICENSE new file mode 100644 index 0000000..0c44ae7 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Isaac Z. Schlueter ("Author") +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/README.md ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/README.md b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/README.md new file mode 100644 index 0000000..cc69164 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/README.md @@ -0,0 +1,250 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +## Attention: node-glob users! + +The API has changed dramatically between 2.x and 3.x. This library is +now 100% JavaScript, and the integer flags have been replaced with an +options object. + +Also, there's an event emitter class, proper tests, and all the other +things you've come to expect from node modules. + +And best of all, no compilation! + +## Usage + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Features + +Please see the [minimatch +documentation](https://github.com/isaacs/minimatch) for more details. + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob(pattern, [options], cb) + +* `pattern` {String} Pattern to be matched +* `options` {Object} +* `cb` {Function} + * `err` {Error | null} + * `matches` {Array<String>} filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` {String} Pattern to be matched +* `options` {Object} +* return: {Array<String>} filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instanting the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` {String} pattern to search for +* `options` {Object} +* `cb` {Function} Called when an error occurs, or matches are found + * `err` {Error | null} + * `matches` {Array<String>} filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `error` The error encountered. When an error is encountered, the + glob object is in an undefined state, and should be discarded. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `statCache` Collection of all the stat results the glob search + performed. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `1` - Path exists, and is not a directory + * `2` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the matched. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `abort` Stop the search. + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the glob object, as well. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. It will cause + ELOOP to be triggered one level sooner in the case of cyclical + symbolic links. +* `silent` When an unusual error is encountered + when attempting to read a directory, a warning will be printed to + stderr. Set the `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered + when attempting to read a directory, the process will just continue on + in search of other matches. Set the `strict` option to raise an error + in these cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary to + set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `sync` Perform a synchronous glob search. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. + Set this flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `nocase` Perform a case-insensitive match. Note that case-insensitive + filesystems will sometimes result in glob returning results that are + case-insensitively matched anyway, since readdir and stat will not + raise an error. +* `debug` Set to enable debug logging in minimatch and glob. +* `globDebug` Set to enable debug logging in glob, but not minimatch. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/examples/g.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/examples/g.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/examples/g.js new file mode 100644 index 0000000..be122df --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/examples/g.js @@ -0,0 +1,9 @@ +var Glob = require("../").Glob + +var pattern = "test/a/**/[cg]/../[cg]" +console.log(pattern) + +var mg = new Glob(pattern, {mark: true, sync:true}, function (er, matches) { + console.log("matches", matches) +}) +console.log("after") http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/4f8d066f/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/examples/usr-local.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/examples/usr-local.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/examples/usr-local.js new file mode 100644 index 0000000..327a425 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/examples/usr-local.js @@ -0,0 +1,9 @@ +var Glob = require("../").Glob + +var pattern = "{./*/*,/*,/usr/local/*}" +console.log(pattern) + +var mg = new Glob(pattern, {mark: true}, function (er, matches) { + console.log("matches", matches) +}) +console.log("after") --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
