http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/test/readme-issue.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/test/readme-issue.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/test/readme-issue.js new file mode 100644 index 0000000..0b4e0be --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/test/readme-issue.js @@ -0,0 +1,36 @@ +var test = require("tap").test +var glob = require("../") + +var mkdirp = require("mkdirp") +var fs = require("fs") +var rimraf = require("rimraf") +var dir = __dirname + "/package" + +test("setup", function (t) { + mkdirp.sync(dir) + fs.writeFileSync(dir + "/package.json", "{}", "ascii") + fs.writeFileSync(dir + "/README", "x", "ascii") + t.pass("setup done") + t.end() +}) + +test("glob", function (t) { + var opt = { + cwd: dir, + nocase: true, + mark: true + } + + glob("README?(.*)", opt, function (er, files) { + if (er) + throw er + t.same(files, ["README"]) + t.end() + }) +}) + +test("cleanup", function (t) { + rimraf.sync(dir) + t.pass("clean") + t.end() +})
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/test/root-nomount.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/test/root-nomount.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/test/root-nomount.js new file mode 100644 index 0000000..3ac5979 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/test/root-nomount.js @@ -0,0 +1,39 @@ +var tap = require("tap") + +var origCwd = process.cwd() +process.chdir(__dirname) + +tap.test("changing root and searching for /b*/**", function (t) { + var glob = require('../') + var path = require('path') + t.test('.', function (t) { + glob('/b*/**', { globDebug: true, root: '.', nomount: true }, function (er, matches) { + t.ifError(er) + t.like(matches, []) + t.end() + }) + }) + + t.test('a', function (t) { + glob('/b*/**', { globDebug: true, root: path.resolve('a'), nomount: true }, function (er, matches) { + t.ifError(er) + t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) + t.end() + }) + }) + + t.test('root=a, cwd=a/b', function (t) { + glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b'), nomount: true }, function (er, matches) { + t.ifError(er) + t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) + t.end() + }) + }) + + t.test('cd -', function (t) { + process.chdir(origCwd) + t.end() + }) + + t.end() +}) http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/test/root.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/test/root.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/test/root.js new file mode 100644 index 0000000..95c23f9 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/test/root.js @@ -0,0 +1,46 @@ +var t = require("tap") + +var origCwd = process.cwd() +process.chdir(__dirname) + +var glob = require('../') +var path = require('path') + +t.test('.', function (t) { + glob('/b*/**', { globDebug: true, root: '.' }, function (er, matches) { + t.ifError(er) + t.like(matches, []) + t.end() + }) +}) + + +t.test('a', function (t) { + console.error("root=" + path.resolve('a')) + glob('/b*/**', { globDebug: true, root: path.resolve('a') }, function (er, matches) { + t.ifError(er) + var wanted = [ + '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' + ].map(function (m) { + return path.join(path.resolve('a'), m).replace(/\\/g, '/') + }) + + t.like(matches, wanted) + t.end() + }) +}) + +t.test('root=a, cwd=a/b', function (t) { + glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b') }, function (er, matches) { + t.ifError(er) + t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ].map(function (m) { + return path.join(path.resolve('a'), m).replace(/\\/g, '/') + })) + t.end() + }) +}) + +t.test('cd -', function (t) { + process.chdir(origCwd) + t.end() +}) http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/test/stat.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/test/stat.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/test/stat.js new file mode 100644 index 0000000..6291711 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/test/stat.js @@ -0,0 +1,32 @@ +var glob = require('../') +var test = require('tap').test +var path = require('path') + +test('stat all the things', function(t) { + var g = new glob.Glob('a/*abc*/**', { stat: true, cwd: __dirname }) + var matches = [] + g.on('match', function(m) { + matches.push(m) + }) + var stats = [] + g.on('stat', function(m) { + stats.push(m) + }) + g.on('end', function(eof) { + stats = stats.sort() + matches = matches.sort() + eof = eof.sort() + t.same(stats, matches) + t.same(eof, matches) + var cache = Object.keys(this.statCache) + t.same(cache.map(function (f) { + return path.relative(__dirname, f) + }).sort(), matches) + + cache.forEach(function(c) { + t.equal(typeof this.statCache[c], 'object') + }, this) + + t.end() + }) +}) http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/test/zz-cleanup.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/test/zz-cleanup.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/test/zz-cleanup.js new file mode 100644 index 0000000..e085f0f --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/glob/test/zz-cleanup.js @@ -0,0 +1,11 @@ +// remove the fixtures +var tap = require("tap") +, rimraf = require("rimraf") +, path = require("path") + +tap.test("cleanup fixtures", function (t) { + rimraf(path.resolve(__dirname, "a"), function (er) { + t.ifError(er, "removed") + t.end() + }) +}) http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/LICENSE ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/LICENSE b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/LICENSE new file mode 100644 index 0000000..dea3013 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/LICENSE @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/README.md ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/README.md b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/README.md new file mode 100644 index 0000000..b1c5665 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/README.md @@ -0,0 +1,42 @@ +Browser-friendly inheritance fully compatible with standard node.js +[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). + +This package exports standard `inherits` from node.js `util` module in +node environment, but also provides alternative browser-friendly +implementation through [browser +field](https://gist.github.com/shtylman/4339901). Alternative +implementation is a literal copy of standard one located in standalone +module to avoid requiring of `util`. It also has a shim for old +browsers with no `Object.create` support. + +While keeping you sure you are using standard `inherits` +implementation in node.js environment, it allows bundlers such as +[browserify](https://github.com/substack/node-browserify) to not +include full `util` package to your client code if all you need is +just `inherits` function. It worth, because browser shim for `util` +package is large and `inherits` is often the single function you need +from it. + +It's recommended to use this package instead of +`require('util').inherits` for any code that has chances to be used +not only in node.js but in browser too. + +## usage + +```js +var inherits = require('inherits'); +// then use exactly as the standard one +``` + +## note on version ~1.0 + +Version ~1.0 had completely different motivation and is not compatible +neither with 2.0 nor with standard node.js `inherits`. + +If you are using version ~1.0 and planning to switch to ~2.0, be +careful: + +* new version uses `super_` instead of `super` for referencing + superclass +* new version overwrites current prototype while old one preserves any + existing fields on it http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/inherits.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/inherits.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/inherits.js new file mode 100644 index 0000000..29f5e24 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/inherits.js @@ -0,0 +1 @@ +module.exports = require('util').inherits http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/inherits_browser.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/inherits_browser.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/inherits_browser.js new file mode 100644 index 0000000..c1e78a7 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/inherits_browser.js @@ -0,0 +1,23 @@ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/package.json ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/package.json b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/package.json new file mode 100644 index 0000000..6c556ed --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/package.json @@ -0,0 +1,50 @@ +{ + "name": "inherits", + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "version": "2.0.1", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "main": "./inherits.js", + "browser": "./inherits_browser.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/inherits" + }, + "license": "ISC", + "scripts": { + "test": "node test" + }, + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "_id": "[email protected]", + "dist": { + "shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", + "tarball": "http://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" + }, + "_from": "inherits@~2.0.1", + "_npmVersion": "1.3.8", + "_npmUser": { + "name": "isaacs", + "email": "[email protected]" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "[email protected]" + } + ], + "directories": {}, + "_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", + "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/isaacs/inherits" +} http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/test.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/test.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/test.js new file mode 100644 index 0000000..fc53012 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/inherits/test.js @@ -0,0 +1,25 @@ +var inherits = require('./inherits.js') +var assert = require('assert') + +function test(c) { + assert(c.constructor === Child) + assert(c.constructor.super_ === Parent) + assert(Object.getPrototypeOf(c) === Child.prototype) + assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) + assert(c instanceof Child) + assert(c instanceof Parent) +} + +function Child() { + Parent.call(this) + test(this) +} + +function Parent() {} + +inherits(Child, Parent) + +var c = new Child +test(c) + +console.log('ok') http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/.travis.yml ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/.travis.yml b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/.travis.yml new file mode 100644 index 0000000..cc4dba2 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/LICENSE ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/LICENSE b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/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/object-inspect/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-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/example/all.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/example/all.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/example/all.js new file mode 100644 index 0000000..6d2d4be --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/example/all.js @@ -0,0 +1,17 @@ +var inspect = require('../'); +var holes = [ 'a', 'b' ]; +holes[4] = 'e', holes[6] = 'g'; +var obj = { + a: 1, + b: [ 3, 4, undefined, null ], + c: undefined, + d: null, + e: { + regex: /^x/i, + buf: new Buffer('abc'), + holes: holes + }, + now: new Date +}; +obj.self = obj; +console.log(inspect(obj)); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/example/circular.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/example/circular.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/example/circular.js new file mode 100644 index 0000000..1006d0c --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/example/circular.js @@ -0,0 +1,4 @@ +var inspect = require('../'); +var obj = { a: 1, b: [3,4] }; +obj.c = obj; +console.log(inspect(obj)); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/example/fn.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/example/fn.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/example/fn.js new file mode 100644 index 0000000..4c00ba6 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/example/fn.js @@ -0,0 +1,3 @@ +var inspect = require('../'); +var obj = [ 1, 2, function f (n) { return n + 5 }, 4 ]; +console.log(inspect(obj)); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/example/inspect.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/example/inspect.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/example/inspect.js new file mode 100644 index 0000000..b5ad4d1 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/example/inspect.js @@ -0,0 +1,7 @@ +var inspect = require('../'); + +var d = document.createElement('div'); +d.setAttribute('id', 'beep'); +d.innerHTML = '<b>wooo</b><i>iiiii</i>'; + +console.log(inspect([ d, { a: 3, b : 4, c: [5,6,[7,[8,[9]]]] } ])); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/index.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/index.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/index.js new file mode 100644 index 0000000..2fa2225 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/index.js @@ -0,0 +1,127 @@ +module.exports = function inspect_ (obj, opts, depth, seen) { + if (!opts) opts = {}; + + var maxDepth = opts.depth === undefined ? 5 : opts.depth; + if (depth === undefined) depth = 0; + if (depth > maxDepth && maxDepth > 0) return '...'; + + if (seen === undefined) seen = []; + else if (indexOf(seen, obj) >= 0) { + return '[Circular]'; + } + + function inspect (value, from) { + if (from) { + seen = seen.slice(); + seen.push(from); + } + return inspect_(value, opts, depth + 1, seen); + } + + if (typeof obj === 'string') { + return inspectString(obj); + } + else if (typeof obj === 'function') { + var name = nameOf(obj); + return '[Function' + (name ? ': ' + name : '') + ']'; + } + else if (obj === null) { + return 'null'; + } + else if (isElement(obj)) { + var s = '<' + String(obj.nodeName).toLowerCase(); + var attrs = obj.attributes || []; + for (var i = 0; i < attrs.length; i++) { + s += ' ' + attrs[i].name + '="' + quote(attrs[i].value) + '"'; + } + s += '>'; + if (obj.childNodes && obj.childNodes.length) s += '...'; + s += '</' + String(obj.tagName).toLowerCase() + '>'; + return s; + } + else if (isArray(obj)) { + if (obj.length === 0) return '[]'; + var xs = Array(obj.length); + for (var i = 0; i < obj.length; i++) { + xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; + } + return '[ ' + xs.join(', ') + ' ]'; + } + else if (typeof obj === 'object' && typeof obj.inspect === 'function') { + return obj.inspect(); + } + else if (typeof obj === 'object' && !isDate(obj) && !isRegExp(obj)) { + var xs = [], keys = []; + for (var key in obj) { + if (has(obj, key)) keys.push(key); + } + keys.sort(); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (/[^\w$]/.test(key)) { + xs.push(inspect(key) + ': ' + inspect(obj[key], obj)); + } + else xs.push(key + ': ' + inspect(obj[key], obj)); + } + if (xs.length === 0) return '{}'; + return '{ ' + xs.join(', ') + ' }'; + } + else return String(obj); +}; + +function quote (s) { + return String(s).replace(/"/g, '"'); +} + +function isArray (obj) { + return {}.toString.call(obj) === '[object Array]'; +} + +function isDate (obj) { + return {}.toString.call(obj) === '[object Date]'; +} + +function isRegExp (obj) { + return {}.toString.call(obj) === '[object RegExp]'; +} + +function has (obj, key) { + if (!{}.hasOwnProperty) return key in obj; + return {}.hasOwnProperty.call(obj, key); +} + +function nameOf (f) { + if (f.name) return f.name; + var m = f.toString().match(/^function\s*([\w$]+)/); + if (m) return m[1]; +} + +function indexOf (xs, x) { + if (xs.indexOf) return xs.indexOf(x); + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} + +function isElement (x) { + if (!x || typeof x !== 'object') return false; + if (typeof HTMLElement !== 'undefined') { + return x instanceof HTMLElement; + } + else return typeof x.nodeName === 'string' + && typeof x.getAttribute === 'function' + ; +} + +function inspectString (str) { + var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte); + return "'" + s + "'"; + + function lowbyte (c) { + var n = c.charCodeAt(0); + var x = { 8: 'b', 9: 't', 10: 'n', 12: 'f', 13: 'r' }[n]; + if (x) return '\\' + x; + return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16); + } +} http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/package.json ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/package.json b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/package.json new file mode 100644 index 0000000..613f9c7 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/package.json @@ -0,0 +1,70 @@ +{ + "name": "object-inspect", + "version": "0.4.0", + "description": "string representations of objects in node and the browser", + "main": "index.js", + "devDependencies": { + "tape": "~2.6.0" + }, + "scripts": { + "test": "tape test/*.js" + }, + "testling": { + "files": [ + "test/*.js", + "test/browser/*.js" + ], + "browsers": [ + "ie/6..latest", + "chrome/latest", + "firefox/latest", + "safari/latest", + "opera/latest", + "iphone/latest", + "ipad/latest", + "android/latest" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/substack/object-inspect.git" + }, + "homepage": "https://github.com/substack/object-inspect", + "keywords": [ + "inspect", + "util.inspect", + "object", + "stringify", + "pretty" + ], + "author": { + "name": "James Halliday", + "email": "[email protected]", + "url": "http://substack.net" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/substack/object-inspect/issues" + }, + "_id": "[email protected]", + "dist": { + "shasum": "f5157c116c1455b243b06ee97703392c5ad89fec", + "tarball": "http://registry.npmjs.org/object-inspect/-/object-inspect-0.4.0.tgz" + }, + "_from": "object-inspect@~0.4.0", + "_npmVersion": "1.4.4", + "_npmUser": { + "name": "substack", + "email": "[email protected]" + }, + "maintainers": [ + { + "name": "substack", + "email": "[email protected]" + } + ], + "directories": {}, + "_shasum": "f5157c116c1455b243b06ee97703392c5ad89fec", + "_resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-0.4.0.tgz", + "readme": "ERROR: No README data found!" +} http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/readme.markdown ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/readme.markdown b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/readme.markdown new file mode 100644 index 0000000..41959a4 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/readme.markdown @@ -0,0 +1,59 @@ +# object-inspect + +string representations of objects in node and the browser + +[](https://ci.testling.com/substack/object-inspect) + +[](http://travis-ci.org/substack/object-inspect) + +# example + +## circular + +``` js +var inspect = require('object-inspect'); +var obj = { a: 1, b: [3,4] }; +obj.c = obj; +console.log(inspect(obj)); +``` + +## dom element + +``` js +var inspect = require('object-inspect'); + +var d = document.createElement('div'); +d.setAttribute('id', 'beep'); +d.innerHTML = '<b>wooo</b><i>iiiii</i>'; + +console.log(inspect([ d, { a: 3, b : 4, c: [5,6,[7,[8,[9]]]] } ])); +``` + +output: + +``` +[ <div id="beep">...</div>, { a: 3, b: 4, c: [ 5, 6, [ 7, [ 8, [ ... ] ] ] ] } ] +``` + +# methods + +``` js +var inspect = require('object-inspect') +``` + +## var s = inspect(obj, opts={}) + +Return a string `s` with the string representation of `obj` up to a depth of +`opts.depth`. + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install object-inspect +``` + +# license + +MIT http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/browser/dom.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/browser/dom.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/browser/dom.js new file mode 100644 index 0000000..30d0b7e --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/browser/dom.js @@ -0,0 +1,15 @@ +var inspect = require('../../'); +var test = require('tape'); + +test('dom element', function (t) { + t.plan(1); + + var d = document.createElement('div'); + d.setAttribute('id', 'beep'); + d.innerHTML = '<b>wooo</b><i>iiiii</i>'; + + t.equal( + inspect([ d, { a: 3, b : 4, c: [5,6,[7,[8,[9]]]] } ]), + '[ <div id="beep">...</div>, { a: 3, b: 4, c: [ 5, 6, [ 7, [ 8, [ ... ] ] ] ] } ]' + ); +}); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/circular.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/circular.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/circular.js new file mode 100644 index 0000000..28598a7 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/circular.js @@ -0,0 +1,9 @@ +var inspect = require('../'); +var test = require('tape'); + +test('circular', function (t) { + t.plan(1); + var obj = { a: 1, b: [3,4] }; + obj.c = obj; + t.equal(inspect(obj), '{ a: 1, b: [ 3, 4 ], c: [Circular] }'); +}); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/fn.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/fn.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/fn.js new file mode 100644 index 0000000..cdf97dd --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/fn.js @@ -0,0 +1,8 @@ +var inspect = require('../'); +var test = require('tape'); + +test('function', function (t) { + t.plan(1); + var obj = [ 1, 2, function f (n) { return n + 5 }, 4 ]; + t.equal(inspect(obj), '[ 1, 2, [Function: f], 4 ]'); +}); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/holes.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/holes.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/holes.js new file mode 100644 index 0000000..ae54de4 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/holes.js @@ -0,0 +1,15 @@ +var test = require('tape'); +var inspect = require('../'); + +var xs = [ 'a', 'b' ]; +xs[5] = 'f'; +xs[7] = 'j'; +xs[8] = 'k'; + +test('holes', function (t) { + t.plan(1); + t.equal( + inspect(xs), + "[ 'a', 'b', , , , 'f', , 'j', 'k' ]" + ); +}); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/lowbyte.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/lowbyte.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/lowbyte.js new file mode 100644 index 0000000..debd59c --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/lowbyte.js @@ -0,0 +1,12 @@ +var test = require('tape'); +var inspect = require('../'); + +var obj = { x: 'a\r\nb', y: '\5! \x1f \022' }; + +test('interpolate low bytes', function (t) { + t.plan(1); + t.equal( + inspect(obj), + "{ x: 'a\\r\\nb', y: '\\x05! \\x1f \\x12' }" + ); +}); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/undef.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/undef.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/undef.js new file mode 100644 index 0000000..833238f --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/object-inspect/test/undef.js @@ -0,0 +1,12 @@ +var test = require('tape'); +var inspect = require('../'); + +var obj = { a: 1, b: [ 3, 4, undefined, null ], c: undefined, d: null }; + +test('undef and null', function (t) { + t.plan(1); + t.equal( + inspect(obj), + '{ a: 1, b: [ 3, 4, undefined, null ], c: undefined, d: null }' + ); +}); http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/.travis.yml ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/.travis.yml b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/.travis.yml new file mode 100644 index 0000000..cc4dba2 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/LICENSE ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/LICENSE b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/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/resumer/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-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/example/resume.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/example/resume.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/example/resume.js new file mode 100644 index 0000000..d04e61a --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/example/resume.js @@ -0,0 +1,8 @@ +var resumer = require('../'); +createStream().pipe(process.stdout); + +function createStream () { + var stream = resumer(); + stream.queue('beep boop\n'); + return stream; +} http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/index.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/index.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/index.js new file mode 100644 index 0000000..14de798 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/index.js @@ -0,0 +1,29 @@ +var through = require('through'); +var nextTick = typeof setImmediate !== 'undefined' + ? setImmediate + : process.nextTick +; + +module.exports = function (write, end) { + var tr = through(write, end); + tr.pause(); + var resume = tr.resume; + var pause = tr.pause; + var paused = false; + + tr.pause = function () { + paused = true; + return pause.apply(this, arguments); + }; + + tr.resume = function () { + paused = false; + return resume.apply(this, arguments); + }; + + nextTick(function () { + if (!paused) tr.resume(); + }); + + return tr; +}; http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/package.json ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/package.json b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/package.json new file mode 100644 index 0000000..bede0fb --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/package.json @@ -0,0 +1,71 @@ +{ + "name": "resumer", + "version": "0.0.0", + "description": "a through stream that starts paused and resumes on the next tick", + "main": "index.js", + "dependencies": { + "through": "~2.3.4" + }, + "devDependencies": { + "tap": "~0.4.0", + "tape": "~1.0.2", + "concat-stream": "~0.1.1" + }, + "scripts": { + "test": "tap test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "chrome/20..latest", + "firefox/10..latest", + "safari/latest", + "opera/11.0..latest", + "iphone/6", + "ipad/6" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/substack/resumer.git" + }, + "homepage": "https://github.com/substack/resumer", + "keywords": [ + "through", + "stream", + "pause", + "resume" + ], + "author": { + "name": "James Halliday", + "email": "[email protected]", + "url": "http://substack.net" + }, + "license": "MIT", + "readme": "# resumer\n\nReturn a through stream that starts out paused and resumes on the next tick,\nunless somebody called `.pause()`.\n\nThis module has the same signature as\n[through](https://npmjs.com/package/through).\n\n[](http://ci.testling.com/substack/resumer)\n\n[](http://travis-ci.org/substack/resumer)\n\n# example\n\n``` js\nvar resumer = require('resumer');\nvar s = createStream();\ns.pipe(process.stdout);\n\nfunction createStream () {\n var stream = resumer();\n stream.queue('beep boop\\n');\n return stream;\n}\n```\n\n```\n$ node example/resume.js\nbeep boop\n```\n\n# methods\n\n``` js\nvar resumer = require('resumer')\n```\n\n## resumer(write, end)\n\nReturn a new through stream from `write` and `end`, which default to\npass-through `.queue()` functions if not specified.\n\nThe stream starts out paused and will be resumed on t he next tick unless you\ncall `.pause()` first.\n\n`write` and `end` get passed directly through to\n[through](https://npmjs.com/package/through).\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install resumer\n```\n\n# license\n\nMIT\n", + "readmeFilename": "readme.markdown", + "_id": "[email protected]", + "dist": { + "shasum": "f1e8f461e4064ba39e82af3cdc2a8c893d076759", + "tarball": "http://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz" + }, + "_from": "resumer@~0.0.0", + "_npmVersion": "1.2.2", + "_npmUser": { + "name": "substack", + "email": "[email protected]" + }, + "maintainers": [ + { + "name": "substack", + "email": "[email protected]" + } + ], + "directories": {}, + "_shasum": "f1e8f461e4064ba39e82af3cdc2a8c893d076759", + "_resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", + "bugs": { + "url": "https://github.com/substack/resumer/issues" + } +} http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/readme.markdown ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/readme.markdown b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/readme.markdown new file mode 100644 index 0000000..5d9df66 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/readme.markdown @@ -0,0 +1,59 @@ +# resumer + +Return a through stream that starts out paused and resumes on the next tick, +unless somebody called `.pause()`. + +This module has the same signature as +[through](https://npmjs.com/package/through). + +[](http://ci.testling.com/substack/resumer) + +[](http://travis-ci.org/substack/resumer) + +# example + +``` js +var resumer = require('resumer'); +var s = createStream(); +s.pipe(process.stdout); + +function createStream () { + var stream = resumer(); + stream.queue('beep boop\n'); + return stream; +} +``` + +``` +$ node example/resume.js +beep boop +``` + +# methods + +``` js +var resumer = require('resumer') +``` + +## resumer(write, end) + +Return a new through stream from `write` and `end`, which default to +pass-through `.queue()` functions if not specified. + +The stream starts out paused and will be resumed on the next tick unless you +call `.pause()` first. + +`write` and `end` get passed directly through to +[through](https://npmjs.com/package/through). + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install resumer +``` + +# license + +MIT http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/test/resume.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/test/resume.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/test/resume.js new file mode 100644 index 0000000..1eaecac --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/test/resume.js @@ -0,0 +1,37 @@ +var test = require('tape'); +var resumer = require('../'); +var concat = require('concat-stream'); + +test('implicit resume', function (t) { + t.plan(1); + + var s = createStream(); + s.pipe(concat(function (err, body) { + t.equal(body, 'beep boop\n'); + })); +}); + +test('pause/resume', function (t) { + t.plan(2); + + var s = createStream(); + s.pause(); + + var paused = true; + setTimeout(function () { + paused = false; + s.resume(); + }, 100); + + s.pipe(concat(function (err, body) { + t.equal(paused, false); + t.equal(body, 'beep boop\n'); + })); +}); + +function createStream () { + var stream = resumer(); + stream.queue('beep boop\n'); + stream.queue(null); + return stream; +} http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/test/through.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/test/through.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/test/through.js new file mode 100644 index 0000000..ddcaf48 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/resumer/test/through.js @@ -0,0 +1,36 @@ +var test = require('tape'); +var resumer = require('../'); +var concat = require('concat-stream'); + +test('through write/end', function (t) { + t.plan(2); + + var s = createStream(); + + s.on('okok', function () { + t.ok(true); + }); + + s.pipe(concat(function (err, body) { + t.equal(body, 'BEGIN\nRAWR\nEND\n'); + })); + + setTimeout(function () { + s.end('rawr\n'); + }, 50); +}); + +function createStream () { + var stream = resumer(write, end); + stream.queue('BEGIN\n'); + return stream; + + function write (x) { + this.queue(String(x).toUpperCase()); + } + function end () { + this.emit('okok'); + this.queue('END\n'); + this.queue(null); + } +} http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/.travis.yml ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/.travis.yml b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/.travis.yml new file mode 100644 index 0000000..c693a93 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - 0.6 + - 0.8 + - "0.10" http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/LICENSE.APACHE2 ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/LICENSE.APACHE2 b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/LICENSE.APACHE2 new file mode 100644 index 0000000..6366c04 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/LICENSE.APACHE2 @@ -0,0 +1,15 @@ +Apache License, Version 2.0 + +Copyright (c) 2011 Dominic Tarr + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/LICENSE.MIT ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/LICENSE.MIT b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/LICENSE.MIT new file mode 100644 index 0000000..6eafbd7 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/LICENSE.MIT @@ -0,0 +1,24 @@ +The MIT License + +Copyright (c) 2011 Dominic Tarr + +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-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/index.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/index.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/index.js new file mode 100644 index 0000000..ca5fc59 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/index.js @@ -0,0 +1,108 @@ +var Stream = require('stream') + +// through +// +// a stream that does nothing but re-emit the input. +// useful for aggregating a series of changing but not ending streams into one stream) + +exports = module.exports = through +through.through = through + +//create a readable writable stream. + +function through (write, end, opts) { + write = write || function (data) { this.queue(data) } + end = end || function () { this.queue(null) } + + var ended = false, destroyed = false, buffer = [], _ended = false + var stream = new Stream() + stream.readable = stream.writable = true + stream.paused = false + +// stream.autoPause = !(opts && opts.autoPause === false) + stream.autoDestroy = !(opts && opts.autoDestroy === false) + + stream.write = function (data) { + write.call(this, data) + return !stream.paused + } + + function drain() { + while(buffer.length && !stream.paused) { + var data = buffer.shift() + if(null === data) + return stream.emit('end') + else + stream.emit('data', data) + } + } + + stream.queue = stream.push = function (data) { +// console.error(ended) + if(_ended) return stream + if(data === null) _ended = true + buffer.push(data) + drain() + return stream + } + + //this will be registered as the first 'end' listener + //must call destroy next tick, to make sure we're after any + //stream piped from here. + //this is only a problem if end is not emitted synchronously. + //a nicer way to do this is to make sure this is the last listener for 'end' + + stream.on('end', function () { + stream.readable = false + if(!stream.writable && stream.autoDestroy) + process.nextTick(function () { + stream.destroy() + }) + }) + + function _end () { + stream.writable = false + end.call(stream) + if(!stream.readable && stream.autoDestroy) + stream.destroy() + } + + stream.end = function (data) { + if(ended) return + ended = true + if(arguments.length) stream.write(data) + _end() // will emit or queue + return stream + } + + stream.destroy = function () { + if(destroyed) return + destroyed = true + ended = true + buffer.length = 0 + stream.writable = stream.readable = false + stream.emit('close') + return stream + } + + stream.pause = function () { + if(stream.paused) return + stream.paused = true + return stream + } + + stream.resume = function () { + if(stream.paused) { + stream.paused = false + stream.emit('resume') + } + drain() + //may have become paused again, + //as drain emits 'data'. + if(!stream.paused) + stream.emit('drain') + return stream + } + return stream +} + http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/package.json ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/package.json b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/package.json new file mode 100644 index 0000000..a6d08b9 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/package.json @@ -0,0 +1,66 @@ +{ + "name": "through", + "version": "2.3.8", + "description": "simplified stream construction", + "main": "index.js", + "scripts": { + "test": "set -e; for t in test/*.js; do node $t; done" + }, + "devDependencies": { + "stream-spec": "~0.3.5", + "tape": "~2.3.2", + "from": "~0.1.3" + }, + "keywords": [ + "stream", + "streams", + "user-streams", + "pipe" + ], + "author": { + "name": "Dominic Tarr", + "email": "[email protected]", + "url": "dominictarr.com" + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/dominictarr/through.git" + }, + "homepage": "https://github.com/dominictarr/through", + "testling": { + "browsers": [ + "ie/8..latest", + "ff/15..latest", + "chrome/20..latest", + "safari/5.1..latest" + ], + "files": "test/*.js" + }, + "gitHead": "2c5a6f9a0cc54da759b6e10964f2081c358e49dc", + "bugs": { + "url": "https://github.com/dominictarr/through/issues" + }, + "_id": "[email protected]", + "_shasum": "0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5", + "_from": "through@~2.3.4", + "_npmVersion": "2.12.0", + "_nodeVersion": "2.3.1", + "_npmUser": { + "name": "dominictarr", + "email": "[email protected]" + }, + "maintainers": [ + { + "name": "dominictarr", + "email": "[email protected]" + } + ], + "dist": { + "shasum": "0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5", + "tarball": "http://registry.npmjs.org/through/-/through-2.3.8.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "readme": "ERROR: No README data found!" +} http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/readme.markdown ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/readme.markdown b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/readme.markdown new file mode 100644 index 0000000..cb34c81 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/readme.markdown @@ -0,0 +1,64 @@ +#through + +[](http://travis-ci.org/dominictarr/through) +[](https://ci.testling.com/dominictarr/through) + +Easy way to create a `Stream` that is both `readable` and `writable`. + +* Pass in optional `write` and `end` methods. +* `through` takes care of pause/resume logic if you use `this.queue(data)` instead of `this.emit('data', data)`. +* Use `this.pause()` and `this.resume()` to manage flow. +* Check `this.paused` to see current flow state. (`write` always returns `!this.paused`). + +This function is the basis for most of the synchronous streams in +[event-stream](http://github.com/dominictarr/event-stream). + +``` js +var through = require('through') + +through(function write(data) { + this.queue(data) //data *must* not be null + }, + function end () { //optional + this.queue(null) + }) +``` + +Or, can also be used _without_ buffering on pause, use `this.emit('data', data)`, +and this.emit('end') + +``` js +var through = require('through') + +through(function write(data) { + this.emit('data', data) + //this.pause() + }, + function end () { //optional + this.emit('end') + }) +``` + +## Extended Options + +You will probably not need these 99% of the time. + +### autoDestroy=false + +By default, `through` emits close when the writable +and readable side of the stream has ended. +If that is not desired, set `autoDestroy=false`. + +``` js +var through = require('through') + +//like this +var ts = through(write, end, {autoDestroy: false}) +//or like this +var ts = through(write, end) +ts.autoDestroy = false +``` + +## License + +MIT / Apache2 http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/test/async.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/test/async.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/test/async.js new file mode 100644 index 0000000..46bdbae --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/test/async.js @@ -0,0 +1,28 @@ +var from = require('from') +var through = require('../') + +var tape = require('tape') + +tape('simple async example', function (t) { + + var n = 0, expected = [1,2,3,4,5], actual = [] + from(expected) + .pipe(through(function(data) { + this.pause() + n ++ + setTimeout(function(){ + console.log('pushing data', data) + this.push(data) + this.resume() + }.bind(this), 300) + })).pipe(through(function(data) { + console.log('pushing data second time', data); + this.push(data) + })).on('data', function (d) { + actual.push(d) + }).on('end', function() { + t.deepEqual(actual, expected) + t.end() + }) + +}) http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/test/auto-destroy.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/test/auto-destroy.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/test/auto-destroy.js new file mode 100644 index 0000000..9a8fd00 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/test/auto-destroy.js @@ -0,0 +1,30 @@ +var test = require('tape') +var through = require('../') + +// must emit end before close. + +test('end before close', function (assert) { + var ts = through() + ts.autoDestroy = false + var ended = false, closed = false + + ts.on('end', function () { + assert.ok(!closed) + ended = true + }) + ts.on('close', function () { + assert.ok(ended) + closed = true + }) + + ts.write(1) + ts.write(2) + ts.write(3) + ts.end() + assert.ok(ended) + assert.notOk(closed) + ts.destroy() + assert.ok(closed) + assert.end() +}) + http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/test/buffering.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/test/buffering.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/test/buffering.js new file mode 100644 index 0000000..b0084bf --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/test/buffering.js @@ -0,0 +1,71 @@ +var test = require('tape') +var through = require('../') + +// must emit end before close. + +test('buffering', function(assert) { + var ts = through(function (data) { + this.queue(data) + }, function () { + this.queue(null) + }) + + var ended = false, actual = [] + + ts.on('data', actual.push.bind(actual)) + ts.on('end', function () { + ended = true + }) + + ts.write(1) + ts.write(2) + ts.write(3) + assert.deepEqual(actual, [1, 2, 3]) + ts.pause() + ts.write(4) + ts.write(5) + ts.write(6) + assert.deepEqual(actual, [1, 2, 3]) + ts.resume() + assert.deepEqual(actual, [1, 2, 3, 4, 5, 6]) + ts.pause() + ts.end() + assert.ok(!ended) + ts.resume() + assert.ok(ended) + assert.end() +}) + +test('buffering has data in queue, when ends', function (assert) { + + /* + * If stream ends while paused with data in the queue, + * stream should still emit end after all data is written + * on resume. + */ + + var ts = through(function (data) { + this.queue(data) + }, function () { + this.queue(null) + }) + + var ended = false, actual = [] + + ts.on('data', actual.push.bind(actual)) + ts.on('end', function () { + ended = true + }) + + ts.pause() + ts.write(1) + ts.write(2) + ts.write(3) + ts.end() + assert.deepEqual(actual, [], 'no data written yet, still paused') + assert.ok(!ended, 'end not emitted yet, still paused') + ts.resume() + assert.deepEqual(actual, [1, 2, 3], 'resumed, all data should be delivered') + assert.ok(ended, 'end should be emitted once all data was delivered') + assert.end(); +}) http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/test/end.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/test/end.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/test/end.js new file mode 100644 index 0000000..fa113f5 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/test/end.js @@ -0,0 +1,45 @@ +var test = require('tape') +var through = require('../') + +// must emit end before close. + +test('end before close', function (assert) { + var ts = through() + var ended = false, closed = false + + ts.on('end', function () { + assert.ok(!closed) + ended = true + }) + ts.on('close', function () { + assert.ok(ended) + closed = true + }) + + ts.write(1) + ts.write(2) + ts.write(3) + ts.end() + assert.ok(ended) + assert.ok(closed) + assert.end() +}) + +test('end only once', function (t) { + + var ts = through() + var ended = false, closed = false + + ts.on('end', function () { + t.equal(ended, false) + ended = true + }) + + ts.queue(null) + ts.queue(null) + ts.queue(null) + + ts.resume() + + t.end() +}) http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/test/index.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/test/index.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/test/index.js new file mode 100644 index 0000000..96da82f --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/node_modules/through/test/index.js @@ -0,0 +1,133 @@ + +var test = require('tape') +var spec = require('stream-spec') +var through = require('../') + +/* + I'm using these two functions, and not streams and pipe + so there is less to break. if this test fails it must be + the implementation of _through_ +*/ + +function write(array, stream) { + array = array.slice() + function next() { + while(array.length) + if(stream.write(array.shift()) === false) + return stream.once('drain', next) + + stream.end() + } + + next() +} + +function read(stream, callback) { + var actual = [] + stream.on('data', function (data) { + actual.push(data) + }) + stream.once('end', function () { + callback(null, actual) + }) + stream.once('error', function (err) { + callback(err) + }) +} + +test('simple defaults', function(assert) { + + var l = 1000 + , expected = [] + + while(l--) expected.push(l * Math.random()) + + var t = through() + var s = spec(t).through().pausable() + + read(t, function (err, actual) { + assert.ifError(err) + assert.deepEqual(actual, expected) + assert.end() + }) + + t.on('close', s.validate) + + write(expected, t) +}); + +test('simple functions', function(assert) { + + var l = 1000 + , expected = [] + + while(l--) expected.push(l * Math.random()) + + var t = through(function (data) { + this.emit('data', data*2) + }) + var s = spec(t).through().pausable() + + + read(t, function (err, actual) { + assert.ifError(err) + assert.deepEqual(actual, expected.map(function (data) { + return data*2 + })) + assert.end() + }) + + t.on('close', s.validate) + + write(expected, t) +}) + +test('pauses', function(assert) { + + var l = 1000 + , expected = [] + + while(l--) expected.push(l) //Math.random()) + + var t = through() + + var s = spec(t) + .through() + .pausable() + + t.on('data', function () { + if(Math.random() > 0.1) return + t.pause() + process.nextTick(function () { + t.resume() + }) + }) + + read(t, function (err, actual) { + assert.ifError(err) + assert.deepEqual(actual, expected) + }) + + t.on('close', function () { + s.validate() + assert.end() + }) + + write(expected, t) +}) + +test('does not soft-end on `undefined`', function(assert) { + var stream = through() + , count = 0 + + stream.on('data', function (data) { + count++ + }) + + stream.write(undefined) + stream.write(undefined) + + assert.equal(count, 2) + + assert.end() +}) http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/package.json ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/package.json b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/package.json new file mode 100644 index 0000000..998806b --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/package.json @@ -0,0 +1,88 @@ +{ + "name": "tape", + "version": "3.5.0", + "description": "tap-producing test harness for node and browsers", + "main": "index.js", + "bin": { + "tape": "./bin/tape" + }, + "directories": { + "example": "example", + "test": "test" + }, + "dependencies": { + "deep-equal": "~0.2.0", + "defined": "~0.0.0", + "glob": "~3.2.9", + "inherits": "~2.0.1", + "object-inspect": "~0.4.0", + "resumer": "~0.0.0", + "through": "~2.3.4" + }, + "devDependencies": { + "tap": "~0.4.8", + "falafel": "~0.3.1", + "concat-stream": "~1.4.1" + }, + "scripts": { + "test": "tap test/*.js" + }, + "testling": { + "files": "test/browser/*.js", + "browsers": [ + "ie/6..latest", + "chrome/20..latest", + "firefox/10..latest", + "safari/latest", + "opera/11.0..latest", + "iphone/6", + "ipad/6" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/substack/tape.git" + }, + "homepage": "https://github.com/substack/tape", + "keywords": [ + "tap", + "test", + "harness", + "assert", + "browser" + ], + "author": { + "name": "James Halliday", + "email": "[email protected]", + "url": "http://substack.net" + }, + "license": "MIT", + "gitHead": "51f2f97d7eade23b1e23b7cfea37f449ade5b9c3", + "bugs": { + "url": "https://github.com/substack/tape/issues" + }, + "_id": "[email protected]", + "_shasum": "aebb061388104ad0cb407be842782049d64624f8", + "_from": "tape@^3.5.0", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "raynos", + "email": "[email protected]" + }, + "maintainers": [ + { + "name": "substack", + "email": "[email protected]" + }, + { + "name": "raynos", + "email": "[email protected]" + } + ], + "dist": { + "shasum": "aebb061388104ad0cb407be842782049d64624f8", + "tarball": "http://registry.npmjs.org/tape/-/tape-3.5.0.tgz" + }, + "_resolved": "https://registry.npmjs.org/tape/-/tape-3.5.0.tgz", + "readme": "ERROR: No README data found!" +} http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/readme.markdown ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/readme.markdown b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/readme.markdown new file mode 100644 index 0000000..7a3263f --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/readme.markdown @@ -0,0 +1,317 @@ +# tape + +tap-producing test harness for node and browsers + +[](http://ci.testling.com/substack/tape) + +[](http://travis-ci.org/substack/tape) + + + +# example + +``` js +var test = require('tape'); + +test('timing test', function (t) { + t.plan(2); + + t.equal(typeof Date.now, 'function'); + var start = Date.now(); + + setTimeout(function () { + t.equal(Date.now() - start, 100); + }, 100); +}); +``` + +``` +$ node example/timing.js +TAP version 13 +# timing test +ok 1 should be equal +not ok 2 should be equal + --- + operator: equal + expected: 100 + actual: 107 + ... + +1..2 +# tests 2 +# pass 1 +# fail 1 +``` + +# pretty reporters + +The default TAP output is good for machines and humans that are robots. + +If you want a more colorful / pretty output there are lots of modules on npm +that will output something pretty if you pipe TAP into them: + + - https://github.com/scottcorgan/tap-spec + - https://github.com/scottcorgan/tap-dot + - https://github.com/substack/faucet + - https://github.com/juliangruber/tap-bail + - https://github.com/kirbysayshi/tap-browser-color + - https://github.com/gummesson/tap-json + - https://github.com/gummesson/tap-min + - https://github.com/calvinmetcalf/tap-nyan + - https://www.npmjs.org/package/tap-pessimist + - https://github.com/toolness/tap-prettify + - https://github.com/shuhei/colortape + - https://github.com/aghassemi/tap-xunit + +To use them, try `node test/index.js | tap-spec` or pipe it into one +of the modules of your choice! + +# uncaught exceptions + +By default, uncaught exceptions in your tests will not be intercepted, and will cause tape to crash. If you find this behavior undesirable, use [tape-catch](https://github.com/michaelrhodes/tape-catch) to report any exceptions as TAP errors. + +# methods + +The assertion methods in tape are heavily influenced or copied from the methods +in [node-tap](https://github.com/isaacs/node-tap). + +``` +var test = require('tape') +``` + +## test([name], [opts], cb) + +Create a new test with an optional `name` string and optional `opts` object. +`cb(t)` fires with the new test object `t` once all preceeding tests have +finished. Tests execute serially. + +Available `opts` options are: +- opts.skip = true/false. See test.skip. +- opts.timeout = 500. Set a timeout for the test, after which it will fail. + See test.timeoutAfter. + +If you forget to `t.plan()` out how many assertions you are going to run and you +don't call `t.end()` explicitly, your test will hang. + +## test.skip(name, cb) + +Generate a new test that will be skipped over. + +## t.plan(n) + +Declare that `n` assertions should be run. `t.end()` will be called +automatically after the `n`th assertion. If there are any more assertions after +the `n`th, or after `t.end()` is called, they will generate errors. + +## t.end(err) + +Declare the end of a test explicitly. If `err` is passed in `t.end` will assert +that it is falsey. + +## t.fail(msg) + +Generate a failing assertion with a message `msg`. + +## t.pass(msg) + +Generate a passing assertion with a message `msg`. + +## t.timeoutAfter(ms) + +Automatically timeout the test after X ms. + +## t.skip(msg) + +Generate an assertion that will be skipped over. + +## t.ok(value, msg) + +Assert that `value` is truthy with an optional description message `msg`. + +Aliases: `t.true()`, `t.assert()` + +## t.notOk(value, msg) + +Assert that `value` is falsy with an optional description message `msg`. + +Aliases: `t.false()`, `t.notok()` + +## t.error(err, msg) + +Assert that `err` is falsy. If `err` is non-falsy, use its `err.message` as the +description message. + +Aliases: `t.ifError()`, `t.ifErr()`, `t.iferror()` + +## t.equal(actual, expected, msg) + +Assert that `actual === expected` with an optional description `msg`. + +Aliases: `t.equals()`, `t.isEqual()`, `t.is()`, `t.strictEqual()`, +`t.strictEquals()` + +## t.notEqual(actual, expected, msg) + +Assert that `actual !== expected` with an optional description `msg`. + +Aliases: `t.notEquals()`, `t.notStrictEqual()`, `t.notStrictEquals()`, +`t.isNotEqual()`, `t.isNot()`, `t.not()`, `t.doesNotEqual()`, `t.isInequal()` + +## t.deepEqual(actual, expected, msg) + +Assert that `actual` and `bexpected` have the same structure and nested values using +[node's deepEqual() algorithm](https://github.com/substack/node-deep-equal) +with strict comparisons (`===`) on leaf nodes and an optional description +`msg`. + +Aliases: `t.deepEquals()`, `t.isEquivalent()`, `t.same()` + +## t.notDeepEqual(actual, expected, msg) + +Assert that `actual` and `expected` do not have the same structure and nested values using +[node's deepEqual() algorithm](https://github.com/substack/node-deep-equal) +with strict comparisons (`===`) on leaf nodes and an optional description +`msg`. + +Aliases: `t.notEquivalent()`, `t.notDeeply()`, `t.notSame()`, +`t.isNotDeepEqual()`, `t.isNotDeeply()`, `t.isNotEquivalent()`, +`t.isInequivalent()` + +## t.deepLooseEqual(actual, expected, msg) + +Assert that `actual` and `expected` have the same structure and nested values using +[node's deepEqual() algorithm](https://github.com/substack/node-deep-equal) +with loose comparisons (`==`) on leaf nodes and an optional description `msg`. + +Aliases: `t.looseEqual()`, `t.looseEquals()` + +## t.notDeepLooseEqual(actual, expected, msg) + +Assert that `actual` and `expected` do not have the same structure and nested values using +[node's deepEqual() algorithm](https://github.com/substack/node-deep-equal) +with loose comparisons (`==`) on leaf nodes and an optional description `msg`. + +Aliases: `t.notLooseEqual()`, `t.notLooseEquals()` + +## t.throws(fn, expected, msg) + +Assert that the function call `fn()` throws an exception. `expected`, if present, must be a `RegExp` or `Function`. + +## t.doesNotThrow(fn, expected, msg) + +Assert that the function call `fn()` does not throw an exception. + +## t.test(name, cb) + +Create a subtest with a new test handle `st` from `cb(st)` inside the current +test `t`. `cb(st)` will only fire when `t` finishes. Additional tests queued up +after `t` will not be run until all subtests finish. + +## var htest = test.createHarness() + +Create a new test harness instance, which is a function like `test()`, but with +a new pending stack and test state. + +By default the TAP output goes to `console.log()`. You can pipe the output to +someplace else if you `htest.createStream().pipe()` to a destination stream on +the first tick. + +## test.only(name, cb) + +Like `test(name, cb)` except if you use `.only` this is the only test case +that will run for the entire process, all other test cases using tape will +be ignored + +## var stream = test.createStream(opts) + +Create a stream of output, bypassing the default output stream that writes +messages to `console.log()`. By default `stream` will be a text stream of TAP +output, but you can get an object stream instead by setting `opts.objectMode` to +`true`. + +### tap stream reporter + +You can create your own custom test reporter using this `createStream()` api: + +``` js +var test = require('tape'); +var path = require('path'); + +test.createStream().pipe(process.stdout); + +process.argv.slice(2).forEach(function (file) { + require(path.resolve(file)); +}); +``` + +You could substitute `process.stdout` for whatever other output stream you want, +like a network connection or a file. + +Pass in test files to run as arguments: + +``` +$ node tap.js test/x.js test/y.js +TAP version 13 +# (anonymous) +not ok 1 should be equal + --- + operator: equal + expected: "boop" + actual: "beep" + ... +# (anonymous) +ok 2 should be equal +ok 3 (unnamed assert) +# wheee +ok 4 (unnamed assert) + +1..4 +# tests 4 +# pass 3 +# fail 1 +``` + +### object stream reporter + +Here's how you can render an object stream instead of TAP: + +``` js +var test = require('tape'); +var path = require('path'); + +test.createStream({ objectMode: true }).on('data', function (row) { + console.log(JSON.stringify(row)) +}); + +process.argv.slice(2).forEach(function (file) { + require(path.resolve(file)); +}); +``` + +The output for this runner is: + +``` +$ node object.js test/x.js test/y.js +{"type":"test","name":"(anonymous)","id":0} +{"id":0,"ok":false,"name":"should be equal","operator":"equal","actual":"beep","expected":"boop","error":{},"test":0,"type":"assert"} +{"type":"end","test":0} +{"type":"test","name":"(anonymous)","id":1} +{"id":0,"ok":true,"name":"should be equal","operator":"equal","actual":2,"expected":2,"test":1,"type":"assert"} +{"id":1,"ok":true,"name":"(unnamed assert)","operator":"ok","actual":true,"expected":true,"test":1,"type":"assert"} +{"type":"end","test":1} +{"type":"test","name":"wheee","id":2} +{"id":0,"ok":true,"name":"(unnamed assert)","operator":"ok","actual":true,"expected":true,"test":2,"type":"assert"} +{"type":"end","test":2} +``` + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install tape +``` + +# license + +MIT http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/test/add-subtest-async.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/test/add-subtest-async.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/test/add-subtest-async.js new file mode 100644 index 0000000..74b4d8a --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/test/add-subtest-async.js @@ -0,0 +1,11 @@ +var test = require('../') + +test('parent', function (t) { + t.pass('parent'); + setTimeout(function () { + t.test('child', function (t) { + t.pass('child'); + t.end(); + }); + }, 100) +}) http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/26cca47e/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/test/array.js ---------------------------------------------------------------------- diff --git a/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/test/array.js b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/test/array.js new file mode 100644 index 0000000..2d49863 --- /dev/null +++ b/bin/node_modules/cordova-common/node_modules/cordova-registry-mapper/node_modules/tape/test/array.js @@ -0,0 +1,68 @@ +var falafel = require('falafel'); +var tape = require('../'); +var tap = require('tap'); + +tap.test('array test', function (tt) { + tt.plan(1); + + var test = tape.createHarness(); + var tc = tap.createConsumer(); + + var rows = []; + tc.on('data', function (r) { rows.push(r) }); + tc.on('end', function () { + var rs = rows.map(function (r) { + if (r && typeof r === 'object') { + return { id : r.id, ok : r.ok, name : r.name.trim() }; + } + else return r; + }); + tt.same(rs, [ + 'TAP version 13', + 'array', + { id: 1, ok: true, name: 'should be equivalent' }, + { id: 2, ok: true, name: 'should be equivalent' }, + { id: 3, ok: true, name: 'should be equivalent' }, + { id: 4, ok: true, name: 'should be equivalent' }, + { id: 5, ok: true, name: 'should be equivalent' }, + 'tests 5', + 'pass 5', + 'ok' + ]); + }); + + test.createStream().pipe(tc); + + test('array', function (t) { + t.plan(5); + + var src = '(' + function () { + var xs = [ 1, 2, [ 3, 4 ] ]; + var ys = [ 5, 6 ]; + g([ xs, ys ]); + } + ')()'; + + var output = falafel(src, function (node) { + if (node.type === 'ArrayExpression') { + node.update('fn(' + node.source() + ')'); + } + }); + + var arrays = [ + [ 3, 4 ], + [ 1, 2, [ 3, 4 ] ], + [ 5, 6 ], + [ [ 1, 2, [ 3, 4 ] ], [ 5, 6 ] ], + ]; + + Function(['fn','g'], output)( + function (xs) { + t.same(arrays.shift(), xs); + return xs; + }, + function (xs) { + t.same(xs, [ [ 1, 2, [ 3, 4 ] ], [ 5, 6 ] ]); + } + ); + }); +}); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
