semver@2.1, update all deps in repo

This commit is contained in:
isaacs 2013-08-01 16:54:20 -07:00
parent e6cb9075fe
commit f6e0c511b2
50 changed files with 5251 additions and 637 deletions

13
node_modules/fstream/package.json generated vendored
View file

@ -6,7 +6,7 @@
}, },
"name": "fstream", "name": "fstream",
"description": "Advanced file system stream things", "description": "Advanced file system stream things",
"version": "0.1.22", "version": "0.1.24",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git://github.com/isaacs/fstream.git" "url": "git://github.com/isaacs/fstream.git"
@ -18,8 +18,8 @@
"dependencies": { "dependencies": {
"rimraf": "2", "rimraf": "2",
"mkdirp": "0.3", "mkdirp": "0.3",
"graceful-fs": "~1.2.0", "graceful-fs": "~2.0.0",
"inherits": "~1.0.0" "inherits": "~2.0.0"
}, },
"devDependencies": { "devDependencies": {
"tap": "" "tap": ""
@ -30,6 +30,9 @@
"license": "BSD", "license": "BSD",
"readme": "Like FS streams, but with stat on them, and supporting directories and\nsymbolic links, as well as normal files. Also, you can use this to set\nthe stats on a file, even if you don't change its contents, or to create\na symlink, etc.\n\nSo, for example, you can \"write\" a directory, and it'll call `mkdir`. You\ncan specify a uid and gid, and it'll call `chown`. You can specify a\n`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink\nand provide a `linkpath` and it'll call `symlink`.\n\nNote that it won't automatically resolve symbolic links. So, if you\ncall `fstream.Reader('/some/symlink')` then you'll get an object\nthat stats and then ends immediately (since it has no data). To follow\nsymbolic links, do this: `fstream.Reader({path:'/some/symlink', follow:\ntrue })`.\n\nThere are various checks to make sure that the bytes emitted are the\nsame as the intended size, if the size is set.\n\n## Examples\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n })\n .write(\"hello\\n\")\n .end()\n```\n\nThis will create the directories if they're missing, and then write\n`hello\\n` into the file, chmod it to 0755, and assert that 6 bytes have\nbeen written when it's done.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n , flags: \"a\"\n })\n .write(\"hello\\n\")\n .end()\n```\n\nYou can pass flags in, if you want to append to a file.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/symlink\"\n , linkpath: \"./file\"\n , SymbolicLink: true\n , mode: \"0755\" // octal strings supported\n })\n .end()\n```\n\nIf isSymbolicLink is a function, it'll be called, and if it returns\ntrue, then it'll treat it as a symlink. If it's not a function, then\nany truish value will make a symlink, or you can set `type:\n'SymbolicLink'`, which does the same thing.\n\nNote that the linkpath is relative to the symbolic link location, not\nthe parent dir or cwd.\n\n```javascript\nfstream\n .Reader(\"path/to/dir\")\n .pipe(fstream.Writer(\"path/to/other/dir\"))\n```\n\nThis will do like `cp -Rp path/to/dir path/to/other/dir`. If the other\ndir exists and isn't a directory, then it'll emit an error. It'll also\nset the uid, gid, mode, etc. to be identical. In this way, it's more\nlike `rsync -a` than simply a copy.\n", "readme": "Like FS streams, but with stat on them, and supporting directories and\nsymbolic links, as well as normal files. Also, you can use this to set\nthe stats on a file, even if you don't change its contents, or to create\na symlink, etc.\n\nSo, for example, you can \"write\" a directory, and it'll call `mkdir`. You\ncan specify a uid and gid, and it'll call `chown`. You can specify a\n`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink\nand provide a `linkpath` and it'll call `symlink`.\n\nNote that it won't automatically resolve symbolic links. So, if you\ncall `fstream.Reader('/some/symlink')` then you'll get an object\nthat stats and then ends immediately (since it has no data). To follow\nsymbolic links, do this: `fstream.Reader({path:'/some/symlink', follow:\ntrue })`.\n\nThere are various checks to make sure that the bytes emitted are the\nsame as the intended size, if the size is set.\n\n## Examples\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n })\n .write(\"hello\\n\")\n .end()\n```\n\nThis will create the directories if they're missing, and then write\n`hello\\n` into the file, chmod it to 0755, and assert that 6 bytes have\nbeen written when it's done.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n , flags: \"a\"\n })\n .write(\"hello\\n\")\n .end()\n```\n\nYou can pass flags in, if you want to append to a file.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/symlink\"\n , linkpath: \"./file\"\n , SymbolicLink: true\n , mode: \"0755\" // octal strings supported\n })\n .end()\n```\n\nIf isSymbolicLink is a function, it'll be called, and if it returns\ntrue, then it'll treat it as a symlink. If it's not a function, then\nany truish value will make a symlink, or you can set `type:\n'SymbolicLink'`, which does the same thing.\n\nNote that the linkpath is relative to the symbolic link location, not\nthe parent dir or cwd.\n\n```javascript\nfstream\n .Reader(\"path/to/dir\")\n .pipe(fstream.Writer(\"path/to/other/dir\"))\n```\n\nThis will do like `cp -Rp path/to/dir path/to/other/dir`. If the other\ndir exists and isn't a directory, then it'll emit an error. It'll also\nset the uid, gid, mode, etc. to be identical. In this way, it's more\nlike `rsync -a` than simply a copy.\n",
"readmeFilename": "README.md", "readmeFilename": "README.md",
"_id": "fstream@0.1.22", "bugs": {
"_from": "fstream@0" "url": "https://github.com/isaacs/fstream/issues"
},
"_id": "fstream@0.1.24",
"_from": "fstream@latest"
} }

2
node_modules/glob/glob.js generated vendored
View file

@ -36,7 +36,7 @@
module.exports = glob module.exports = glob
var fs = require("graceful-fs") var fs = require("fs")
, minimatch = require("minimatch") , minimatch = require("minimatch")
, Minimatch = minimatch.Minimatch , Minimatch = minimatch.Minimatch
, inherits = require("inherits") , inherits = require("inherits")

9
node_modules/glob/package.json generated vendored
View file

@ -6,7 +6,7 @@
}, },
"name": "glob", "name": "glob",
"description": "a little globber", "description": "a little globber",
"version": "3.2.1", "version": "3.2.6",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git://github.com/isaacs/node-glob.git" "url": "git://github.com/isaacs/node-glob.git"
@ -17,8 +17,7 @@
}, },
"dependencies": { "dependencies": {
"minimatch": "~0.2.11", "minimatch": "~0.2.11",
"graceful-fs": "~1.2.0", "inherits": "2"
"inherits": "1"
}, },
"devDependencies": { "devDependencies": {
"tap": "~0.4.0", "tap": "~0.4.0",
@ -34,6 +33,6 @@
"bugs": { "bugs": {
"url": "https://github.com/isaacs/node-glob/issues" "url": "https://github.com/isaacs/node-glob/issues"
}, },
"_id": "glob@3.2.1", "_id": "glob@3.2.6",
"_from": "glob@3.2.1" "_from": "glob@latest"
} }

176
node_modules/glob/test/00-setup.js generated vendored Normal file
View file

@ -0,0 +1,176 @@
// just a little pre-run script to set up the fixtures.
// zz-finish cleans it up
var mkdirp = require("mkdirp")
var path = require("path")
var i = 0
var tap = require("tap")
var fs = require("fs")
var rimraf = require("rimraf")
var files =
[ "a/.abcdef/x/y/z/a"
, "a/abcdef/g/h"
, "a/abcfed/g/h"
, "a/b/c/d"
, "a/bc/e/f"
, "a/c/d/c/b"
, "a/cb/e/f"
]
var symlinkTo = path.resolve(__dirname, "a/symlink/a/b/c")
var symlinkFrom = "../.."
files = files.map(function (f) {
return path.resolve(__dirname, f)
})
tap.test("remove fixtures", function (t) {
rimraf(path.resolve(__dirname, "a"), function (er) {
t.ifError(er, "remove fixtures")
t.end()
})
})
files.forEach(function (f) {
tap.test(f, function (t) {
var d = path.dirname(f)
mkdirp(d, 0755, function (er) {
if (er) {
t.fail(er)
return t.bailout()
}
fs.writeFile(f, "i like tests", function (er) {
t.ifError(er, "make file")
t.end()
})
})
})
})
if (process.platform !== "win32") {
tap.test("symlinky", function (t) {
var d = path.dirname(symlinkTo)
console.error("mkdirp", d)
mkdirp(d, 0755, function (er) {
t.ifError(er)
fs.symlink(symlinkFrom, symlinkTo, "dir", function (er) {
t.ifError(er, "make symlink")
t.end()
})
})
})
}
;["foo","bar","baz","asdf","quux","qwer","rewq"].forEach(function (w) {
w = "/tmp/glob-test/" + w
tap.test("create " + w, function (t) {
mkdirp(w, function (er) {
if (er)
throw er
t.pass(w)
t.end()
})
})
})
// generate the bash pattern test-fixtures if possible
if (process.platform === "win32" || !process.env.TEST_REGEN) {
console.error("Windows, or TEST_REGEN unset. Using cached fixtures.")
return
}
var spawn = require("child_process").spawn;
var globs =
// put more patterns here.
// anything that would be directly in / should be in /tmp/glob-test
["test/a/*/+(c|g)/./d"
,"test/a/**/[cg]/../[cg]"
,"test/a/{b,c,d,e,f}/**/g"
,"test/a/b/**"
,"test/**/g"
,"test/a/abc{fed,def}/g/h"
,"test/a/abc{fed/g,def}/**/"
,"test/a/abc{fed/g,def}/**///**/"
,"test/**/a/**/"
,"test/+(a|b|c)/a{/,bc*}/**"
,"test/*/*/*/f"
,"test/**/f"
,"test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**"
,"{./*/*,/tmp/glob-test/*}"
,"{/tmp/glob-test/*,*}" // evil owl face! how you taunt me!
,"test/a/!(symlink)/**"
]
var bashOutput = {}
var fs = require("fs")
globs.forEach(function (pattern) {
tap.test("generate fixture " + pattern, function (t) {
var cmd = "shopt -s globstar && " +
"shopt -s extglob && " +
"shopt -s nullglob && " +
// "shopt >&2; " +
"eval \'for i in " + pattern + "; do echo $i; done\'"
var cp = spawn("bash", ["-c", cmd], { cwd: path.dirname(__dirname) })
var out = []
cp.stdout.on("data", function (c) {
out.push(c)
})
cp.stderr.pipe(process.stderr)
cp.on("close", function (code) {
out = flatten(out)
if (!out)
out = []
else
out = cleanResults(out.split(/\r*\n/))
bashOutput[pattern] = out
t.notOk(code, "bash test should finish nicely")
t.end()
})
})
})
tap.test("save fixtures", function (t) {
var fname = path.resolve(__dirname, "bash-results.json")
var data = JSON.stringify(bashOutput, null, 2) + "\n"
fs.writeFile(fname, data, function (er) {
t.ifError(er)
t.end()
})
})
function cleanResults (m) {
// normalize discrepancies in ordering, duplication,
// and ending slashes.
return m.map(function (m) {
return m.replace(/\/+/g, "/").replace(/\/$/, "")
}).sort(alphasort).reduce(function (set, f) {
if (f !== set[set.length - 1]) set.push(f)
return set
}, []).sort(alphasort).map(function (f) {
// de-windows
return (process.platform !== 'win32') ? f
: f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/')
})
}
function flatten (chunks) {
var s = 0
chunks.forEach(function (c) { s += c.length })
var out = new Buffer(s)
s = 0
chunks.forEach(function (c) {
c.copy(out, s)
s += c.length
})
return out.toString().trim()
}
function alphasort (a, b) {
a = a.toLowerCase()
b = b.toLowerCase()
return a > b ? 1 : a < b ? -1 : 0
}

63
node_modules/glob/test/bash-comparison.js generated vendored Normal file
View file

@ -0,0 +1,63 @@
// basic test
// show that it does the same thing by default as the shell.
var tap = require("tap")
, child_process = require("child_process")
, bashResults = require("./bash-results.json")
, globs = Object.keys(bashResults)
, glob = require("../")
, path = require("path")
// run from the root of the project
// this is usually where you're at anyway, but be sure.
process.chdir(path.resolve(__dirname, ".."))
function alphasort (a, b) {
a = a.toLowerCase()
b = b.toLowerCase()
return a > b ? 1 : a < b ? -1 : 0
}
globs.forEach(function (pattern) {
var expect = bashResults[pattern]
// anything regarding the symlink thing will fail on windows, so just skip it
if (process.platform === "win32" &&
expect.some(function (m) {
return /\/symlink\//.test(m)
}))
return
tap.test(pattern, function (t) {
glob(pattern, function (er, matches) {
if (er)
throw er
// sort and unmark, just to match the shell results
matches = cleanResults(matches)
t.deepEqual(matches, expect, pattern)
t.end()
})
})
tap.test(pattern + " sync", function (t) {
var matches = cleanResults(glob.sync(pattern))
t.deepEqual(matches, expect, "should match shell")
t.end()
})
})
function cleanResults (m) {
// normalize discrepancies in ordering, duplication,
// and ending slashes.
return m.map(function (m) {
return m.replace(/\/+/g, "/").replace(/\/$/, "")
}).sort(alphasort).reduce(function (set, f) {
if (f !== set[set.length - 1]) set.push(f)
return set
}, []).sort(alphasort).map(function (f) {
// de-windows
return (process.platform !== 'win32') ? f
: f.replace(/^[a-zA-Z]:[\/\\]+/, '/').replace(/[\\\/]+/g, '/')
})
}

349
node_modules/glob/test/bash-results.json generated vendored Normal file
View file

@ -0,0 +1,349 @@
{
"test/a/*/+(c|g)/./d": [
"test/a/b/c/./d"
],
"test/a/**/[cg]/../[cg]": [
"test/a/abcdef/g/../g",
"test/a/abcfed/g/../g",
"test/a/b/c/../c",
"test/a/c/../c",
"test/a/c/d/c/../c",
"test/a/symlink/a/b/c/../c",
"test/a/symlink/a/b/c/a/b/c/../c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/../c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/../c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b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/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c"
],
"test/a/{b,c,d,e,f}/**/g": [],
"test/a/b/**": [
"test/a/b",
"test/a/b/c",
"test/a/b/c/d"
],
"test/**/g": [
"test/a/abcdef/g",
"test/a/abcfed/g"
],
"test/a/abc{fed,def}/g/h": [
"test/a/abcdef/g/h",
"test/a/abcfed/g/h"
],
"test/a/abc{fed/g,def}/**/": [
"test/a/abcdef",
"test/a/abcdef/g",
"test/a/abcfed/g"
],
"test/a/abc{fed/g,def}/**///**/": [
"test/a/abcdef",
"test/a/abcdef/g",
"test/a/abcfed/g"
],
"test/**/a/**/": [
"test/a",
"test/a/abcdef",
"test/a/abcdef/g",
"test/a/abcfed",
"test/a/abcfed/g",
"test/a/b",
"test/a/b/c",
"test/a/bc",
"test/a/bc/e",
"test/a/c",
"test/a/c/d",
"test/a/c/d/c",
"test/a/cb",
"test/a/cb/e",
"test/a/symlink",
"test/a/symlink/a",
"test/a/symlink/a/b",
"test/a/symlink/a/b/c",
"test/a/symlink/a/b/c/a",
"test/a/symlink/a/b/c/a/b",
"test/a/symlink/a/b/c/a/b/c",
"test/a/symlink/a/b/c/a/b/c/a",
"test/a/symlink/a/b/c/a/b/c/a/b",
"test/a/symlink/a/b/c/a/b/c/a/b/c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/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b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b"
],
"test/+(a|b|c)/a{/,bc*}/**": [
"test/a/abcdef",
"test/a/abcdef/g",
"test/a/abcdef/g/h",
"test/a/abcfed",
"test/a/abcfed/g",
"test/a/abcfed/g/h"
],
"test/*/*/*/f": [
"test/a/bc/e/f",
"test/a/cb/e/f"
],
"test/**/f": [
"test/a/bc/e/f",
"test/a/cb/e/f"
],
"test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**": [
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/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c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b",
"test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c"
],
"{./*/*,/tmp/glob-test/*}": [
"./examples/g.js",
"./examples/usr-local.js",
"./node_modules/inherits",
"./node_modules/minimatch",
"./node_modules/mkdirp",
"./node_modules/rimraf",
"./node_modules/tap",
"./test/00-setup.js",
"./test/a",
"./test/bash-comparison.js",
"./test/bash-results.json",
"./test/cwd-test.js",
"./test/globstar-match.js",
"./test/mark.js",
"./test/nocase-nomagic.js",
"./test/pause-resume.js",
"./test/root-nomount.js",
"./test/root.js",
"./test/stat.js",
"./test/zz-cleanup.js",
"/tmp/glob-test/asdf",
"/tmp/glob-test/bar",
"/tmp/glob-test/baz",
"/tmp/glob-test/foo",
"/tmp/glob-test/quux",
"/tmp/glob-test/qwer",
"/tmp/glob-test/rewq"
],
"{/tmp/glob-test/*,*}": [
"/tmp/glob-test/asdf",
"/tmp/glob-test/bar",
"/tmp/glob-test/baz",
"/tmp/glob-test/foo",
"/tmp/glob-test/quux",
"/tmp/glob-test/qwer",
"/tmp/glob-test/rewq",
"examples",
"glob.js",
"LICENSE",
"node_modules",
"package.json",
"README.md",
"test"
],
"test/a/!(symlink)/**": [
"test/a/abcdef",
"test/a/abcdef/g",
"test/a/abcdef/g/h",
"test/a/abcfed",
"test/a/abcfed/g",
"test/a/abcfed/g/h",
"test/a/b",
"test/a/b/c",
"test/a/b/c/d",
"test/a/bc",
"test/a/bc/e",
"test/a/bc/e/f",
"test/a/c",
"test/a/c/d",
"test/a/c/d/c",
"test/a/c/d/c/b",
"test/a/cb",
"test/a/cb/e",
"test/a/cb/e/f"
]
}

55
node_modules/glob/test/cwd-test.js generated vendored Normal file
View file

@ -0,0 +1,55 @@
var tap = require("tap")
var origCwd = process.cwd()
process.chdir(__dirname)
tap.test("changing cwd and searching for **/d", function (t) {
var glob = require('../')
var path = require('path')
t.test('.', function (t) {
glob('**/d', function (er, matches) {
t.ifError(er)
t.like(matches, [ 'a/b/c/d', 'a/c/d' ])
t.end()
})
})
t.test('a', function (t) {
glob('**/d', {cwd:path.resolve('a')}, function (er, matches) {
t.ifError(er)
t.like(matches, [ 'b/c/d', 'c/d' ])
t.end()
})
})
t.test('a/b', function (t) {
glob('**/d', {cwd:path.resolve('a/b')}, function (er, matches) {
t.ifError(er)
t.like(matches, [ 'c/d' ])
t.end()
})
})
t.test('a/b/', function (t) {
glob('**/d', {cwd:path.resolve('a/b/')}, function (er, matches) {
t.ifError(er)
t.like(matches, [ 'c/d' ])
t.end()
})
})
t.test('.', function (t) {
glob('**/d', {cwd: process.cwd()}, function (er, matches) {
t.ifError(er)
t.like(matches, [ 'a/b/c/d', 'a/c/d' ])
t.end()
})
})
t.test('cd -', function (t) {
process.chdir(origCwd)
t.end()
})
t.end()
})

19
node_modules/glob/test/globstar-match.js generated vendored Normal file
View file

@ -0,0 +1,19 @@
var Glob = require("../glob.js").Glob
var test = require('tap').test
test('globstar should not have dupe matches', function(t) {
var pattern = 'a/**/[gh]'
var g = new Glob(pattern, { cwd: __dirname })
var matches = []
g.on('match', function(m) {
console.error('match %j', m)
matches.push(m)
})
g.on('end', function(set) {
console.error('set', set)
matches = matches.sort()
set = set.sort()
t.same(matches, set, 'should have same set of matches')
t.end()
})
})

74
node_modules/glob/test/mark.js generated vendored Normal file
View file

@ -0,0 +1,74 @@
var test = require("tap").test
var glob = require('../')
process.chdir(__dirname)
test("mark, no / on pattern", function (t) {
glob("a/*", {mark: true}, function (er, results) {
if (er)
throw er
var expect = [ 'a/abcdef/',
'a/abcfed/',
'a/b/',
'a/bc/',
'a/c/',
'a/cb/' ]
if (process.platform !== "win32")
expect.push('a/symlink/')
t.same(results, expect)
t.end()
})
})
test("mark=false, no / on pattern", function (t) {
glob("a/*", function (er, results) {
if (er)
throw er
var expect = [ 'a/abcdef',
'a/abcfed',
'a/b',
'a/bc',
'a/c',
'a/cb' ]
if (process.platform !== "win32")
expect.push('a/symlink')
t.same(results, expect)
t.end()
})
})
test("mark=true, / on pattern", function (t) {
glob("a/*/", {mark: true}, function (er, results) {
if (er)
throw er
var expect = [ 'a/abcdef/',
'a/abcfed/',
'a/b/',
'a/bc/',
'a/c/',
'a/cb/' ]
if (process.platform !== "win32")
expect.push('a/symlink/')
t.same(results, expect)
t.end()
})
})
test("mark=false, / on pattern", function (t) {
glob("a/*/", function (er, results) {
if (er)
throw er
var expect = [ 'a/abcdef/',
'a/abcfed/',
'a/b/',
'a/bc/',
'a/c/',
'a/cb/' ]
if (process.platform !== "win32")
expect.push('a/symlink/')
t.same(results, expect)
t.end()
})
})

113
node_modules/glob/test/nocase-nomagic.js generated vendored Normal file
View file

@ -0,0 +1,113 @@
var fs = require('fs');
var test = require('tap').test;
var glob = require('../');
test('mock fs', function(t) {
var stat = fs.stat
var statSync = fs.statSync
var readdir = fs.readdir
var readdirSync = fs.readdirSync
function fakeStat(path) {
var ret
switch (path.toLowerCase()) {
case '/tmp': case '/tmp/':
ret = { isDirectory: function() { return true } }
break
case '/tmp/a':
ret = { isDirectory: function() { return false } }
break
}
return ret
}
fs.stat = function(path, cb) {
var f = fakeStat(path);
if (f) {
process.nextTick(function() {
cb(null, f)
})
} else {
stat.call(fs, path, cb)
}
}
fs.statSync = function(path) {
return fakeStat(path) || statSync.call(fs, path)
}
function fakeReaddir(path) {
var ret
switch (path.toLowerCase()) {
case '/tmp': case '/tmp/':
ret = [ 'a', 'A' ]
break
case '/':
ret = ['tmp', 'tMp', 'tMP', 'TMP']
}
return ret
}
fs.readdir = function(path, cb) {
var f = fakeReaddir(path)
if (f)
process.nextTick(function() {
cb(null, f)
})
else
readdir.call(fs, path, cb)
}
fs.readdirSync = function(path) {
return fakeReaddir(path) || readdirSync.call(fs, path)
}
t.pass('mocked')
t.end()
})
test('nocase, nomagic', function(t) {
var n = 2
var want = [ '/TMP/A',
'/TMP/a',
'/tMP/A',
'/tMP/a',
'/tMp/A',
'/tMp/a',
'/tmp/A',
'/tmp/a' ]
glob('/tmp/a', { nocase: true }, function(er, res) {
if (er)
throw er
t.same(res.sort(), want)
if (--n === 0) t.end()
})
glob('/tmp/A', { nocase: true }, function(er, res) {
if (er)
throw er
t.same(res.sort(), want)
if (--n === 0) t.end()
})
})
test('nocase, with some magic', function(t) {
t.plan(2)
var want = [ '/TMP/A',
'/TMP/a',
'/tMP/A',
'/tMP/a',
'/tMp/A',
'/tMp/a',
'/tmp/A',
'/tmp/a' ]
glob('/tmp/*', { nocase: true }, function(er, res) {
if (er)
throw er
t.same(res.sort(), want)
})
glob('/tmp/*', { nocase: true }, function(er, res) {
if (er)
throw er
t.same(res.sort(), want)
})
})

73
node_modules/glob/test/pause-resume.js generated vendored Normal file
View file

@ -0,0 +1,73 @@
// show that no match events happen while paused.
var tap = require("tap")
, child_process = require("child_process")
// just some gnarly pattern with lots of matches
, pattern = "test/a/!(symlink)/**"
, bashResults = require("./bash-results.json")
, patterns = Object.keys(bashResults)
, glob = require("../")
, Glob = glob.Glob
, path = require("path")
// run from the root of the project
// this is usually where you're at anyway, but be sure.
process.chdir(path.resolve(__dirname, ".."))
function alphasort (a, b) {
a = a.toLowerCase()
b = b.toLowerCase()
return a > b ? 1 : a < b ? -1 : 0
}
function cleanResults (m) {
// normalize discrepancies in ordering, duplication,
// and ending slashes.
return m.map(function (m) {
return m.replace(/\/+/g, "/").replace(/\/$/, "")
}).sort(alphasort).reduce(function (set, f) {
if (f !== set[set.length - 1]) set.push(f)
return set
}, []).sort(alphasort).map(function (f) {
// de-windows
return (process.platform !== 'win32') ? f
: f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/')
})
}
var globResults = []
tap.test("use a Glob object, and pause/resume it", function (t) {
var g = new Glob(pattern)
, paused = false
, res = []
, expect = bashResults[pattern]
g.on("pause", function () {
console.error("pause")
})
g.on("resume", function () {
console.error("resume")
})
g.on("match", function (m) {
t.notOk(g.paused, "must not be paused")
globResults.push(m)
g.pause()
t.ok(g.paused, "must be paused")
setTimeout(g.resume.bind(g), 10)
})
g.on("end", function (matches) {
t.pass("reached glob end")
globResults = cleanResults(globResults)
matches = cleanResults(matches)
t.deepEqual(matches, globResults,
"end event matches should be the same as match events")
t.deepEqual(matches, expect,
"glob matches should be the same as bash results")
t.end()
})
})

39
node_modules/glob/test/root-nomount.js generated vendored Normal file
View file

@ -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()
})

46
node_modules/glob/test/root.js generated vendored Normal file
View file

@ -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()
})

32
node_modules/glob/test/stat.js generated vendored Normal file
View file

@ -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()
})
})

11
node_modules/glob/test/zz-cleanup.js generated vendored Normal file
View file

@ -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()
})
})

View file

@ -1,359 +1,152 @@
// this keeps a queue of opened file descriptors, and will make // Monkey-patching the fs module.
// fs operations wait until some have closed before trying to open more. // It's ugly, but there is simply no other way to do this.
var fs = module.exports = require('fs')
var fs = exports = module.exports = {} var assert = require('assert')
fs._originalFs = require("fs")
Object.getOwnPropertyNames(fs._originalFs).forEach(function(prop) { // fix up some busted stuff, mostly on windows and old nodes
var desc = Object.getOwnPropertyDescriptor(fs._originalFs, prop) require('./polyfills.js')
Object.defineProperty(fs, prop, desc)
})
var queue = [] // The EMFILE enqueuing stuff
, constants = require("constants")
fs._curOpen = 0 var util = require('util')
fs.MIN_MAX_OPEN = 64 function noop () {}
fs.MAX_OPEN = 1024
// prevent EMFILE errors var debug = noop
function OpenReq (path, flags, mode, cb) { var util = require('util')
if (util.debuglog)
debug = util.debuglog('gfs')
else if (/\bgfs\b/i.test(process.env.NODE_DEBUG || ''))
debug = function() {
var m = util.format.apply(util, arguments)
m = 'GFS: ' + m.split(/\n/).join('\nGFS: ')
console.error(m)
}
if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) {
process.on('exit', function() {
debug('fds', fds)
debug(queue)
assert.equal(queue.length, 0)
})
}
var originalOpen = fs.open
fs.open = open
function open(path, flags, mode, cb) {
if (typeof mode === "function") cb = mode, mode = null
if (typeof cb !== "function") cb = noop
new OpenReq(path, flags, mode, cb)
}
function OpenReq(path, flags, mode, cb) {
this.path = path this.path = path
this.flags = flags this.flags = flags
this.mode = mode this.mode = mode
this.cb = cb this.cb = cb
Req.call(this)
} }
function noop () {} util.inherits(OpenReq, Req)
fs.open = gracefulOpen OpenReq.prototype.process = function() {
originalOpen.call(fs, this.path, this.flags, this.mode, this.done)
}
function gracefulOpen (path, flags, mode, cb) { var fds = {}
if (typeof mode === "function") cb = mode, mode = null OpenReq.prototype.done = function(er, fd) {
debug('open done', er, fd)
if (fd)
fds['fd' + fd] = this.path
Req.prototype.done.call(this, er, fd)
}
var originalReaddir = fs.readdir
fs.readdir = readdir
function readdir(path, cb) {
if (typeof cb !== "function") cb = noop if (typeof cb !== "function") cb = noop
new ReaddirReq(path, cb)
if (fs._curOpen >= fs.MAX_OPEN) {
queue.push(new OpenReq(path, flags, mode, cb))
setTimeout(flush)
return
}
open(path, flags, mode, function (er, fd) {
if (er && er.code === "EMFILE" && fs._curOpen > fs.MIN_MAX_OPEN) {
// that was too many. reduce max, get back in queue.
// this should only happen once in a great while, and only
// if the ulimit -n is set lower than 1024.
fs.MAX_OPEN = fs._curOpen - 1
return fs.open(path, flags, mode, cb)
}
cb(er, fd)
})
} }
function open (path, flags, mode, cb) { function ReaddirReq(path, cb) {
cb = cb || noop this.path = path
fs._curOpen ++ this.cb = cb
fs._originalFs.open.call(fs, path, flags, mode, function (er, fd) { Req.call(this)
if (er) onclose()
cb(er, fd)
})
} }
fs.openSync = function (path, flags, mode) { util.inherits(ReaddirReq, Req)
var ret
ret = fs._originalFs.openSync.call(fs, path, flags, mode) ReaddirReq.prototype.process = function() {
fs._curOpen ++ originalReaddir.call(fs, this.path, this.done)
return ret
} }
function onclose () { ReaddirReq.prototype.done = function(er, files) {
fs._curOpen -- Req.prototype.done.call(this, er, files)
flush() onclose()
} }
function flush () {
while (fs._curOpen < fs.MAX_OPEN) {
var req = queue.shift()
if (!req) return
switch (req.constructor.name) {
case 'OpenReq':
open(req.path, req.flags || "r", req.mode || 0777, req.cb)
break
case 'ReaddirReq':
readdir(req.path, req.cb)
break
default:
throw new Error('Unknown req type: ' + req.constructor.name)
}
}
}
fs.close = function (fd, cb) { var originalClose = fs.close
cb = cb || noop fs.close = close
fs._originalFs.close.call(fs, fd, function (er) {
function close (fd, cb) {
debug('close', fd)
if (typeof cb !== "function") cb = noop
delete fds['fd' + fd]
originalClose.call(fs, fd, function(er) {
onclose() onclose()
cb(er) cb(er)
}) })
} }
fs.closeSync = function (fd) {
var originalCloseSync = fs.closeSync
fs.closeSync = closeSync
function closeSync (fd) {
try { try {
return fs._originalFs.closeSync.call(fs, fd) return originalCloseSync(fd)
} finally { } finally {
onclose() onclose()
} }
} }
// readdir takes a fd as well. // Req class
// however, the sync version closes it right away, so function Req () {
// there's no need to wrap. // start processing
// It would be nice to catch when it throws an EMFILE, this.done = this.done.bind(this)
// but that's relatively rare anyway. this.failures = 0
this.process()
fs.readdir = gracefulReaddir
function gracefulReaddir (path, cb) {
if (fs._curOpen >= fs.MAX_OPEN) {
queue.push(new ReaddirReq(path, cb))
setTimeout(flush)
return
}
readdir(path, function (er, files) {
if (er && er.code === "EMFILE" && fs._curOpen > fs.MIN_MAX_OPEN) {
fs.MAX_OPEN = fs._curOpen - 1
return fs.readdir(path, cb)
}
cb(er, files)
})
} }
function readdir (path, cb) { Req.prototype.done = function (er, result) {
cb = cb || noop // if an error, and the code is EMFILE, then get in the queue
fs._curOpen ++ if (er && er.code === "EMFILE") {
fs._originalFs.readdir.call(fs, path, function (er, files) { this.failures ++
onclose() enqueue(this)
cb(er, files)
})
}
function ReaddirReq (path, cb) {
this.path = path
this.cb = cb
}
// (re-)implement some things that are known busted or missing.
var constants = require("constants")
// lchmod, broken prior to 0.6.2
// back-port the fix here.
if (constants.hasOwnProperty('O_SYMLINK') &&
process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
fs.lchmod = function (path, mode, callback) {
callback = callback || noop
fs.open( path
, constants.O_WRONLY | constants.O_SYMLINK
, mode
, function (err, fd) {
if (err) {
callback(err)
return
}
// prefer to return the chmod error, if one occurs,
// but still try to close, and report closing errors if they occur.
fs.fchmod(fd, mode, function (err) {
fs.close(fd, function(err2) {
callback(err || err2)
})
})
})
}
fs.lchmodSync = function (path, mode) {
var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)
// prefer to return the chmod error, if one occurs,
// but still try to close, and report closing errors if they occur.
var err, err2
try {
var ret = fs.fchmodSync(fd, mode)
} catch (er) {
err = er
}
try {
fs.closeSync(fd)
} catch (er) {
err2 = er
}
if (err || err2) throw (err || err2)
return ret
}
}
// lutimes implementation, or no-op
if (!fs.lutimes) {
if (constants.hasOwnProperty("O_SYMLINK")) {
fs.lutimes = function (path, at, mt, cb) {
fs.open(path, constants.O_SYMLINK, function (er, fd) {
cb = cb || noop
if (er) return cb(er)
fs.futimes(fd, at, mt, function (er) {
fs.close(fd, function (er2) {
return cb(er || er2)
})
})
})
}
fs.lutimesSync = function (path, at, mt) {
var fd = fs.openSync(path, constants.O_SYMLINK)
, err
, err2
, ret
try {
var ret = fs.futimesSync(fd, at, mt)
} catch (er) {
err = er
}
try {
fs.closeSync(fd)
} catch (er) {
err2 = er
}
if (err || err2) throw (err || err2)
return ret
}
} else if (fs.utimensat && constants.hasOwnProperty("AT_SYMLINK_NOFOLLOW")) {
// maybe utimensat will be bound soonish?
fs.lutimes = function (path, at, mt, cb) {
fs.utimensat(path, at, mt, constants.AT_SYMLINK_NOFOLLOW, cb)
}
fs.lutimesSync = function (path, at, mt) {
return fs.utimensatSync(path, at, mt, constants.AT_SYMLINK_NOFOLLOW)
}
} else { } else {
fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) } var cb = this.cb
fs.lutimesSync = function () {} cb(er, result)
} }
} }
var queue = []
// https://github.com/isaacs/node-graceful-fs/issues/4 function enqueue(req) {
// Chown should not fail on einval or eperm if non-root. queue.push(req)
debug('enqueue %d %s', queue.length, req.constructor.name, req)
}
fs.chown = chownFix(fs.chown) function onclose() {
fs.fchown = chownFix(fs.fchown) var req = queue.shift()
fs.lchown = chownFix(fs.lchown) if (req) {
debug('process', req.constructor.name, req)
fs.chownSync = chownFixSync(fs.chownSync) req.process()
fs.fchownSync = chownFixSync(fs.fchownSync)
fs.lchownSync = chownFixSync(fs.lchownSync)
function chownFix (orig) {
if (!orig) return orig
return function (target, uid, gid, cb) {
return orig.call(fs, target, uid, gid, function (er, res) {
if (chownErOk(er)) er = null
cb(er, res)
})
}
}
function chownFixSync (orig) {
if (!orig) return orig
return function (target, uid, gid) {
try {
return orig.call(fs, target, uid, gid)
} catch (er) {
if (!chownErOk(er)) throw er
}
}
}
function chownErOk (er) {
// if there's no getuid, or if getuid() is something other than 0,
// and the error is EINVAL or EPERM, then just ignore it.
// This specific case is a silent failure in cp, install, tar,
// and most other unix tools that manage permissions.
// When running as root, or if other types of errors are encountered,
// then it's strict.
if (!er || (!process.getuid || process.getuid() !== 0)
&& (er.code === "EINVAL" || er.code === "EPERM")) return true
}
// if lchmod/lchown do not exist, then make them no-ops
if (!fs.lchmod) {
fs.lchmod = function (path, mode, cb) {
process.nextTick(cb)
}
fs.lchmodSync = function () {}
}
if (!fs.lchown) {
fs.lchown = function (path, uid, gid, cb) {
process.nextTick(cb)
}
fs.lchownSync = function () {}
}
// on Windows, A/V software can lock the directory, causing this
// to fail with an EACCES or EPERM if the directory contains newly
// created files. Try again on failure, for up to 1 second.
if (process.platform === "win32") {
var rename_ = fs.rename
fs.rename = function rename (from, to, cb) {
var start = Date.now()
rename_(from, to, function CB (er) {
if (er
&& (er.code === "EACCES" || er.code === "EPERM")
&& Date.now() - start < 1000) {
return rename_(from, to, CB)
}
cb(er)
})
}
}
// if read() returns EAGAIN, then just try it again.
var read = fs.read
fs.read = function (fd, buffer, offset, length, position, callback_) {
var callback
if (callback_ && typeof callback_ === 'function') {
var eagCounter = 0
callback = function (er, _, __) {
if (er && er.code === 'EAGAIN' && eagCounter < 10) {
eagCounter ++
return read.call(fs, fd, buffer, offset, length, position, callback)
}
callback_.apply(this, arguments)
}
}
return read.call(fs, fd, buffer, offset, length, position, callback)
}
var readSync = fs.readSync
fs.readSync = function (fd, buffer, offset, length, position) {
var eagCounter = 0
while (true) {
try {
return readSync.call(fs, fd, buffer, offset, length, position)
} catch (er) {
if (er.code === 'EAGAIN' && eagCounter < 10) {
eagCounter ++
continue
}
throw er
}
} }
} }

View file

@ -6,7 +6,7 @@
}, },
"name": "graceful-fs", "name": "graceful-fs",
"description": "A drop-in replacement for fs, making various improvements.", "description": "A drop-in replacement for fs, making various improvements.",
"version": "1.2.2", "version": "2.0.0",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git://github.com/isaacs/node-graceful-fs.git" "url": "git://github.com/isaacs/node-graceful-fs.git"
@ -43,10 +43,6 @@
"bugs": { "bugs": {
"url": "https://github.com/isaacs/node-graceful-fs/issues" "url": "https://github.com/isaacs/node-graceful-fs/issues"
}, },
"_id": "graceful-fs@1.2.2", "_id": "graceful-fs@2.0.0",
"_from": "graceful-fs@1.2.2", "_from": "graceful-fs@latest"
"dist": {
"shasum": "aeae2c55d489585241d9558c006406136ce176b8"
},
"_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.2.tgz"
} }

228
node_modules/graceful-fs/polyfills.js generated vendored Normal file
View file

@ -0,0 +1,228 @@
var fs = require('fs')
var constants = require('constants')
var origCwd = process.cwd
var cwd = null
process.cwd = function() {
if (!cwd)
cwd = origCwd.call(process)
return cwd
}
var chdir = process.chdir
process.chdir = function(d) {
cwd = null
chdir.call(process, d)
}
// (re-)implement some things that are known busted or missing.
// lchmod, broken prior to 0.6.2
// back-port the fix here.
if (constants.hasOwnProperty('O_SYMLINK') &&
process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
fs.lchmod = function (path, mode, callback) {
callback = callback || noop
fs.open( path
, constants.O_WRONLY | constants.O_SYMLINK
, mode
, function (err, fd) {
if (err) {
callback(err)
return
}
// prefer to return the chmod error, if one occurs,
// but still try to close, and report closing errors if they occur.
fs.fchmod(fd, mode, function (err) {
fs.close(fd, function(err2) {
callback(err || err2)
})
})
})
}
fs.lchmodSync = function (path, mode) {
var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)
// prefer to return the chmod error, if one occurs,
// but still try to close, and report closing errors if they occur.
var err, err2
try {
var ret = fs.fchmodSync(fd, mode)
} catch (er) {
err = er
}
try {
fs.closeSync(fd)
} catch (er) {
err2 = er
}
if (err || err2) throw (err || err2)
return ret
}
}
// lutimes implementation, or no-op
if (!fs.lutimes) {
if (constants.hasOwnProperty("O_SYMLINK")) {
fs.lutimes = function (path, at, mt, cb) {
fs.open(path, constants.O_SYMLINK, function (er, fd) {
cb = cb || noop
if (er) return cb(er)
fs.futimes(fd, at, mt, function (er) {
fs.close(fd, function (er2) {
return cb(er || er2)
})
})
})
}
fs.lutimesSync = function (path, at, mt) {
var fd = fs.openSync(path, constants.O_SYMLINK)
, err
, err2
, ret
try {
var ret = fs.futimesSync(fd, at, mt)
} catch (er) {
err = er
}
try {
fs.closeSync(fd)
} catch (er) {
err2 = er
}
if (err || err2) throw (err || err2)
return ret
}
} else if (fs.utimensat && constants.hasOwnProperty("AT_SYMLINK_NOFOLLOW")) {
// maybe utimensat will be bound soonish?
fs.lutimes = function (path, at, mt, cb) {
fs.utimensat(path, at, mt, constants.AT_SYMLINK_NOFOLLOW, cb)
}
fs.lutimesSync = function (path, at, mt) {
return fs.utimensatSync(path, at, mt, constants.AT_SYMLINK_NOFOLLOW)
}
} else {
fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) }
fs.lutimesSync = function () {}
}
}
// https://github.com/isaacs/node-graceful-fs/issues/4
// Chown should not fail on einval or eperm if non-root.
fs.chown = chownFix(fs.chown)
fs.fchown = chownFix(fs.fchown)
fs.lchown = chownFix(fs.lchown)
fs.chownSync = chownFixSync(fs.chownSync)
fs.fchownSync = chownFixSync(fs.fchownSync)
fs.lchownSync = chownFixSync(fs.lchownSync)
function chownFix (orig) {
if (!orig) return orig
return function (target, uid, gid, cb) {
return orig.call(fs, target, uid, gid, function (er, res) {
if (chownErOk(er)) er = null
cb(er, res)
})
}
}
function chownFixSync (orig) {
if (!orig) return orig
return function (target, uid, gid) {
try {
return orig.call(fs, target, uid, gid)
} catch (er) {
if (!chownErOk(er)) throw er
}
}
}
function chownErOk (er) {
// if there's no getuid, or if getuid() is something other than 0,
// and the error is EINVAL or EPERM, then just ignore it.
// This specific case is a silent failure in cp, install, tar,
// and most other unix tools that manage permissions.
// When running as root, or if other types of errors are encountered,
// then it's strict.
if (!er || (!process.getuid || process.getuid() !== 0)
&& (er.code === "EINVAL" || er.code === "EPERM")) return true
}
// if lchmod/lchown do not exist, then make them no-ops
if (!fs.lchmod) {
fs.lchmod = function (path, mode, cb) {
process.nextTick(cb)
}
fs.lchmodSync = function () {}
}
if (!fs.lchown) {
fs.lchown = function (path, uid, gid, cb) {
process.nextTick(cb)
}
fs.lchownSync = function () {}
}
// on Windows, A/V software can lock the directory, causing this
// to fail with an EACCES or EPERM if the directory contains newly
// created files. Try again on failure, for up to 1 second.
if (process.platform === "win32") {
var rename_ = fs.rename
fs.rename = function rename (from, to, cb) {
var start = Date.now()
rename_(from, to, function CB (er) {
if (er
&& (er.code === "EACCES" || er.code === "EPERM")
&& Date.now() - start < 1000) {
return rename_(from, to, CB)
}
cb(er)
})
}
}
// if read() returns EAGAIN, then just try it again.
var read = fs.read
fs.read = function (fd, buffer, offset, length, position, callback_) {
var callback
if (callback_ && typeof callback_ === 'function') {
var eagCounter = 0
callback = function (er, _, __) {
if (er && er.code === 'EAGAIN' && eagCounter < 10) {
eagCounter ++
return read.call(fs, fd, buffer, offset, length, position, callback)
}
callback_.apply(this, arguments)
}
}
return read.call(fs, fd, buffer, offset, length, position, callback)
}
var readSync = fs.readSync
fs.readSync = function (fd, buffer, offset, length, position) {
var eagCounter = 0
while (true) {
try {
return readSync.call(fs, fd, buffer, offset, length, position)
} catch (er) {
if (er.code === 'EAGAIN' && eagCounter < 10) {
eagCounter ++
continue
}
throw er
}
}
}

39
node_modules/graceful-fs/test/open.js generated vendored Normal file
View file

@ -0,0 +1,39 @@
var test = require('tap').test
var fs = require('../graceful-fs.js')
test('graceful fs is monkeypatched fs', function (t) {
t.equal(fs, require('fs'))
t.end()
})
test('open an existing file works', function (t) {
var fd = fs.openSync(__filename, 'r')
fs.closeSync(fd)
fs.open(__filename, 'r', function (er, fd) {
if (er) throw er
fs.close(fd, function (er) {
if (er) throw er
t.pass('works')
t.end()
})
})
})
test('open a non-existing file throws', function (t) {
var er
try {
var fd = fs.openSync('this file does not exist', 'r')
} catch (x) {
er = x
}
t.ok(er, 'should throw')
t.notOk(fd, 'should not get an fd')
t.equal(er.code, 'ENOENT')
fs.open('neither does this file', 'r', function (er, fd) {
t.ok(er, 'should throw')
t.notOk(fd, 'should not get an fd')
t.equal(er.code, 'ENOENT')
t.end()
})
})

14
node_modules/inherits/LICENSE generated vendored Normal file
View file

@ -0,0 +1,14 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

77
node_modules/inherits/README.md generated vendored
View file

@ -1,51 +1,42 @@
A dead simple way to do inheritance in JS. Browser-friendly inheritance fully compatible with standard node.js
[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).
var inherits = require("inherits") 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.
function Animal () { While keeping you sure you are using standard `inherits`
this.alive = true implementation in node.js environment, it allows bundlers such as
} [browserify](https://github.com/substack/node-browserify) to not
Animal.prototype.say = function (what) { include full `util` package to your client code if all you need is
console.log(what) just `inherits` function. It worth, because browser shim for `util`
} package is large and `inherits` is often the single function you need
from it.
inherits(Dog, Animal) It's recommended to use this package instead of
function Dog () { `require('util').inherits` for any code that has chances to be used
Dog.super.apply(this) not only in node.js but in browser too.
}
Dog.prototype.sniff = function () {
this.say("sniff sniff")
}
Dog.prototype.bark = function () {
this.say("woof woof")
}
inherits(Chihuahua, Dog) ## usage
function Chihuahua () {
Chihuahua.super.apply(this)
}
Chihuahua.prototype.bark = function () {
this.say("yip yip")
}
// also works ```js
function Cat () { var inherits = require('inherits');
Cat.super.apply(this) // then use exactly as the standard one
} ```
Cat.prototype.hiss = function () {
this.say("CHSKKSS!!")
}
inherits(Cat, Animal, {
meow: function () { this.say("miao miao") }
})
Cat.prototype.purr = function () {
this.say("purr purr")
}
## note on version ~1.0
var c = new Chihuahua Version ~1.0 had completely different motivation and is not compatible
assert(c instanceof Chihuahua) neither with 2.0 nor with standard node.js `inherits`.
assert(c instanceof Dog)
assert(c instanceof Animal)
The actual function is laughably small. 10-lines small. 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

30
node_modules/inherits/inherits.js generated vendored
View file

@ -1,29 +1 @@
module.exports = inherits module.exports = require('util').inherits
function inherits (c, p, proto) {
proto = proto || {}
var e = {}
;[c.prototype, proto].forEach(function (s) {
Object.getOwnPropertyNames(s).forEach(function (k) {
e[k] = Object.getOwnPropertyDescriptor(s, k)
})
})
c.prototype = Object.create(p.prototype, e)
c.super = p
}
//function Child () {
// Child.super.call(this)
// console.error([this
// ,this.constructor
// ,this.constructor === Child
// ,this.constructor.super === Parent
// ,Object.getPrototypeOf(this) === Child.prototype
// ,Object.getPrototypeOf(Object.getPrototypeOf(this))
// === Parent.prototype
// ,this instanceof Child
// ,this instanceof Parent])
//}
//function Parent () {}
//inherits(Child, Parent)
//new Child

23
node_modules/inherits/inherits_browser.js generated vendored Normal file
View file

@ -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
}
}

27
node_modules/inherits/package.json generated vendored
View file

@ -1,28 +1,39 @@
{ {
"name": "inherits", "name": "inherits",
"description": "A tiny simple way to do classic inheritance in js", "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()",
"version": "1.0.0", "version": "2.0.0",
"keywords": [ "keywords": [
"inheritance", "inheritance",
"class", "class",
"klass", "klass",
"oop", "oop",
"object-oriented" "object-oriented",
"inherits",
"browser",
"browserify"
], ],
"main": "./inherits.js", "main": "./inherits.js",
"browser": "./inherits_browser.js",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/isaacs/inherits" "url": "https://github.com/isaacs/inherits"
}, },
"license": {
"type": "WTFPL2"
},
"author": { "author": {
"name": "Isaac Z. Schlueter", "name": "Isaac Z. Schlueter",
"email": "i@izs.me", "email": "i@izs.me",
"url": "http://blog.izs.me/" "url": "http://blog.izs.me/"
}, },
"readme": "A dead simple way to do inheritance in JS.\n\n var inherits = require(\"inherits\")\n\n function Animal () {\n this.alive = true\n }\n Animal.prototype.say = function (what) {\n console.log(what)\n }\n\n inherits(Dog, Animal)\n function Dog () {\n Dog.super.apply(this)\n }\n Dog.prototype.sniff = function () {\n this.say(\"sniff sniff\")\n }\n Dog.prototype.bark = function () {\n this.say(\"woof woof\")\n }\n\n inherits(Chihuahua, Dog)\n function Chihuahua () {\n Chihuahua.super.apply(this)\n }\n Chihuahua.prototype.bark = function () {\n this.say(\"yip yip\")\n }\n\n // also works\n function Cat () {\n Cat.super.apply(this)\n }\n Cat.prototype.hiss = function () {\n this.say(\"CHSKKSS!!\")\n }\n inherits(Cat, Animal, {\n meow: function () { this.say(\"miao miao\") }\n })\n Cat.prototype.purr = function () {\n this.say(\"purr purr\")\n }\n\n\n var c = new Chihuahua\n assert(c instanceof Chihuahua)\n assert(c instanceof Dog)\n assert(c instanceof Animal)\n\nThe actual function is laughably small. 10-lines small.\n", "scripts": {
"_id": "inherits@1.0.0", "test": "node test"
"dist": {
"shasum": "f31c29ca5d0348508c1fb08655aa94e483a0c53e"
}, },
"_from": "inherits@1.0.0" "readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/inherits/issues"
},
"_id": "inherits@2.0.0",
"_from": "inherits@2.0.0"
} }

25
node_modules/inherits/test.js generated vendored Normal file
View file

@ -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')

23
node_modules/semver/README.md generated vendored
View file

@ -16,11 +16,12 @@ As a command-line utility:
$ semver -h $ semver -h
Usage: semver -v <version> [-r <range>] Usage: semver <version> [<version> [...]] [-r <range> | -i <inc> | -d <dec>]
Test if version(s) satisfy the supplied range(s), Test if version(s) satisfy the supplied range(s), and sort them.
and sort them.
Multiple versions or ranges may be supplied. Multiple versions or ranges may be supplied, unless increment
or decrement options are specified. In that case, only a single
version may be used, and it is incremented by the specified level
Program exits successfully if any valid version satisfies Program exits successfully if any valid version satisfies
all supplied ranges, and prints all satisfying versions. all supplied ranges, and prints all satisfying versions.
@ -59,9 +60,21 @@ The following range styles are supported:
using tilde operators, prerelease versions are supported as well, using tilde operators, prerelease versions are supported as well,
but a prerelease of the next significant digit will NOT be but a prerelease of the next significant digit will NOT be
satisfactory, so `1.3.0-beta` will not satisfy `~1.2.3`. satisfactory, so `1.3.0-beta` will not satisfy `~1.2.3`.
* `^1.2.3` := `>=1.2.3-0 <2.0.0-0` "Compatible with 1.2.3". When
using caret operators, anything from the specified version (including
prerelease) will be supported up to, but not including, the next
major version (or its prereleases). `1.5.1` will satisfy `^1.2.3`,
while `1.2.2` and `2.0.0-beta` will not.
* `^0.1.3` := `>=0.1.3-0 <0.2.0-0` "Compatible with 0.1.3". 0.x.x versions are
special: the first non-zero component indicates potentially breaking changes,
meaning the caret operator matches any version with the same first non-zero
component starting at the specified version.
* `^0.0.2` := `=0.0.2` "Only the version 0.0.2 is considered compatible"
* `~1.2` := `>=1.2.0-0 <1.3.0-0` "Any version starting with 1.2" * `~1.2` := `>=1.2.0-0 <1.3.0-0` "Any version starting with 1.2"
* `^1.2` := `>=1.2.0-0 <2.0.0-0` "Any version compatible with 1.2"
* `1.2.x` := `>=1.2.0-0 <1.3.0-0` "Any version starting with 1.2" * `1.2.x` := `>=1.2.0-0 <1.3.0-0` "Any version starting with 1.2"
* `~1` := `>=1.0.0-0 <2.0.0-0` "Any version starting with 1" * `~1` := `>=1.0.0-0 <2.0.0-0` "Any version starting with 1"
* `^1` := `>=1.0.0-0 <2.0.0-0` "Any version compatible with 1"
* `1.x` := `>=1.0.0-0 <2.0.0-0` "Any version starting with 1" * `1.x` := `>=1.0.0-0 <2.0.0-0` "Any version starting with 1"
@ -79,7 +92,7 @@ strings that they parse.
* valid(v): Return the parsed version, or null if it's not valid. * valid(v): Return the parsed version, or null if it's not valid.
* inc(v, release): Return the version incremented by the release type * inc(v, release): Return the version incremented by the release type
(major, minor, patch, or build), or null if it's not valid. (major, minor, patch, or prerelease), or null if it's not valid.
### Comparison ### Comparison

77
node_modules/semver/bin/semver generated vendored
View file

@ -9,6 +9,9 @@ var argv = process.argv.slice(2)
, gt = [] , gt = []
, lt = [] , lt = []
, eq = [] , eq = []
, inc = null
, version = require("../package.json").version
, loose = false
, semver = require("../semver") , semver = require("../semver")
main() main()
@ -16,11 +19,29 @@ main()
function main () { function main () {
if (!argv.length) return help() if (!argv.length) return help()
while (argv.length) { while (argv.length) {
var a var a = argv.shift()
switch (a = argv.shift()) { var i = a.indexOf('=')
if (i !== -1) {
a = a.slice(0, i)
argv.unshift(a.slice(i + 1))
}
switch (a) {
case "-l": case "--loose":
loose = true
break
case "-v": case "--version": case "-v": case "--version":
versions.push(argv.shift()) versions.push(argv.shift())
break break
case "-i": case "--inc": case "--increment":
switch (argv[0]) {
case "major": case "minor": case "patch": case "prerelease":
inc = argv.shift()
break
default:
inc = "patch"
break
}
break
case "-r": case "--range": case "-r": case "--range":
range.push(argv.shift()) range.push(argv.shift())
break break
@ -32,41 +53,67 @@ function main () {
} }
} }
versions = versions.filter(semver.valid) versions = versions.filter(function (v) {
return semver.valid(v, loose)
})
if (!versions.length) return fail() if (!versions.length) return fail()
if (inc && (versions.length !== 1 || range.length))
return failInc()
for (var i = 0, l = range.length; i < l ; i ++) { for (var i = 0, l = range.length; i < l ; i ++) {
versions = versions.filter(function (v) { versions = versions.filter(function (v) {
return semver.satisfies(v, range[i]) return semver.satisfies(v, range[i], loose)
}) })
if (!versions.length) return fail() if (!versions.length) return fail()
} }
return success(versions) return success(versions)
} }
function failInc () {
console.error("--inc can only be used on a single version with no range")
fail()
}
function fail () { process.exit(1) } function fail () { process.exit(1) }
function success () { function success () {
versions.sort(semver.compare) versions.sort(function (a, b) {
.map(semver.clean) return semver.compare(a, b, loose)
.forEach(function (v,i,_) { console.log(v) }) }).map(function (v) {
return semver.clean(v, loose)
}).map(function (v) {
return inc ? semver.inc(v, inc, loose) : v
}).forEach(function (v,i,_) { console.log(v) })
} }
function help () { function help () {
console.log(["Usage: semver -v <version> [-r <range>]" console.log(["SemVer " + version
,"Test if version(s) satisfy the supplied range(s),"
,"and sort them."
,"" ,""
,"Multiple versions or ranges may be supplied." ,"A JavaScript implementation of the http://semver.org/ specification"
,"Copyright Isaac Z. Schlueter"
,""
,"Usage: semver [options] <version> [<version> [...]]"
,"Prints valid versions sorted by SemVer precedence"
,""
,"Options:"
,"-r --range <range>"
," Print versions that match the specified range."
,""
,"-i --increment [<level>]"
," Increment a version by the specified level. Level can"
," be one of: major, minor, patch, or prerelease"
," Default level is 'patch'."
," Only one version may be specified."
,""
,"-l --loose"
," Interpret versions and ranges loosely"
,"" ,""
,"Program exits successfully if any valid version satisfies" ,"Program exits successfully if any valid version satisfies"
,"all supplied ranges, and prints all satisfying versions." ,"all supplied ranges, and prints all satisfying versions."
,"" ,""
,"If no versions are valid, or ranges are not satisfied," ,"If no satisfying versions are found, then exits failure."
,"then exits failure."
,"" ,""
,"Versions are printed in ascending order, so supplying" ,"Versions are printed in ascending order, so supplying"
,"multiple versions to the utility will just sort them." ,"multiple versions to the utility will just sort them."
].join("\n")) ].join("\n"))
} }

12
node_modules/semver/package.json generated vendored

File diff suppressed because one or more lines are too long

View file

@ -151,14 +151,29 @@ var LONETILDE = R++;
src[LONETILDE] = '(?:~>?)'; src[LONETILDE] = '(?:~>?)';
var TILDETRIM = R++; var TILDETRIM = R++;
src[TILDETRIM] = src[LONETILDE] + '\s+'; src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+';
var tildeTrimReplace = '$1'; re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g');
var tildeTrimReplace = '$1~';
var TILDE = R++; var TILDE = R++;
src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$';
var TILDELOOSE = R++; var TILDELOOSE = R++;
src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$';
// Caret ranges.
// Meaning is "at least and backwards compatible with"
var LONECARET = R++;
src[LONECARET] = '(?:\\^)';
var CARETTRIM = R++;
src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+';
re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g');
var caretTrimReplace = '$1^';
var CARET = R++;
src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$';
var CARETLOOSE = R++;
src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$';
// A simple gt/lt/eq thing, or just "" to indicate "any version" // A simple gt/lt/eq thing, or just "" to indicate "any version"
var COMPARATORLOOSE = R++; var COMPARATORLOOSE = R++;
@ -170,13 +185,12 @@ src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$';
// An expression to strip any whitespace between the gtlt and the thing // An expression to strip any whitespace between the gtlt and the thing
// it modifies, so that `> 1.2.3` ==> `>1.2.3` // it modifies, so that `> 1.2.3` ==> `>1.2.3`
var COMPARATORTRIM = R++; var COMPARATORTRIM = R++;
src[COMPARATORTRIM] = src[GTLT] + src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
'\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')';
// this one has to use the /g flag // this one has to use the /g flag
re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g');
var comparatorTrimReplace = '$1$2$3';
var comparatorTrimReplace = '$1$2 ';
// Something like `1.2.3 - 1.2.4` // Something like `1.2.3 - 1.2.4`
@ -593,6 +607,9 @@ Range.prototype.parseRange = function(range) {
// `~ 1.2.3` => `~1.2.3` // `~ 1.2.3` => `~1.2.3`
range = range.replace(re[TILDETRIM], tildeTrimReplace); range = range.replace(re[TILDETRIM], tildeTrimReplace);
// `^ 1.2.3` => `^1.2.3`
range = range.replace(re[CARETTRIM], caretTrimReplace);
// normalize spaces // normalize spaces
range = range.split(/\s+/).join(' '); range = range.split(/\s+/).join(' ');
@ -630,6 +647,8 @@ function toComparators(range, loose) {
// already replaced the hyphen ranges // already replaced the hyphen ranges
// turn into a set of JUST comparators. // turn into a set of JUST comparators.
function parseComparator(comp, loose) { function parseComparator(comp, loose) {
;
comp = replaceCarets(comp, loose);
; ;
comp = replaceTildes(comp, loose); comp = replaceTildes(comp, loose);
; ;
@ -685,6 +704,54 @@ function replaceTilde(comp, loose) {
}); });
} }
// ^ --> * (any, kinda silly)
// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
// ^1.2.3 --> >=1.2.3 <2.0.0
// ^1.2.0 --> >=1.2.0 <2.0.0
function replaceCarets(comp, loose) {
return comp.trim().split(/\s+/).map(function(comp) {
return replaceCaret(comp, loose);
}).join(' ');
}
function replaceCaret(comp, loose) {
var r = loose ? re[CARETLOOSE] : re[CARET];
return comp.replace(r, function(_, M, m, p, pr) {
;
var ret;
if (isX(M))
ret = '';
else if (isX(m))
ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0';
else if (isX(p))
if (M === '0') ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0';
else ret = '>=' + M + '.' + m + '.0-0 <' + (+M + 1) + '.0.0-0';
else if (pr) {
;
if (pr.charAt(0) !== '-')
pr = '-' + pr;
if (M === '0')
if (m === '0') ret = '=' + M + '.' + m + '.' + p + pr;
else ret = '>=' + M + '.' + m + '.' + p + pr +
' <' + M + '.' + (+m + 1) + '.0-0';
else ret = '>=' + M + '.' + m + '.' + p + pr +
' <' + (+M + 1) + '.0.0-0';
} else
if (M === '0')
if (m === '0') ret = '=' + M + '.' + m + '.' + p;
else ret = '>=' + M + '.' + m + '.' + p + '-0' +
' <' + M + '.' + (+m + 1) + '.0-0';
else ret = '>=' + M + '.' + m + '.' + p + '-0' +
' <' + (+M + 1) + '.0.0-0';
;
return ret;
});
}
function replaceXRanges(comp, loose) { function replaceXRanges(comp, loose) {
; ;
return comp.split(/\s+/).map(function(comp) { return comp.split(/\s+/).map(function(comp) {
@ -825,7 +892,9 @@ exports.maxSatisfying = maxSatisfying;
function maxSatisfying(versions, range, loose) { function maxSatisfying(versions, range, loose) {
return versions.filter(function(version) { return versions.filter(function(version) {
return satisfies(version, range, loose); return satisfies(version, range, loose);
}).sort(rcompare)[0] || null; }).sort(function(a, b) {
return rcompare(a, b, loose);
})[0] || null;
} }
exports.validRange = validRange; exports.validRange = validRange;

Binary file not shown.

83
node_modules/semver/semver.js generated vendored
View file

@ -161,14 +161,29 @@ var LONETILDE = R++;
src[LONETILDE] = '(?:~>?)'; src[LONETILDE] = '(?:~>?)';
var TILDETRIM = R++; var TILDETRIM = R++;
src[TILDETRIM] = src[LONETILDE] + '\s+'; src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+';
var tildeTrimReplace = '$1'; re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g');
var tildeTrimReplace = '$1~';
var TILDE = R++; var TILDE = R++;
src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$';
var TILDELOOSE = R++; var TILDELOOSE = R++;
src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$';
// Caret ranges.
// Meaning is "at least and backwards compatible with"
var LONECARET = R++;
src[LONECARET] = '(?:\\^)';
var CARETTRIM = R++;
src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+';
re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g');
var caretTrimReplace = '$1^';
var CARET = R++;
src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$';
var CARETLOOSE = R++;
src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$';
// A simple gt/lt/eq thing, or just "" to indicate "any version" // A simple gt/lt/eq thing, or just "" to indicate "any version"
var COMPARATORLOOSE = R++; var COMPARATORLOOSE = R++;
@ -180,13 +195,12 @@ src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$';
// An expression to strip any whitespace between the gtlt and the thing // An expression to strip any whitespace between the gtlt and the thing
// it modifies, so that `> 1.2.3` ==> `>1.2.3` // it modifies, so that `> 1.2.3` ==> `>1.2.3`
var COMPARATORTRIM = R++; var COMPARATORTRIM = R++;
src[COMPARATORTRIM] = src[GTLT] + src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
'\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')';
// this one has to use the /g flag // this one has to use the /g flag
re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g');
var comparatorTrimReplace = '$1$2$3';
var comparatorTrimReplace = '$1$2 ';
// Something like `1.2.3 - 1.2.4` // Something like `1.2.3 - 1.2.4`
@ -598,11 +612,14 @@ Range.prototype.parseRange = function(range) {
debug('hyphen replace', range); debug('hyphen replace', range);
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace);
debug('comparator trim', range); debug('comparator trim', range, re[COMPARATORTRIM]);
// `~ 1.2.3` => `~1.2.3` // `~ 1.2.3` => `~1.2.3`
range = range.replace(re[TILDETRIM], tildeTrimReplace); range = range.replace(re[TILDETRIM], tildeTrimReplace);
// `^ 1.2.3` => `^1.2.3`
range = range.replace(re[CARETTRIM], caretTrimReplace);
// normalize spaces // normalize spaces
range = range.split(/\s+/).join(' '); range = range.split(/\s+/).join(' ');
@ -641,6 +658,8 @@ function toComparators(range, loose) {
// turn into a set of JUST comparators. // turn into a set of JUST comparators.
function parseComparator(comp, loose) { function parseComparator(comp, loose) {
debug('comp', comp); debug('comp', comp);
comp = replaceCarets(comp, loose);
debug('caret', comp);
comp = replaceTildes(comp, loose); comp = replaceTildes(comp, loose);
debug('tildes', comp); debug('tildes', comp);
comp = replaceXRanges(comp, loose); comp = replaceXRanges(comp, loose);
@ -695,6 +714,54 @@ function replaceTilde(comp, loose) {
}); });
} }
// ^ --> * (any, kinda silly)
// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
// ^1.2.3 --> >=1.2.3 <2.0.0
// ^1.2.0 --> >=1.2.0 <2.0.0
function replaceCarets(comp, loose) {
return comp.trim().split(/\s+/).map(function(comp) {
return replaceCaret(comp, loose);
}).join(' ');
}
function replaceCaret(comp, loose) {
var r = loose ? re[CARETLOOSE] : re[CARET];
return comp.replace(r, function(_, M, m, p, pr) {
debug('caret', comp, _, M, m, p, pr);
var ret;
if (isX(M))
ret = '';
else if (isX(m))
ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0';
else if (isX(p))
if (M === '0') ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0';
else ret = '>=' + M + '.' + m + '.0-0 <' + (+M + 1) + '.0.0-0';
else if (pr) {
debug('replaceCaret pr', pr);
if (pr.charAt(0) !== '-')
pr = '-' + pr;
if (M === '0')
if (m === '0') ret = '=' + M + '.' + m + '.' + p + pr;
else ret = '>=' + M + '.' + m + '.' + p + pr +
' <' + M + '.' + (+m + 1) + '.0-0';
else ret = '>=' + M + '.' + m + '.' + p + pr +
' <' + (+M + 1) + '.0.0-0';
} else
if (M === '0')
if (m === '0') ret = '=' + M + '.' + m + '.' + p;
else ret = '>=' + M + '.' + m + '.' + p + '-0' +
' <' + M + '.' + (+m + 1) + '.0-0';
else ret = '>=' + M + '.' + m + '.' + p + '-0' +
' <' + (+M + 1) + '.0.0-0';
debug('caret return', ret);
return ret;
});
}
function replaceXRanges(comp, loose) { function replaceXRanges(comp, loose) {
debug('replaceXRanges', comp, loose); debug('replaceXRanges', comp, loose);
return comp.split(/\s+/).map(function(comp) { return comp.split(/\s+/).map(function(comp) {
@ -835,7 +902,9 @@ exports.maxSatisfying = maxSatisfying;
function maxSatisfying(versions, range, loose) { function maxSatisfying(versions, range, loose) {
return versions.filter(function(version) { return versions.filter(function(version) {
return satisfies(version, range, loose); return satisfies(version, range, loose);
}).sort(rcompare)[0] || null; }).sort(function(a, b) {
return rcompare(a, b, loose);
})[0] || null;
} }
exports.validRange = validRange; exports.validRange = validRange;

2
node_modules/semver/semver.min.js generated vendored

File diff suppressed because one or more lines are too long

BIN
node_modules/semver/semver.min.js.gz generated vendored

Binary file not shown.

556
node_modules/semver/test/index.js generated vendored Normal file
View file

@ -0,0 +1,556 @@
var tap = require('tap');
var test = tap.test;
var semver = require('../semver.js');
var eq = semver.eq;
var gt = semver.gt;
var lt = semver.lt;
var neq = semver.neq;
var cmp = semver.cmp;
var gte = semver.gte;
var lte = semver.lte;
var satisfies = semver.satisfies;
var validRange = semver.validRange;
var inc = semver.inc;
var replaceStars = semver.replaceStars;
var toComparators = semver.toComparators;
var SemVer = semver.SemVer;
var Range = semver.Range;
test('\ncomparison tests', function(t) {
// [version1, version2]
// version1 should be greater than version2
[['0.0.0', '0.0.0-foo'],
['0.0.1', '0.0.0'],
['1.0.0', '0.9.9'],
['0.10.0', '0.9.0'],
['0.99.0', '0.10.0'],
['2.0.0', '1.2.3'],
['v0.0.0', '0.0.0-foo', true],
['v0.0.1', '0.0.0', true],
['v1.0.0', '0.9.9', true],
['v0.10.0', '0.9.0', true],
['v0.99.0', '0.10.0', true],
['v2.0.0', '1.2.3', true],
['0.0.0', 'v0.0.0-foo', true],
['0.0.1', 'v0.0.0', true],
['1.0.0', 'v0.9.9', true],
['0.10.0', 'v0.9.0', true],
['0.99.0', 'v0.10.0', true],
['2.0.0', 'v1.2.3', true],
['1.2.3', '1.2.3-asdf'],
['1.2.3', '1.2.3-4'],
['1.2.3', '1.2.3-4-foo'],
['1.2.3-5-foo', '1.2.3-5'],
['1.2.3-5', '1.2.3-4'],
['1.2.3-5-foo', '1.2.3-5-Foo'],
['3.0.0', '2.7.2+asdf'],
['1.2.3-a.10', '1.2.3-a.5'],
['1.2.3-a.b', '1.2.3-a.5'],
['1.2.3-a.b', '1.2.3-a'],
['1.2.3-a.b.c.10.d.5', '1.2.3-a.b.c.5.d.100']
].forEach(function(v) {
var v0 = v[0];
var v1 = v[1];
var loose = v[2];
t.ok(gt(v0, v1, loose), "gt('" + v0 + "', '" + v1 + "')");
t.ok(lt(v1, v0, loose), "lt('" + v1 + "', '" + v0 + "')");
t.ok(!gt(v1, v0, loose), "!gt('" + v1 + "', '" + v0 + "')");
t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')");
t.ok(eq(v0, v0, loose), "eq('" + v0 + "', '" + v0 + "')");
t.ok(eq(v1, v1, loose), "eq('" + v1 + "', '" + v1 + "')");
t.ok(neq(v0, v1, loose), "neq('" + v0 + "', '" + v1 + "')");
t.ok(cmp(v1, '==', v1, loose), "cmp('" + v1 + "' == '" + v1 + "')");
t.ok(cmp(v0, '>=', v1, loose), "cmp('" + v0 + "' >= '" + v1 + "')");
t.ok(cmp(v1, '<=', v0, loose), "cmp('" + v1 + "' <= '" + v0 + "')");
t.ok(cmp(v0, '!=', v1, loose), "cmp('" + v0 + "' != '" + v1 + "')");
});
t.end();
});
test('\nequality tests', function(t) {
// [version1, version2]
// version1 should be equivalent to version2
[['1.2.3', 'v1.2.3', true],
['1.2.3', '=1.2.3', true],
['1.2.3', 'v 1.2.3', true],
['1.2.3', '= 1.2.3', true],
['1.2.3', ' v1.2.3', true],
['1.2.3', ' =1.2.3', true],
['1.2.3', ' v 1.2.3', true],
['1.2.3', ' = 1.2.3', true],
['1.2.3-0', 'v1.2.3-0', true],
['1.2.3-0', '=1.2.3-0', true],
['1.2.3-0', 'v 1.2.3-0', true],
['1.2.3-0', '= 1.2.3-0', true],
['1.2.3-0', ' v1.2.3-0', true],
['1.2.3-0', ' =1.2.3-0', true],
['1.2.3-0', ' v 1.2.3-0', true],
['1.2.3-0', ' = 1.2.3-0', true],
['1.2.3-1', 'v1.2.3-1', true],
['1.2.3-1', '=1.2.3-1', true],
['1.2.3-1', 'v 1.2.3-1', true],
['1.2.3-1', '= 1.2.3-1', true],
['1.2.3-1', ' v1.2.3-1', true],
['1.2.3-1', ' =1.2.3-1', true],
['1.2.3-1', ' v 1.2.3-1', true],
['1.2.3-1', ' = 1.2.3-1', true],
['1.2.3-beta', 'v1.2.3-beta', true],
['1.2.3-beta', '=1.2.3-beta', true],
['1.2.3-beta', 'v 1.2.3-beta', true],
['1.2.3-beta', '= 1.2.3-beta', true],
['1.2.3-beta', ' v1.2.3-beta', true],
['1.2.3-beta', ' =1.2.3-beta', true],
['1.2.3-beta', ' v 1.2.3-beta', true],
['1.2.3-beta', ' = 1.2.3-beta', true],
['1.2.3-beta+build', ' = 1.2.3-beta+otherbuild', true],
['1.2.3+build', ' = 1.2.3+otherbuild', true],
['1.2.3-beta+build', '1.2.3-beta+otherbuild'],
['1.2.3+build', '1.2.3+otherbuild'],
[' v1.2.3+build', '1.2.3+otherbuild']
].forEach(function(v) {
var v0 = v[0];
var v1 = v[1];
var loose = v[2];
t.ok(eq(v0, v1, loose), "eq('" + v0 + "', '" + v1 + "')");
t.ok(!neq(v0, v1, loose), "!neq('" + v0 + "', '" + v1 + "')");
t.ok(cmp(v0, '==', v1, loose), 'cmp(' + v0 + '==' + v1 + ')');
t.ok(!cmp(v0, '!=', v1, loose), '!cmp(' + v0 + '!=' + v1 + ')');
t.ok(!cmp(v0, '===', v1, loose), '!cmp(' + v0 + '===' + v1 + ')');
t.ok(cmp(v0, '!==', v1, loose), 'cmp(' + v0 + '!==' + v1 + ')');
t.ok(!gt(v0, v1, loose), "!gt('" + v0 + "', '" + v1 + "')");
t.ok(gte(v0, v1, loose), "gte('" + v0 + "', '" + v1 + "')");
t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')");
t.ok(lte(v0, v1, loose), "lte('" + v0 + "', '" + v1 + "')");
});
t.end();
});
test('\nrange tests', function(t) {
// [range, version]
// version should be included by range
[['1.0.0 - 2.0.0', '1.2.3'],
['1.0.0', '1.0.0'],
['>=*', '0.2.4'],
['', '1.0.0'],
['*', '1.2.3'],
['*', 'v1.2.3-foo', true],
['>=1.0.0', '1.0.0'],
['>=1.0.0', '1.0.1'],
['>=1.0.0', '1.1.0'],
['>1.0.0', '1.0.1'],
['>1.0.0', '1.1.0'],
['<=2.0.0', '2.0.0'],
['<=2.0.0', '1.9999.9999'],
['<=2.0.0', '0.2.9'],
['<2.0.0', '1.9999.9999'],
['<2.0.0', '0.2.9'],
['>= 1.0.0', '1.0.0'],
['>= 1.0.0', '1.0.1'],
['>= 1.0.0', '1.1.0'],
['> 1.0.0', '1.0.1'],
['> 1.0.0', '1.1.0'],
['<= 2.0.0', '2.0.0'],
['<= 2.0.0', '1.9999.9999'],
['<= 2.0.0', '0.2.9'],
['< 2.0.0', '1.9999.9999'],
['<\t2.0.0', '0.2.9'],
['>=0.1.97', 'v0.1.97', true],
['>=0.1.97', '0.1.97'],
['0.1.20 || 1.2.4', '1.2.4'],
['>=0.2.3 || <0.0.1', '0.0.0'],
['>=0.2.3 || <0.0.1', '0.2.3'],
['>=0.2.3 || <0.0.1', '0.2.4'],
['||', '1.3.4'],
['2.x.x', '2.1.3'],
['1.2.x', '1.2.3'],
['1.2.x || 2.x', '2.1.3'],
['1.2.x || 2.x', '1.2.3'],
['x', '1.2.3'],
['2.*.*', '2.1.3'],
['1.2.*', '1.2.3'],
['1.2.* || 2.*', '2.1.3'],
['1.2.* || 2.*', '1.2.3'],
['*', '1.2.3'],
['2', '2.1.2'],
['2.3', '2.3.1'],
['~2.4', '2.4.0'], // >=2.4.0 <2.5.0
['~2.4', '2.4.5'],
['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0,
['~1', '1.2.3'], // >=1.0.0 <2.0.0
['~>1', '1.2.3'],
['~> 1', '1.2.3'],
['~1.0', '1.0.2'], // >=1.0.0 <1.1.0,
['~ 1.0', '1.0.2'],
['~ 1.0.3', '1.0.12'],
['>=1', '1.0.0'],
['>= 1', '1.0.0'],
['<1.2', '1.1.1'],
['< 1.2', '1.1.1'],
['1', '1.0.0beta', true],
['~v0.5.4-pre', '0.5.5'],
['~v0.5.4-pre', '0.5.4'],
['=0.7.x', '0.7.2'],
['>=0.7.x', '0.7.2'],
['=0.7.x', '0.7.0-asdf'],
['>=0.7.x', '0.7.0-asdf'],
['<=0.7.x', '0.6.2'],
['~1.2.1 >=1.2.3', '1.2.3'],
['~1.2.1 =1.2.3', '1.2.3'],
['~1.2.1 1.2.3', '1.2.3'],
['~1.2.1 >=1.2.3 1.2.3', '1.2.3'],
['~1.2.1 1.2.3 >=1.2.3', '1.2.3'],
['~1.2.1 1.2.3', '1.2.3'],
['>=1.2.1 1.2.3', '1.2.3'],
['1.2.3 >=1.2.1', '1.2.3'],
['>=1.2.3 >=1.2.1', '1.2.3'],
['>=1.2.1 >=1.2.3', '1.2.3'],
['<=1.2.3', '1.2.3-beta'],
['>1.2', '1.3.0-beta'],
['>=1.2', '1.2.8'],
['^1.2.3', '1.8.1'],
['^1.2.3', '1.2.3-beta'],
['^0.1.2', '0.1.2'],
['^0.1', '0.1.2'],
['^1.2', '1.4.2'],
['^1.2 ^1', '1.4.2'],
['^1.2', '1.2.0-pre'],
['^1.2.3', '1.2.3-pre']
].forEach(function(v) {
var range = v[0];
var ver = v[1];
var loose = v[2];
t.ok(satisfies(ver, range, loose), range + ' satisfied by ' + ver);
});
t.end();
});
test('\nnegative range tests', function(t) {
// [range, version]
// version should not be included by range
[['1.0.0 - 2.0.0', '2.2.3'],
['1.0.0', '1.0.1'],
['>=1.0.0', '0.0.0'],
['>=1.0.0', '0.0.1'],
['>=1.0.0', '0.1.0'],
['>1.0.0', '0.0.1'],
['>1.0.0', '0.1.0'],
['<=2.0.0', '3.0.0'],
['<=2.0.0', '2.9999.9999'],
['<=2.0.0', '2.2.9'],
['<2.0.0', '2.9999.9999'],
['<2.0.0', '2.2.9'],
['>=0.1.97', 'v0.1.93', true],
['>=0.1.97', '0.1.93'],
['0.1.20 || 1.2.4', '1.2.3'],
['>=0.2.3 || <0.0.1', '0.0.3'],
['>=0.2.3 || <0.0.1', '0.2.2'],
['2.x.x', '1.1.3'],
['2.x.x', '3.1.3'],
['1.2.x', '1.3.3'],
['1.2.x || 2.x', '3.1.3'],
['1.2.x || 2.x', '1.1.3'],
['2.*.*', '1.1.3'],
['2.*.*', '3.1.3'],
['1.2.*', '1.3.3'],
['1.2.* || 2.*', '3.1.3'],
['1.2.* || 2.*', '1.1.3'],
['2', '1.1.2'],
['2.3', '2.4.1'],
['~2.4', '2.5.0'], // >=2.4.0 <2.5.0
['~2.4', '2.3.9'],
['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0
['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0
['~1', '0.2.3'], // >=1.0.0 <2.0.0
['~>1', '2.2.3'],
['~1.0', '1.1.0'], // >=1.0.0 <1.1.0
['<1', '1.0.0'],
['>=1.2', '1.1.1'],
['1', '2.0.0beta', true],
['~v0.5.4-beta', '0.5.4-alpha'],
['<1', '1.0.0beta', true],
['< 1', '1.0.0beta', true],
['=0.7.x', '0.8.2'],
['>=0.7.x', '0.6.2'],
['<=0.7.x', '0.7.2'],
['<1.2.3', '1.2.3-beta'],
['=1.2.3', '1.2.3-beta'],
['>1.2', '1.2.8'],
['^1.2.3', '2.0.0-alpha'],
['^1.2.3', '1.2.2'],
['^1.2', '1.1.9'],
// invalid ranges never satisfied!
['blerg', '1.2.3'],
['git+https://user:password0123@github.com/foo', '123.0.0', true],
['^1.2.3', '2.0.0-pre']
].forEach(function(v) {
var range = v[0];
var ver = v[1];
var loose = v[2];
var found = satisfies(ver, range, loose);
t.ok(!found, ver + ' not satisfied by ' + range);
});
t.end();
});
test('\nincrement versions test', function(t) {
// [version, inc, result]
// inc(version, inc) -> result
[['1.2.3', 'major', '2.0.0'],
['1.2.3', 'minor', '1.3.0'],
['1.2.3', 'patch', '1.2.4'],
['1.2.3tag', 'major', '2.0.0', true],
['1.2.3-tag', 'major', '2.0.0'],
['1.2.3', 'fake', null],
['fake', 'major', null],
['1.2.3', 'prerelease', '1.2.3-0'],
['1.2.3-0', 'prerelease', '1.2.3-1'],
['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1'],
['1.2.3-alpha.1', 'prerelease', '1.2.3-alpha.2'],
['1.2.3-alpha.2', 'prerelease', '1.2.3-alpha.3'],
['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta'],
['1.2.3-alpha.1.beta', 'prerelease', '1.2.3-alpha.2.beta'],
['1.2.3-alpha.2.beta', 'prerelease', '1.2.3-alpha.3.beta'],
['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta'],
['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta'],
['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta'],
['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1'],
['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2'],
['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3'],
['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta'],
['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta'],
['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta']
].forEach(function(v) {
var pre = v[0];
var what = v[1];
var wanted = v[2];
var loose = v[3];
var found = inc(pre, what, loose);
t.equal(found, wanted, 'inc(' + pre + ', ' + what + ') === ' + wanted);
});
t.end();
});
test('\nvalid range test', function(t) {
// [range, result]
// validRange(range) -> result
// translate ranges into their canonical form
[['1.0.0 - 2.0.0', '>=1.0.0 <=2.0.0'],
['1.0.0', '1.0.0'],
['>=*', '>=0.0.0-0'],
['', '*'],
['*', '*'],
['*', '*'],
['>=1.0.0', '>=1.0.0'],
['>1.0.0', '>1.0.0'],
['<=2.0.0', '<=2.0.0'],
['1', '>=1.0.0-0 <2.0.0-0'],
['<=2.0.0', '<=2.0.0'],
['<=2.0.0', '<=2.0.0'],
['<2.0.0', '<2.0.0-0'],
['<2.0.0', '<2.0.0-0'],
['>= 1.0.0', '>=1.0.0'],
['>= 1.0.0', '>=1.0.0'],
['>= 1.0.0', '>=1.0.0'],
['> 1.0.0', '>1.0.0'],
['> 1.0.0', '>1.0.0'],
['<= 2.0.0', '<=2.0.0'],
['<= 2.0.0', '<=2.0.0'],
['<= 2.0.0', '<=2.0.0'],
['< 2.0.0', '<2.0.0-0'],
['< 2.0.0', '<2.0.0-0'],
['>=0.1.97', '>=0.1.97'],
['>=0.1.97', '>=0.1.97'],
['0.1.20 || 1.2.4', '0.1.20||1.2.4'],
['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1-0'],
['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1-0'],
['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1-0'],
['||', '||'],
['2.x.x', '>=2.0.0-0 <3.0.0-0'],
['1.2.x', '>=1.2.0-0 <1.3.0-0'],
['1.2.x || 2.x', '>=1.2.0-0 <1.3.0-0||>=2.0.0-0 <3.0.0-0'],
['1.2.x || 2.x', '>=1.2.0-0 <1.3.0-0||>=2.0.0-0 <3.0.0-0'],
['x', '*'],
['2.*.*', '>=2.0.0-0 <3.0.0-0'],
['1.2.*', '>=1.2.0-0 <1.3.0-0'],
['1.2.* || 2.*', '>=1.2.0-0 <1.3.0-0||>=2.0.0-0 <3.0.0-0'],
['*', '*'],
['2', '>=2.0.0-0 <3.0.0-0'],
['2.3', '>=2.3.0-0 <2.4.0-0'],
['~2.4', '>=2.4.0-0 <2.5.0-0'],
['~2.4', '>=2.4.0-0 <2.5.0-0'],
['~>3.2.1', '>=3.2.1-0 <3.3.0-0'],
['~1', '>=1.0.0-0 <2.0.0-0'],
['~>1', '>=1.0.0-0 <2.0.0-0'],
['~> 1', '>=1.0.0-0 <2.0.0-0'],
['~1.0', '>=1.0.0-0 <1.1.0-0'],
['~ 1.0', '>=1.0.0-0 <1.1.0-0'],
['^0', '>=0.0.0-0 <1.0.0-0'],
['^ 1', '>=1.0.0-0 <2.0.0-0'],
['^0.1', '>=0.1.0-0 <0.2.0-0'],
['^1.0', '>=1.0.0-0 <2.0.0-0'],
['^1.2', '>=1.2.0-0 <2.0.0-0'],
['^0.0.1', '=0.0.1'],
['^0.0.1-beta', '=0.0.1-beta'],
['^0.1.2', '>=0.1.2-0 <0.2.0-0'],
['^1.2.3', '>=1.2.3-0 <2.0.0-0'],
['^1.2.3-beta.4', '>=1.2.3-beta.4 <2.0.0-0'],
['<1', '<1.0.0-0'],
['< 1', '<1.0.0-0'],
['>=1', '>=1.0.0-0'],
['>= 1', '>=1.0.0-0'],
['<1.2', '<1.2.0-0'],
['< 1.2', '<1.2.0-0'],
['1', '>=1.0.0-0 <2.0.0-0'],
['>01.02.03', '>1.2.3', true],
['>01.02.03', null],
['~1.2.3beta', '>=1.2.3-beta <1.3.0-0', true],
['~1.2.3beta', null],
['^ 1.2 ^ 1', '>=1.2.0-0 <2.0.0-0 >=1.0.0-0 <2.0.0-0']
].forEach(function(v) {
var pre = v[0];
var wanted = v[1];
var loose = v[2];
var found = validRange(pre, loose);
t.equal(found, wanted, 'validRange(' + pre + ') === ' + wanted);
});
t.end();
});
test('\ncomparators test', function(t) {
// [range, comparators]
// turn range into a set of individual comparators
[['1.0.0 - 2.0.0', [['>=1.0.0', '<=2.0.0']]],
['1.0.0', [['1.0.0']]],
['>=*', [['>=0.0.0-0']]],
['', [['']]],
['*', [['']]],
['*', [['']]],
['>=1.0.0', [['>=1.0.0']]],
['>=1.0.0', [['>=1.0.0']]],
['>=1.0.0', [['>=1.0.0']]],
['>1.0.0', [['>1.0.0']]],
['>1.0.0', [['>1.0.0']]],
['<=2.0.0', [['<=2.0.0']]],
['1', [['>=1.0.0-0', '<2.0.0-0']]],
['<=2.0.0', [['<=2.0.0']]],
['<=2.0.0', [['<=2.0.0']]],
['<2.0.0', [['<2.0.0-0']]],
['<2.0.0', [['<2.0.0-0']]],
['>= 1.0.0', [['>=1.0.0']]],
['>= 1.0.0', [['>=1.0.0']]],
['>= 1.0.0', [['>=1.0.0']]],
['> 1.0.0', [['>1.0.0']]],
['> 1.0.0', [['>1.0.0']]],
['<= 2.0.0', [['<=2.0.0']]],
['<= 2.0.0', [['<=2.0.0']]],
['<= 2.0.0', [['<=2.0.0']]],
['< 2.0.0', [['<2.0.0-0']]],
['<\t2.0.0', [['<2.0.0-0']]],
['>=0.1.97', [['>=0.1.97']]],
['>=0.1.97', [['>=0.1.97']]],
['0.1.20 || 1.2.4', [['0.1.20'], ['1.2.4']]],
['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1-0']]],
['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1-0']]],
['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1-0']]],
['||', [[''], ['']]],
['2.x.x', [['>=2.0.0-0', '<3.0.0-0']]],
['1.2.x', [['>=1.2.0-0', '<1.3.0-0']]],
['1.2.x || 2.x', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]],
['1.2.x || 2.x', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]],
['x', [['']]],
['2.*.*', [['>=2.0.0-0', '<3.0.0-0']]],
['1.2.*', [['>=1.2.0-0', '<1.3.0-0']]],
['1.2.* || 2.*', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]],
['1.2.* || 2.*', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]],
['*', [['']]],
['2', [['>=2.0.0-0', '<3.0.0-0']]],
['2.3', [['>=2.3.0-0', '<2.4.0-0']]],
['~2.4', [['>=2.4.0-0', '<2.5.0-0']]],
['~2.4', [['>=2.4.0-0', '<2.5.0-0']]],
['~>3.2.1', [['>=3.2.1-0', '<3.3.0-0']]],
['~1', [['>=1.0.0-0', '<2.0.0-0']]],
['~>1', [['>=1.0.0-0', '<2.0.0-0']]],
['~> 1', [['>=1.0.0-0', '<2.0.0-0']]],
['~1.0', [['>=1.0.0-0', '<1.1.0-0']]],
['~ 1.0', [['>=1.0.0-0', '<1.1.0-0']]],
['~ 1.0.3', [['>=1.0.3-0', '<1.1.0-0']]],
['~> 1.0.3', [['>=1.0.3-0', '<1.1.0-0']]],
['<1', [['<1.0.0-0']]],
['< 1', [['<1.0.0-0']]],
['>=1', [['>=1.0.0-0']]],
['>= 1', [['>=1.0.0-0']]],
['<1.2', [['<1.2.0-0']]],
['< 1.2', [['<1.2.0-0']]],
['1', [['>=1.0.0-0', '<2.0.0-0']]],
['1 2', [['>=1.0.0-0', '<2.0.0-0', '>=2.0.0-0', '<3.0.0-0']]],
['1.2 - 3.4.5', [['>=1.2.0-0', '<=3.4.5']]],
['1.2.3 - 3.4', [['>=1.2.3', '<3.5.0-0']]]
].forEach(function(v) {
var pre = v[0];
var wanted = v[1];
var found = toComparators(v[0]);
var jw = JSON.stringify(wanted);
t.equivalent(found, wanted, 'toComparators(' + pre + ') === ' + jw);
});
t.end();
});
test('\nstrict vs loose version numbers', function(t) {
[['=1.2.3', '1.2.3'],
['01.02.03', '1.2.3'],
['1.2.3-beta.01', '1.2.3-beta.1'],
[' =1.2.3', '1.2.3'],
['1.2.3foo', '1.2.3-foo']
].forEach(function(v) {
var loose = v[0];
var strict = v[1];
t.throws(function() {
new SemVer(loose);
});
var lv = new SemVer(loose, true);
t.equal(lv.version, strict);
t.ok(eq(loose, strict, true));
t.throws(function() {
eq(loose, strict);
});
t.throws(function() {
new SemVer(strict).compare(loose);
});
});
t.end();
});
test('\nstrict vs loose ranges', function(t) {
[['>=01.02.03', '>=1.2.3'],
['~1.02.03beta', '>=1.2.3-beta <1.3.0-0']
].forEach(function(v) {
var loose = v[0];
var comps = v[1];
t.throws(function() {
new Range(loose);
});
t.equal(new Range(loose, true).range, comps);
});
t.end();
});
test('\nmax satisfying', function(t) {
[[['1.2.3', '1.2.4'], '1.2', '1.2.4'],
[['1.2.4', '1.2.3'], '1.2', '1.2.4'],
[['1.2.3','1.2.4','1.2.5','1.2.6'], '~1.2.3', '1.2.6'],
[['1.1.0', '1.2.0', '1.2.1', '1.3.0', '2.0.0b1', '2.0.0b2', '2.0.0b3', '2.0.0', '2.1.0'], '~2.0.0', '2.0.0', true]
].forEach(function(v) {
var versions = v[0];
var range = v[1];
var expect = v[2];
var loose = v[3];
var actual = semver.maxSatisfying(versions, range, loose);
t.equal(actual, expect);
});
t.end();
});

27
node_modules/tar/README.md generated vendored
View file

@ -7,28 +7,25 @@ Tar for Node.js.
1. Be able to parse and reasonably extract the contents of any tar file 1. Be able to parse and reasonably extract the contents of any tar file
created by any program that creates tar files, period. created by any program that creates tar files, period.
At least, this includes every version of: At least, this includes every version of:
* bsdtar * bsdtar
* gnutar * gnutar
* solaris posix tar * solaris posix tar
* Joerg Schilling's star ("Schilly tar") * Joerg Schilling's star ("Schilly tar")
2. Create tar files that can be extracted by any of the following tar 2. Create tar files that can be extracted by any of the following tar programs:
programs:
* bsdtar/libarchive version 2.6.2 * bsdtar/libarchive version 2.6.2
* gnutar 1.15 and above * gnutar 1.15 and above
* SunOS Posix tar * SunOS Posix tar
* Joerg Schilling's star ("Schilly tar") * Joerg Schilling's star ("Schilly tar")
3. 100% test coverage. Speed is important. Correctness is slightly 3. 100% test coverage. Speed is important. Correctness is slightly more important.
more important.
4. Create the kind of tar interface that Node users would want to use. 4. Create the kind of tar interface that Node users would want to use.
5. Satisfy npm's needs for a portable tar implementation with a 5. Satisfy npm's needs for a portable tar implementation with a JavaScript interface.
JavaScript interface.
6. No excuses. No complaining. No tolerance for failure. 6. No excuses. No complaining. No tolerance for failure.

View file

@ -20,11 +20,11 @@ function BufferEntry () {
}) })
} }
inherits(BufferEntry, Entry)
// collect the bytes as they come in. // collect the bytes as they come in.
BufferEntry.prototype.write = function (c) { BufferEntry.prototype.write = function (c) {
c.copy(this._buffer, this._offset) c.copy(this._buffer, this._offset)
this._offset += c.length this._offset += c.length
Entry.prototype.write.call(this, c) Entry.prototype.write.call(this, c)
} }
inherits(BufferEntry, Entry)

299
node_modules/tar/lib/entry.js generated vendored
View file

@ -45,168 +45,169 @@ function Entry (header, extended, global) {
this._setProps() this._setProps()
} }
inherits(Entry, Stream, inherits(Entry, Stream)
{ write: function (c) {
if (this._ending) this.error("write() after end()", null, true)
if (this._remaining === 0) {
this.error("invalid bytes past eof")
}
// often we'll get a bunch of \0 at the end of the last write, Entry.prototype.write = function (c) {
// since chunks will always be 512 bytes when reading a tarball. if (this._ending) this.error("write() after end()", null, true)
if (c.length > this._remaining) { if (this._remaining === 0) {
c = c.slice(0, this._remaining) this.error("invalid bytes past eof")
}
this._remaining -= c.length
// put it on the stack.
var ql = this._queueLen
this._queue.push(c)
this._queueLen ++
this._read()
// either paused, or buffered
if (this._paused || ql > 0) {
this._needDrain = true
return false
}
return true
} }
, end: function (c) { // often we'll get a bunch of \0 at the end of the last write,
if (c) this.write(c) // since chunks will always be 512 bytes when reading a tarball.
this._ending = true if (c.length > this._remaining) {
this._read() c = c.slice(0, this._remaining)
}
this._remaining -= c.length
// put it on the stack.
var ql = this._queueLen
this._queue.push(c)
this._queueLen ++
this._read()
// either paused, or buffered
if (this._paused || ql > 0) {
this._needDrain = true
return false
} }
, pause: function () { return true
this._paused = true }
this.emit("pause")
}
, resume: function () { Entry.prototype.end = function (c) {
// console.error(" Tar Entry resume", this.path) if (c) this.write(c)
this.emit("resume") this._ending = true
this._paused = false this._read()
this._read() }
return this._queueLen - this._index > 1
} Entry.prototype.pause = function () {
this._paused = true
this.emit("pause")
}
Entry.prototype.resume = function () {
// console.error(" Tar Entry resume", this.path)
this.emit("resume")
this._paused = false
this._read()
return this._queueLen - this._index > 1
}
// This is bound to the instance // This is bound to the instance
, _read: function () { Entry.prototype._read = function () {
// console.error(" Tar Entry _read", this.path) // console.error(" Tar Entry _read", this.path)
if (this._paused || this._reading || this._ended) return if (this._paused || this._reading || this._ended) return
// set this flag so that event handlers don't inadvertently // set this flag so that event handlers don't inadvertently
// get multiple _read() calls running. // get multiple _read() calls running.
this._reading = true this._reading = true
// have any data to emit? // have any data to emit?
while (this._index < this._queueLen && !this._paused) { while (this._index < this._queueLen && !this._paused) {
var chunk = this._queue[this._index ++] var chunk = this._queue[this._index ++]
this.emit("data", chunk) this.emit("data", chunk)
}
// check if we're drained
if (this._index >= this._queueLen) {
this._queue.length = this._queueLen = this._index = 0
if (this._needDrain) {
this._needDrain = false
this.emit("drain")
}
if (this._ending) {
this._ended = true
this.emit("end")
}
}
// if the queue gets too big, then pluck off whatever we can.
// this should be fairly rare.
var mql = this._maxQueueLen
if (this._queueLen > mql && this._index > 0) {
mql = Math.min(this._index, mql)
this._index -= mql
this._queueLen -= mql
this._queue = this._queue.slice(mql)
}
this._reading = false
} }
, _setProps: function () { // check if we're drained
// props = extended->global->header->{} if (this._index >= this._queueLen) {
var header = this._header this._queue.length = this._queueLen = this._index = 0
, extended = this._extended if (this._needDrain) {
, global = this._global this._needDrain = false
, props = this.props this.emit("drain")
// first get the values from the normal header.
var fields = tar.fields
for (var f = 0; fields[f] !== null; f ++) {
var field = fields[f]
, val = header[field]
if (typeof val !== "undefined") props[field] = val
} }
if (this._ending) {
// next, the global header for this file. this._ended = true
// numeric values, etc, will have already been parsed. this.emit("end")
;[global, extended].forEach(function (p) {
Object.keys(p).forEach(function (f) {
if (typeof p[f] !== "undefined") props[f] = p[f]
})
})
// no nulls allowed in path or linkpath
;["path", "linkpath"].forEach(function (p) {
if (props.hasOwnProperty(p)) {
props[p] = props[p].split("\0")[0]
}
})
// set date fields to be a proper date
;["mtime", "ctime", "atime"].forEach(function (p) {
if (props.hasOwnProperty(p)) {
props[p] = new Date(props[p] * 1000)
}
})
// set the type so that we know what kind of file to create
var type
switch (tar.types[props.type]) {
case "OldFile":
case "ContiguousFile":
type = "File"
break
case "GNUDumpDir":
type = "Directory"
break
case undefined:
type = "Unknown"
break
case "Link":
case "SymbolicLink":
case "CharacterDevice":
case "BlockDevice":
case "Directory":
case "FIFO":
default:
type = tar.types[props.type]
} }
this.type = type
this.path = props.path
this.size = props.size
// size is special, since it signals when the file needs to end.
this._remaining = props.size
} }
, warn: fstream.warn
, error: fstream.error // if the queue gets too big, then pluck off whatever we can.
}) // this should be fairly rare.
var mql = this._maxQueueLen
if (this._queueLen > mql && this._index > 0) {
mql = Math.min(this._index, mql)
this._index -= mql
this._queueLen -= mql
this._queue = this._queue.slice(mql)
}
this._reading = false
}
Entry.prototype._setProps = function () {
// props = extended->global->header->{}
var header = this._header
, extended = this._extended
, global = this._global
, props = this.props
// first get the values from the normal header.
var fields = tar.fields
for (var f = 0; fields[f] !== null; f ++) {
var field = fields[f]
, val = header[field]
if (typeof val !== "undefined") props[field] = val
}
// next, the global header for this file.
// numeric values, etc, will have already been parsed.
;[global, extended].forEach(function (p) {
Object.keys(p).forEach(function (f) {
if (typeof p[f] !== "undefined") props[f] = p[f]
})
})
// no nulls allowed in path or linkpath
;["path", "linkpath"].forEach(function (p) {
if (props.hasOwnProperty(p)) {
props[p] = props[p].split("\0")[0]
}
})
// set date fields to be a proper date
;["mtime", "ctime", "atime"].forEach(function (p) {
if (props.hasOwnProperty(p)) {
props[p] = new Date(props[p] * 1000)
}
})
// set the type so that we know what kind of file to create
var type
switch (tar.types[props.type]) {
case "OldFile":
case "ContiguousFile":
type = "File"
break
case "GNUDumpDir":
type = "Directory"
break
case undefined:
type = "Unknown"
break
case "Link":
case "SymbolicLink":
case "CharacterDevice":
case "BlockDevice":
case "Directory":
case "FIFO":
default:
type = tar.types[props.type]
}
this.type = type
this.path = props.path
this.size = props.size
// size is special, since it signals when the file needs to end.
this._remaining = props.size
}
Entry.prototype.warn = fstream.warn
Entry.prototype.error = fstream.error

View file

@ -8,7 +8,6 @@ inherits(ExtendedHeaderWriter, EntryWriter)
var tar = require("../tar.js") var tar = require("../tar.js")
, path = require("path") , path = require("path")
, inherits = require("inherits")
, TarHeader = require("./header.js") , TarHeader = require("./header.js")
// props is the props of the thing we need to write an // props is the props of the thing we need to write an

View file

@ -30,7 +30,8 @@ function ExtendedHeader () {
this._key = "" this._key = ""
} }
inherits(ExtendedHeader, Entry, { _parse: parse }) inherits(ExtendedHeader, Entry)
ExtendedHeader.prototype._parse = parse
var s = 0 var s = 0
, states = ExtendedHeader.states = {} , states = ExtendedHeader.states = {}

View file

@ -6,7 +6,7 @@
}, },
"name": "block-stream", "name": "block-stream",
"description": "a stream of blocks", "description": "a stream of blocks",
"version": "0.0.6", "version": "0.0.7",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git://github.com/isaacs/block-stream.git" "url": "git://github.com/isaacs/block-stream.git"
@ -16,7 +16,7 @@
}, },
"main": "block-stream.js", "main": "block-stream.js",
"dependencies": { "dependencies": {
"inherits": "~1.0.0" "inherits": "~2.0.0"
}, },
"devDependencies": { "devDependencies": {
"tap": "0.x" "tap": "0.x"
@ -27,10 +27,9 @@
"license": "BSD", "license": "BSD",
"readme": "# block-stream\n\nA stream of blocks.\n\nWrite data into it, and it'll output data in buffer blocks the size you\nspecify, padding with zeroes if necessary.\n\n```javascript\nvar block = new BlockStream(512)\nfs.createReadStream(\"some-file\").pipe(block)\nblock.pipe(fs.createWriteStream(\"block-file\"))\n```\n\nWhen `.end()` or `.flush()` is called, it'll pad the block with zeroes.\n", "readme": "# block-stream\n\nA stream of blocks.\n\nWrite data into it, and it'll output data in buffer blocks the size you\nspecify, padding with zeroes if necessary.\n\n```javascript\nvar block = new BlockStream(512)\nfs.createReadStream(\"some-file\").pipe(block)\nblock.pipe(fs.createWriteStream(\"block-file\"))\n```\n\nWhen `.end()` or `.flush()` is called, it'll pad the block with zeroes.\n",
"readmeFilename": "README.md", "readmeFilename": "README.md",
"_id": "block-stream@0.0.6", "bugs": {
"dist": { "url": "https://github.com/isaacs/block-stream/issues"
"shasum": "5398f0a0f4acd378e82bd94c0c6d60a16a02b262"
}, },
"_from": "block-stream@*", "_id": "block-stream@0.0.7",
"_resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.6.tgz" "_from": "block-stream@*"
} }

15
node_modules/tar/package.json generated vendored
View file

@ -6,7 +6,7 @@
}, },
"name": "tar", "name": "tar",
"description": "tar for node", "description": "tar for node",
"version": "0.1.17", "version": "0.1.18",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git://github.com/isaacs/node-tar.git" "url": "git://github.com/isaacs/node-tar.git"
@ -16,7 +16,7 @@
"test": "tap test/*.js" "test": "tap test/*.js"
}, },
"dependencies": { "dependencies": {
"inherits": "1.x", "inherits": "2",
"block-stream": "*", "block-stream": "*",
"fstream": "~0.1.8" "fstream": "~0.1.8"
}, },
@ -25,12 +25,11 @@
"rimraf": "1.x" "rimraf": "1.x"
}, },
"license": "BSD", "license": "BSD",
"readme": "# node-tar\n\nTar for Node.js.\n\n## Goals of this project\n\n1. Be able to parse and reasonably extract the contents of any tar file\n created by any program that creates tar files, period.\n\n At least, this includes every version of:\n\n * bsdtar\n * gnutar\n * solaris posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n2. Create tar files that can be extracted by any of the following tar\n programs:\n\n * bsdtar/libarchive version 2.6.2\n * gnutar 1.15 and above\n * SunOS Posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n3. 100% test coverage. Speed is important. Correctness is slightly\n more important.\n\n4. Create the kind of tar interface that Node users would want to use.\n\n5. Satisfy npm's needs for a portable tar implementation with a\n JavaScript interface.\n\n6. No excuses. No complaining. No tolerance for failure.\n\n## But isn't there already a tar.js?\n\nYes, there are a few. This one is going to be better, and it will be\nfanatically maintained, because npm will depend on it.\n\nThat's why I need to write it from scratch. Creating and extracting\ntarballs is such a large part of what npm does, I simply can't have it\nbe a black box any longer.\n\n## Didn't you have something already? Where'd it go?\n\nIt's in the \"old\" folder. It's not functional. Don't use it.\n\nIt was a useful exploration to learn the issues involved, but like most\nsoftware of any reasonable complexity, node-tar won't be useful until\nit's been written at least 3 times.\n", "readme": "# node-tar\n\nTar for Node.js.\n\n## Goals of this project\n\n1. Be able to parse and reasonably extract the contents of any tar file\n created by any program that creates tar files, period.\n\n At least, this includes every version of:\n\n * bsdtar\n * gnutar\n * solaris posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n2. Create tar files that can be extracted by any of the following tar programs:\n\n * bsdtar/libarchive version 2.6.2\n * gnutar 1.15 and above\n * SunOS Posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n3. 100% test coverage. Speed is important. Correctness is slightly more important.\n\n4. Create the kind of tar interface that Node users would want to use.\n\n5. Satisfy npm's needs for a portable tar implementation with a JavaScript interface.\n\n6. No excuses. No complaining. No tolerance for failure.\n\n## But isn't there already a tar.js?\n\nYes, there are a few. This one is going to be better, and it will be\nfanatically maintained, because npm will depend on it.\n\nThat's why I need to write it from scratch. Creating and extracting\ntarballs is such a large part of what npm does, I simply can't have it\nbe a black box any longer.\n\n## Didn't you have something already? Where'd it go?\n\nIt's in the \"old\" folder. It's not functional. Don't use it.\n\nIt was a useful exploration to learn the issues involved, but like most\nsoftware of any reasonable complexity, node-tar won't be useful until\nit's been written at least 3 times.\n",
"readmeFilename": "README.md", "readmeFilename": "README.md",
"_id": "tar@0.1.17", "bugs": {
"dist": { "url": "https://github.com/isaacs/node-tar/issues"
"shasum": "1ad787d4febf4b4c513e1cea6dcb1c02d9294026"
}, },
"_from": "tar@0.1.17", "_id": "tar@0.1.18",
"_resolved": "https://registry.npmjs.org/tar/-/tar-0.1.17.tgz" "_from": "tar@latest"
} }

53
node_modules/tar/test/00-setup-fixtures.js generated vendored Normal file
View file

@ -0,0 +1,53 @@
// the fixtures have some weird stuff that is painful
// to include directly in the repo for various reasons.
//
// So, unpack the fixtures with the system tar first.
//
// This means, of course, that it'll only work if you
// already have a tar implementation, and some of them
// will not properly unpack the fixtures anyway.
//
// But, since usually those tests will fail on Windows
// and other systems with less capable filesystems anyway,
// at least this way we don't cause inconveniences by
// merely cloning the repo or installing the package.
var tap = require("tap")
, child_process = require("child_process")
, rimraf = require("rimraf")
, test = tap.test
, path = require("path")
test("clean fixtures", function (t) {
rimraf(path.resolve(__dirname, "fixtures"), function (er) {
t.ifError(er, "rimraf ./fixtures/")
t.end()
})
})
test("clean tmp", function (t) {
rimraf(path.resolve(__dirname, "tmp"), function (er) {
t.ifError(er, "rimraf ./tmp/")
t.end()
})
})
test("extract fixtures", function (t) {
var c = child_process.spawn("tar"
,["xzvf", "fixtures.tgz"]
,{ cwd: __dirname })
c.stdout.on("data", errwrite)
c.stderr.on("data", errwrite)
function errwrite (chunk) {
process.stderr.write(chunk)
}
c.on("exit", function (code) {
t.equal(code, 0, "extract fixtures should exit with 0")
if (code) {
t.comment("Note, all tests from here on out will fail because of this.")
}
t.end()
})
})

358
node_modules/tar/test/extract.js generated vendored Normal file
View file

@ -0,0 +1,358 @@
var tap = require("tap")
, tar = require("../tar.js")
, fs = require("fs")
, path = require("path")
, file = path.resolve(__dirname, "fixtures/c.tar")
, target = path.resolve(__dirname, "tmp/extract-test")
, index = 0
, fstream = require("fstream")
, ee = 0
, expectEntries =
[ { path: 'c.txt',
mode: '644',
type: '0',
depth: undefined,
size: 513,
linkpath: '',
nlink: undefined,
dev: undefined,
ino: undefined },
{ path: 'cc.txt',
mode: '644',
type: '0',
depth: undefined,
size: 513,
linkpath: '',
nlink: undefined,
dev: undefined,
ino: undefined },
{ path: 'r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
mode: '644',
type: '0',
depth: undefined,
size: 100,
linkpath: '',
nlink: undefined,
dev: undefined,
ino: undefined },
{ path: 'Ω.txt',
mode: '644',
type: '0',
depth: undefined,
size: 2,
linkpath: '',
nlink: undefined,
dev: undefined,
ino: undefined },
{ path: 'Ω.txt',
mode: '644',
type: '0',
depth: undefined,
size: 2,
linkpath: '',
nlink: 1,
dev: 234881026,
ino: 51693379 },
{ path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
mode: '644',
type: '0',
depth: undefined,
size: 200,
linkpath: '',
nlink: 1,
dev: 234881026,
ino: 51681874 },
{ path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
mode: '644',
type: '0',
depth: undefined,
size: 201,
linkpath: '',
nlink: undefined,
dev: undefined,
ino: undefined },
{ path: '200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL',
mode: '777',
type: '2',
depth: undefined,
size: 0,
linkpath: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
nlink: undefined,
dev: undefined,
ino: undefined },
{ path: '200-hard',
mode: '644',
type: '0',
depth: undefined,
size: 200,
linkpath: '',
nlink: 2,
dev: 234881026,
ino: 51681874 },
{ path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
mode: '644',
type: '1',
depth: undefined,
size: 0,
linkpath: path.resolve(target, '200-hard'),
nlink: 2,
dev: 234881026,
ino: 51681874 } ]
, ef = 0
, expectFiles =
[ { path: '',
mode: '40755',
type: 'Directory',
depth: 0,
linkpath: undefined },
{ path: '/200-hard',
mode: '100644',
type: 'File',
depth: 1,
size: 200,
linkpath: undefined,
nlink: 2 },
{ path: '/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
mode: '100644',
type: 'Link',
depth: 1,
size: 200,
linkpath: path.join(target, '200-hard'),
nlink: 2 },
{ path: '/200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL',
mode: '120777',
type: 'SymbolicLink',
depth: 1,
size: 200,
linkpath: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
nlink: 1 },
{ path: '/c.txt',
mode: '100644',
type: 'File',
depth: 1,
size: 513,
linkpath: undefined,
nlink: 1 },
{ path: '/cc.txt',
mode: '100644',
type: 'File',
depth: 1,
size: 513,
linkpath: undefined,
nlink: 1 },
{ path: '/r',
mode: '40755',
type: 'Directory',
depth: 1,
linkpath: undefined },
{ path: '/r/e',
mode: '40755',
type: 'Directory',
depth: 2,
linkpath: undefined },
{ path: '/r/e/a',
mode: '40755',
type: 'Directory',
depth: 3,
linkpath: undefined },
{ path: '/r/e/a/l',
mode: '40755',
type: 'Directory',
depth: 4,
linkpath: undefined },
{ path: '/r/e/a/l/l',
mode: '40755',
type: 'Directory',
depth: 5,
linkpath: undefined },
{ path: '/r/e/a/l/l/y',
mode: '40755',
type: 'Directory',
depth: 6,
linkpath: undefined },
{ path: '/r/e/a/l/l/y/-',
mode: '40755',
type: 'Directory',
depth: 7,
linkpath: undefined },
{ path: '/r/e/a/l/l/y/-/d',
mode: '40755',
type: 'Directory',
depth: 8,
linkpath: undefined },
{ path: '/r/e/a/l/l/y/-/d/e',
mode: '40755',
type: 'Directory',
depth: 9,
linkpath: undefined },
{ path: '/r/e/a/l/l/y/-/d/e/e',
mode: '40755',
type: 'Directory',
depth: 10,
linkpath: undefined },
{ path: '/r/e/a/l/l/y/-/d/e/e/p',
mode: '40755',
type: 'Directory',
depth: 11,
linkpath: undefined },
{ path: '/r/e/a/l/l/y/-/d/e/e/p/-',
mode: '40755',
type: 'Directory',
depth: 12,
linkpath: undefined },
{ path: '/r/e/a/l/l/y/-/d/e/e/p/-/f',
mode: '40755',
type: 'Directory',
depth: 13,
linkpath: undefined },
{ path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o',
mode: '40755',
type: 'Directory',
depth: 14,
linkpath: undefined },
{ path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l',
mode: '40755',
type: 'Directory',
depth: 15,
linkpath: undefined },
{ path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d',
mode: '40755',
type: 'Directory',
depth: 16,
linkpath: undefined },
{ path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e',
mode: '40755',
type: 'Directory',
depth: 17,
linkpath: undefined },
{ path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r',
mode: '40755',
type: 'Directory',
depth: 18,
linkpath: undefined },
{ path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-',
mode: '40755',
type: 'Directory',
depth: 19,
linkpath: undefined },
{ path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p',
mode: '40755',
type: 'Directory',
depth: 20,
linkpath: undefined },
{ path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a',
mode: '40755',
type: 'Directory',
depth: 21,
linkpath: undefined },
{ path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t',
mode: '40755',
type: 'Directory',
depth: 22,
linkpath: undefined },
{ path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h',
mode: '40755',
type: 'Directory',
depth: 23,
linkpath: undefined },
{ path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
mode: '100644',
type: 'File',
depth: 24,
size: 100,
linkpath: undefined,
nlink: 1 },
{ path: '/Ω.txt',
mode: '100644',
type: 'File',
depth: 1,
size: 2,
linkpath: undefined,
nlink: 1 } ]
// The extract class basically just pipes the input
// to a Reader, and then to a fstream.DirWriter
// So, this is as much a test of fstream.Reader and fstream.Writer
// as it is of tar.Extract, but it sort of makes sense.
tap.test("extract test", function (t) {
var extract = tar.Extract(target)
var inp = fs.createReadStream(file)
// give it a weird buffer size to try to break in odd places
inp.bufferSize = 1234
inp.pipe(extract)
extract.on("end", function () {
t.equal(ee, expectEntries.length, "should see "+ee+" entries")
// should get no more entries after end
extract.removeAllListeners("entry")
extract.on("entry", function (e) {
t.fail("Should not get entries after end!")
})
next()
})
extract.on("entry", function (entry) {
var found =
{ path: entry.path
, mode: entry.props.mode.toString(8)
, type: entry.props.type
, depth: entry.props.depth
, size: entry.props.size
, linkpath: entry.props.linkpath
, nlink: entry.props.nlink
, dev: entry.props.dev
, ino: entry.props.ino
}
var wanted = expectEntries[ee ++]
t.equivalent(found, wanted, "tar entry " + ee + " " + wanted.path)
})
function next () {
var r = fstream.Reader({ path: target
, type: "Directory"
// this is just to encourage consistency
, sort: "alpha" })
r.on("ready", function () {
foundEntry(r)
})
r.on("end", finish)
function foundEntry (entry) {
var p = entry.path.substr(target.length)
var found =
{ path: p
, mode: entry.props.mode.toString(8)
, type: entry.props.type
, depth: entry.props.depth
, size: entry.props.size
, linkpath: entry.props.linkpath
, nlink: entry.props.nlink
}
var wanted = expectFiles[ef ++]
t.has(found, wanted, "unpacked file " + ef + " " + wanted.path)
entry.on("entry", foundEntry)
}
function finish () {
t.equal(ef, expectFiles.length, "should have "+ef+" items")
t.end()
}
}
})

BIN
node_modules/tar/test/fixtures.tgz generated vendored Normal file

Binary file not shown.

183
node_modules/tar/test/header.js generated vendored Normal file
View file

@ -0,0 +1,183 @@
var tap = require("tap")
var TarHeader = require("../lib/header.js")
var tar = require("../tar.js")
var fs = require("fs")
var headers =
{ "a.txt file header":
[ "612e747874000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030303036343420003035373736312000303030303234200030303030303030303430312031313635313336303333332030313234353100203000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
, { cksumValid: true
, path: 'a.txt'
, mode: 420
, uid: 24561
, gid: 20
, size: 257
, mtime: 1319493851
, cksum: 5417
, type: '0'
, linkpath: ''
, ustar: 'ustar\0'
, ustarver: '00'
, uname: 'isaacs'
, gname: 'staff'
, devmaj: 0
, devmin: 0
, fill: '' }
]
, "omega pax": // the extended header from omega tar.
[ "5061784865616465722fcea92e74787400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030303036343420003035373736312000303030303234200030303030303030303137302031313534333731303631312030313530353100207800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
, { cksumValid: true
, path: 'PaxHeader/Ω.txt'
, mode: 420
, uid: 24561
, gid: 20
, size: 120
, mtime: 1301254537
, cksum: 6697
, type: 'x'
, linkpath: ''
, ustar: 'ustar\0'
, ustarver: '00'
, uname: 'isaacs'
, gname: 'staff'
, devmaj: 0
, devmin: 0
, fill: '' } ]
, "omega file header":
[ "cea92e7478740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030303036343420003035373736312000303030303234200030303030303030303030322031313534333731303631312030313330373200203000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
, { cksumValid: true
, path: 'Ω.txt'
, mode: 420
, uid: 24561
, gid: 20
, size: 2
, mtime: 1301254537
, cksum: 5690
, type: '0'
, linkpath: ''
, ustar: 'ustar\0'
, ustarver: '00'
, uname: 'isaacs'
, gname: 'staff'
, devmaj: 0
, devmin: 0
, fill: '' } ]
, "foo.js file header":
[ "666f6f2e6a730000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030303036343420003035373736312000303030303234200030303030303030303030342031313534333637303734312030313236313700203000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
, { cksumValid: true
, path: 'foo.js'
, mode: 420
, uid: 24561
, gid: 20
, size: 4
, mtime: 1301246433
, cksum: 5519
, type: '0'
, linkpath: ''
, ustar: 'ustar\0'
, ustarver: '00'
, uname: 'isaacs'
, gname: 'staff'
, devmaj: 0
, devmin: 0
, fill: '' }
]
, "b.txt file header":
[ "622e747874000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030303036343420003035373736312000303030303234200030303030303030313030302031313635313336303637372030313234363100203000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
, { cksumValid: true
, path: 'b.txt'
, mode: 420
, uid: 24561
, gid: 20
, size: 512
, mtime: 1319494079
, cksum: 5425
, type: '0'
, linkpath: ''
, ustar: 'ustar\0'
, ustarver: '00'
, uname: 'isaacs'
, gname: 'staff'
, devmaj: 0
, devmin: 0
, fill: '' }
]
, "deep nested file":
[ "636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363633030303634342000303537373631200030303030323420003030303030303030313434203131363532313531353333203034333331340020300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000075737461720030306973616163730000000000000000000000000000000000000000000000000000737461666600000000000000000000000000000000000000000000000000000030303030303020003030303030302000722f652f612f6c2f6c2f792f2d2f642f652f652f702f2d2f662f6f2f6c2f642f652f722f2d2f702f612f742f680000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
, { cksumValid: true,
path: 'r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc'
, mode: 420
, uid: 24561
, gid: 20
, size: 100
, mtime: 1319687003
, cksum: 18124
, type: '0'
, linkpath: ''
, ustar: 'ustar\0'
, ustarver: '00'
, uname: 'isaacs'
, gname: 'staff'
, devmaj: 0
, devmin: 0
, fill: '' }
]
}
tap.test("parsing", function (t) {
Object.keys(headers).forEach(function (name) {
var h = headers[name]
, header = new Buffer(h[0], "hex")
, expect = h[1]
, parsed = new TarHeader(header)
// console.error(parsed)
t.has(parsed, expect, "parse " + name)
})
t.end()
})
tap.test("encoding", function (t) {
Object.keys(headers).forEach(function (name) {
var h = headers[name]
, expect = new Buffer(h[0], "hex")
, encoded = TarHeader.encode(h[1])
// might have slightly different bytes, since the standard
// isn't very strict, but should have the same semantics
// checkSum will be different, but cksumValid will be true
var th = new TarHeader(encoded)
delete h[1].block
delete h[1].needExtended
delete h[1].cksum
t.has(th, h[1], "fields "+name)
})
t.end()
})
// test these manually. they're a bit rare to find in the wild
tap.test("parseNumeric tests", function (t) {
var parseNumeric = TarHeader.parseNumeric
, numbers =
{ "303737373737373700": 2097151
, "30373737373737373737373700": 8589934591
, "303030303036343400": 420
, "800000ffffffffffff": 281474976710655
, "ffffff000000000001": -281474976710654
, "ffffff000000000000": -281474976710655
, "800000000000200000": 2097152
, "8000000000001544c5": 1393861
, "ffffffffffff1544c5": -15383354 }
Object.keys(numbers).forEach(function (n) {
var b = new Buffer(n, "hex")
t.equal(parseNumeric(b), numbers[n], n + " === " + numbers[n])
})
t.end()
})

854
node_modules/tar/test/pack-no-proprietary.js generated vendored Normal file
View file

@ -0,0 +1,854 @@
// This is exactly like test/pack.js, except that it's excluding
// any proprietary headers.
//
// This loses some information about the filesystem, but creates
// tarballs that are supported by more versions of tar, especially
// old non-spec-compliant copies of gnutar.
// the symlink file is excluded from git, because it makes
// windows freak the hell out.
var fs = require("fs")
, path = require("path")
, symlink = path.resolve(__dirname, "fixtures/symlink")
try { fs.unlinkSync(symlink) } catch (e) {}
fs.symlinkSync("./hardlink-1", symlink)
process.on("exit", function () {
fs.unlinkSync(symlink)
})
var tap = require("tap")
, tar = require("../tar.js")
, pkg = require("../package.json")
, Pack = tar.Pack
, fstream = require("fstream")
, Reader = fstream.Reader
, Writer = fstream.Writer
, input = path.resolve(__dirname, "fixtures/")
, target = path.resolve(__dirname, "tmp/pack.tar")
, uid = process.getuid ? process.getuid() : 0
, gid = process.getgid ? process.getgid() : 0
, entries =
// the global header and root fixtures/ dir are going to get
// a different date each time, so omit that bit.
// Also, dev/ino values differ across machines, so that's not
// included.
[ [ 'entry',
{ path: 'fixtures/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'extendedHeader',
{ path: 'PaxHeader/fixtures/200cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
mode: 420,
uid: uid,
gid: gid,
type: 'x',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' },
{ path: 'fixtures/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
uid: uid,
gid: gid,
size: 200 } ]
, [ 'entry',
{ path: 'fixtures/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
mode: 420,
uid: uid,
gid: gid,
size: 200,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/a.txt',
mode: 420,
uid: uid,
gid: gid,
size: 257,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/b.txt',
mode: 420,
uid: uid,
gid: gid,
size: 512,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/c.txt',
mode: 420,
uid: uid,
gid: gid,
size: 513,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/cc.txt',
mode: 420,
uid: uid,
gid: gid,
size: 513,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/foo.js',
mode: 420,
uid: uid,
gid: gid,
size: 4,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/hardlink-1',
mode: 420,
uid: uid,
gid: gid,
size: 200,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/hardlink-2',
mode: 420,
uid: uid,
gid: gid,
size: 0,
type: '1',
linkpath: 'fixtures/hardlink-1',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/omega.txt',
mode: 420,
uid: uid,
gid: gid,
size: 2,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/packtest/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/packtest/omega.txt',
mode: 420,
uid: uid,
gid: gid,
size: 2,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/packtest/star.4.html',
mode: 420,
uid: uid,
gid: gid,
size: 54081,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'extendedHeader',
{ path: 'PaxHeader/fixtures/packtest/Ω.txt',
mode: 420,
uid: uid,
gid: gid,
type: 'x',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' },
{ path: 'fixtures/packtest/Ω.txt',
uid: uid,
gid: gid,
size: 2 } ]
, [ 'entry',
{ path: 'fixtures/packtest/Ω.txt',
mode: 420,
uid: uid,
gid: gid,
size: 2,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
mode: 420,
uid: uid,
gid: gid,
size: 100,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/symlink',
uid: uid,
gid: gid,
size: 0,
type: '2',
linkpath: 'hardlink-1',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'extendedHeader',
{ path: 'PaxHeader/fixtures/Ω.txt',
mode: 420,
uid: uid,
gid: gid,
type: 'x',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' },
{ path: "fixtures/Ω.txt"
, uid: uid
, gid: gid
, size: 2 } ]
, [ 'entry',
{ path: 'fixtures/Ω.txt',
mode: 420,
uid: uid,
gid: gid,
size: 2,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
]
// first, make sure that the hardlinks are actually hardlinks, or this
// won't work. Git has a way of replacing them with a copy.
var hard1 = path.resolve(__dirname, "fixtures/hardlink-1")
, hard2 = path.resolve(__dirname, "fixtures/hardlink-2")
, fs = require("fs")
try { fs.unlinkSync(hard2) } catch (e) {}
fs.linkSync(hard1, hard2)
tap.test("with global header", { timeout: 10000 }, function (t) {
runTest(t, true)
})
tap.test("without global header", { timeout: 10000 }, function (t) {
runTest(t, false)
})
function alphasort (a, b) {
return a === b ? 0
: a.toLowerCase() > b.toLowerCase() ? 1
: a.toLowerCase() < b.toLowerCase() ? -1
: a > b ? 1
: -1
}
function runTest (t, doGH) {
var reader = Reader({ path: input
, filter: function () {
return !this.path.match(/\.(tar|hex)$/)
}
, sort: alphasort
})
var props = doGH ? pkg : {}
props.noProprietary = true
var pack = Pack(props)
var writer = Writer(target)
// global header should be skipped regardless, since it has no content.
var entry = 0
t.ok(reader, "reader ok")
t.ok(pack, "pack ok")
t.ok(writer, "writer ok")
pack.pipe(writer)
var parse = tar.Parse()
t.ok(parse, "parser should be ok")
pack.on("data", function (c) {
// console.error("PACK DATA")
if (c.length !== 512) {
// this one is too noisy, only assert if it'll be relevant
t.equal(c.length, 512, "parser should emit data in 512byte blocks")
}
parse.write(c)
})
pack.on("end", function () {
// console.error("PACK END")
t.pass("parser ends")
parse.end()
})
pack.on("error", function (er) {
t.fail("pack error", er)
})
parse.on("error", function (er) {
t.fail("parse error", er)
})
writer.on("error", function (er) {
t.fail("writer error", er)
})
reader.on("error", function (er) {
t.fail("reader error", er)
})
parse.on("*", function (ev, e) {
var wanted = entries[entry++]
if (!wanted) {
t.fail("unexpected event: "+ev)
return
}
t.equal(ev, wanted[0], "event type should be "+wanted[0])
if (ev !== wanted[0] || e.path !== wanted[1].path) {
console.error(wanted)
console.error([ev, e.props])
e.on("end", function () {
console.error(e.fields)
throw "break"
})
}
t.has(e.props, wanted[1], "properties "+wanted[1].path)
if (wanted[2]) {
e.on("end", function () {
if (!e.fields) {
t.ok(e.fields, "should get fields")
} else {
t.has(e.fields, wanted[2], "should get expected fields")
}
})
}
})
reader.pipe(pack)
writer.on("close", function () {
t.equal(entry, entries.length, "should get all expected entries")
t.pass("it finished")
t.end()
})
}

897
node_modules/tar/test/pack.js generated vendored Normal file
View file

@ -0,0 +1,897 @@
// the symlink file is excluded from git, because it makes
// windows freak the hell out.
var fs = require("fs")
, path = require("path")
, symlink = path.resolve(__dirname, "fixtures/symlink")
try { fs.unlinkSync(symlink) } catch (e) {}
fs.symlinkSync("./hardlink-1", symlink)
process.on("exit", function () {
fs.unlinkSync(symlink)
})
var tap = require("tap")
, tar = require("../tar.js")
, pkg = require("../package.json")
, Pack = tar.Pack
, fstream = require("fstream")
, Reader = fstream.Reader
, Writer = fstream.Writer
, input = path.resolve(__dirname, "fixtures/")
, target = path.resolve(__dirname, "tmp/pack.tar")
, uid = process.getuid ? process.getuid() : 0
, gid = process.getgid ? process.getgid() : 0
, entries =
// the global header and root fixtures/ dir are going to get
// a different date each time, so omit that bit.
// Also, dev/ino values differ across machines, so that's not
// included.
[ [ 'globalExtendedHeader',
{ path: 'PaxHeader/',
mode: 438,
uid: 0,
gid: 0,
type: 'g',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' },
{ "NODETAR.author": pkg.author,
"NODETAR.name": pkg.name,
"NODETAR.description": pkg.description,
"NODETAR.version": pkg.version,
"NODETAR.repository.type": pkg.repository.type,
"NODETAR.repository.url": pkg.repository.url,
"NODETAR.main": pkg.main,
"NODETAR.scripts.test": pkg.scripts.test } ]
, [ 'entry',
{ path: 'fixtures/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'extendedHeader',
{ path: 'PaxHeader/fixtures/200cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
mode: 420,
uid: uid,
gid: gid,
type: 'x',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' },
{ path: 'fixtures/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
'NODETAR.depth': '1',
'NODETAR.type': 'File',
nlink: 1,
uid: uid,
gid: gid,
size: 200,
'NODETAR.blksize': '4096',
'NODETAR.blocks': '8' } ]
, [ 'entry',
{ path: 'fixtures/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
mode: 420,
uid: uid,
gid: gid,
size: 200,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '',
'NODETAR.depth': '1',
'NODETAR.type': 'File',
nlink: 1,
'NODETAR.blksize': '4096',
'NODETAR.blocks': '8' } ]
, [ 'entry',
{ path: 'fixtures/a.txt',
mode: 420,
uid: uid,
gid: gid,
size: 257,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/b.txt',
mode: 420,
uid: uid,
gid: gid,
size: 512,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/c.txt',
mode: 420,
uid: uid,
gid: gid,
size: 513,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/cc.txt',
mode: 420,
uid: uid,
gid: gid,
size: 513,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/foo.js',
mode: 420,
uid: uid,
gid: gid,
size: 4,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/hardlink-1',
mode: 420,
uid: uid,
gid: gid,
size: 200,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/hardlink-2',
mode: 420,
uid: uid,
gid: gid,
size: 0,
type: '1',
linkpath: 'fixtures/hardlink-1',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/omega.txt',
mode: 420,
uid: uid,
gid: gid,
size: 2,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/packtest/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/packtest/omega.txt',
mode: 420,
uid: uid,
gid: gid,
size: 2,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/packtest/star.4.html',
mode: 420,
uid: uid,
gid: gid,
size: 54081,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'extendedHeader',
{ path: 'PaxHeader/fixtures/packtest/Ω.txt',
mode: 420,
uid: uid,
gid: gid,
type: 'x',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' },
{ path: 'fixtures/packtest/Ω.txt',
'NODETAR.depth': '2',
'NODETAR.type': 'File',
nlink: 1,
uid: uid,
gid: gid,
size: 2,
'NODETAR.blksize': '4096',
'NODETAR.blocks': '8' } ]
, [ 'entry',
{ path: 'fixtures/packtest/Ω.txt',
mode: 420,
uid: uid,
gid: gid,
size: 2,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '',
'NODETAR.depth': '2',
'NODETAR.type': 'File',
nlink: 1,
'NODETAR.blksize': '4096',
'NODETAR.blocks': '8' } ]
, [ 'entry',
{ path: 'fixtures/r/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/',
mode: 493,
uid: uid,
gid: gid,
size: 0,
type: '5',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
mode: 420,
uid: uid,
gid: gid,
size: 100,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'entry',
{ path: 'fixtures/symlink',
uid: uid,
gid: gid,
size: 0,
type: '2',
linkpath: 'hardlink-1',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' } ]
, [ 'extendedHeader',
{ path: 'PaxHeader/fixtures/Ω.txt',
mode: 420,
uid: uid,
gid: gid,
type: 'x',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '' },
{ path: "fixtures/Ω.txt"
, "NODETAR.depth": "1"
, "NODETAR.type": "File"
, nlink: 1
, uid: uid
, gid: gid
, size: 2
, "NODETAR.blksize": "4096"
, "NODETAR.blocks": "8" } ]
, [ 'entry',
{ path: 'fixtures/Ω.txt',
mode: 420,
uid: uid,
gid: gid,
size: 2,
type: '0',
linkpath: '',
ustar: 'ustar\u0000',
ustarver: '00',
uname: '',
gname: '',
devmaj: 0,
devmin: 0,
fill: '',
'NODETAR.depth': '1',
'NODETAR.type': 'File',
nlink: 1,
'NODETAR.blksize': '4096',
'NODETAR.blocks': '8' } ]
]
// first, make sure that the hardlinks are actually hardlinks, or this
// won't work. Git has a way of replacing them with a copy.
var hard1 = path.resolve(__dirname, "fixtures/hardlink-1")
, hard2 = path.resolve(__dirname, "fixtures/hardlink-2")
, fs = require("fs")
try { fs.unlinkSync(hard2) } catch (e) {}
fs.linkSync(hard1, hard2)
tap.test("with global header", { timeout: 10000 }, function (t) {
runTest(t, true)
})
tap.test("without global header", { timeout: 10000 }, function (t) {
runTest(t, false)
})
function alphasort (a, b) {
return a === b ? 0
: a.toLowerCase() > b.toLowerCase() ? 1
: a.toLowerCase() < b.toLowerCase() ? -1
: a > b ? 1
: -1
}
function runTest (t, doGH) {
var reader = Reader({ path: input
, filter: function () {
return !this.path.match(/\.(tar|hex)$/)
}
, sort: alphasort
})
var pack = Pack(doGH ? pkg : null)
var writer = Writer(target)
// skip the global header if we're not doing that.
var entry = doGH ? 0 : 1
t.ok(reader, "reader ok")
t.ok(pack, "pack ok")
t.ok(writer, "writer ok")
pack.pipe(writer)
var parse = tar.Parse()
t.ok(parse, "parser should be ok")
pack.on("data", function (c) {
// console.error("PACK DATA")
if (c.length !== 512) {
// this one is too noisy, only assert if it'll be relevant
t.equal(c.length, 512, "parser should emit data in 512byte blocks")
}
parse.write(c)
})
pack.on("end", function () {
// console.error("PACK END")
t.pass("parser ends")
parse.end()
})
pack.on("error", function (er) {
t.fail("pack error", er)
})
parse.on("error", function (er) {
t.fail("parse error", er)
})
writer.on("error", function (er) {
t.fail("writer error", er)
})
reader.on("error", function (er) {
t.fail("reader error", er)
})
parse.on("*", function (ev, e) {
var wanted = entries[entry++]
if (!wanted) {
t.fail("unexpected event: "+ev)
return
}
t.equal(ev, wanted[0], "event type should be "+wanted[0])
// if (ev !== wanted[0] || e.path !== wanted[1].path) {
// console.error(wanted)
// console.error([ev, e.props])
// throw "break"
// }
t.has(e.props, wanted[1], "properties "+wanted[1].path)
if (wanted[2]) {
e.on("end", function () {
if (!e.fields) {
t.ok(e.fields, "should get fields")
} else {
t.has(e.fields, wanted[2], "should get expected fields")
}
})
}
})
reader.pipe(pack)
writer.on("close", function () {
t.equal(entry, entries.length, "should get all expected entries")
t.pass("it finished")
t.end()
})
}

359
node_modules/tar/test/parse.js generated vendored Normal file
View file

@ -0,0 +1,359 @@
var tap = require("tap")
, tar = require("../tar.js")
, fs = require("fs")
, path = require("path")
, file = path.resolve(__dirname, "fixtures/c.tar")
, index = 0
, expect =
[ [ 'entry',
{ path: 'c.txt',
mode: 420,
uid: 24561,
gid: 20,
size: 513,
mtime: new Date('Wed, 26 Oct 2011 01:10:58 GMT'),
cksum: 5422,
type: '0',
linkpath: '',
ustar: 'ustar\0',
ustarver: '00',
uname: 'isaacs',
gname: 'staff',
devmaj: 0,
devmin: 0,
fill: '' },
undefined ],
[ 'entry',
{ path: 'cc.txt',
mode: 420,
uid: 24561,
gid: 20,
size: 513,
mtime: new Date('Wed, 26 Oct 2011 01:11:02 GMT'),
cksum: 5525,
type: '0',
linkpath: '',
ustar: 'ustar\0',
ustarver: '00',
uname: 'isaacs',
gname: 'staff',
devmaj: 0,
devmin: 0,
fill: '' },
undefined ],
[ 'entry',
{ path: 'r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
mode: 420,
uid: 24561,
gid: 20,
size: 100,
mtime: new Date('Thu, 27 Oct 2011 03:43:23 GMT'),
cksum: 18124,
type: '0',
linkpath: '',
ustar: 'ustar\0',
ustarver: '00',
uname: 'isaacs',
gname: 'staff',
devmaj: 0,
devmin: 0,
fill: '' },
undefined ],
[ 'entry',
{ path: 'Ω.txt',
mode: 420,
uid: 24561,
gid: 20,
size: 2,
mtime: new Date('Thu, 27 Oct 2011 17:51:49 GMT'),
cksum: 5695,
type: '0',
linkpath: '',
ustar: 'ustar\0',
ustarver: '00',
uname: 'isaacs',
gname: 'staff',
devmaj: 0,
devmin: 0,
fill: '' },
undefined ],
[ 'extendedHeader',
{ path: 'PaxHeader/Ω.txt',
mode: 420,
uid: 24561,
gid: 20,
size: 120,
mtime: new Date('Thu, 27 Oct 2011 17:51:49 GMT'),
cksum: 6702,
type: 'x',
linkpath: '',
ustar: 'ustar\0',
ustarver: '00',
uname: 'isaacs',
gname: 'staff',
devmaj: 0,
devmin: 0,
fill: '' },
{ path: 'Ω.txt',
ctime: 1319737909,
atime: 1319739061,
dev: 234881026,
ino: 51693379,
nlink: 1 } ],
[ 'entry',
{ path: 'Ω.txt',
mode: 420,
uid: 24561,
gid: 20,
size: 2,
mtime: new Date('Thu, 27 Oct 2011 17:51:49 GMT'),
cksum: 5695,
type: '0',
linkpath: '',
ustar: 'ustar\0',
ustarver: '00',
uname: 'isaacs',
gname: 'staff',
devmaj: 0,
devmin: 0,
fill: '',
ctime: new Date('Thu, 27 Oct 2011 17:51:49 GMT'),
atime: new Date('Thu, 27 Oct 2011 18:11:01 GMT'),
dev: 234881026,
ino: 51693379,
nlink: 1 },
undefined ],
[ 'extendedHeader',
{ path: 'PaxHeader/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
mode: 420,
uid: 24561,
gid: 20,
size: 353,
mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'),
cksum: 14488,
type: 'x',
linkpath: '',
ustar: 'ustar\0',
ustarver: '00',
uname: 'isaacs',
gname: 'staff',
devmaj: 0,
devmin: 0,
fill: '' },
{ path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
ctime: 1319686868,
atime: 1319741254,
'LIBARCHIVE.creationtime': '1319686852',
dev: 234881026,
ino: 51681874,
nlink: 1 } ],
[ 'entry',
{ path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
mode: 420,
uid: 24561,
gid: 20,
size: 200,
mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'),
cksum: 14570,
type: '0',
linkpath: '',
ustar: 'ustar\0',
ustarver: '00',
uname: 'isaacs',
gname: 'staff',
devmaj: 0,
devmin: 0,
fill: '',
ctime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'),
atime: new Date('Thu, 27 Oct 2011 18:47:34 GMT'),
'LIBARCHIVE.creationtime': '1319686852',
dev: 234881026,
ino: 51681874,
nlink: 1 },
undefined ],
[ 'longPath',
{ path: '././@LongLink',
mode: 0,
uid: 0,
gid: 0,
size: 201,
mtime: new Date('Thu, 01 Jan 1970 00:00:00 GMT'),
cksum: 4976,
type: 'L',
linkpath: '',
ustar: false },
'200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' ],
[ 'entry',
{ path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
mode: 420,
uid: 1000,
gid: 1000,
size: 201,
mtime: new Date('Thu, 27 Oct 2011 22:21:50 GMT'),
cksum: 14086,
type: '0',
linkpath: '',
ustar: false },
undefined ],
[ 'longLinkpath',
{ path: '././@LongLink',
mode: 0,
uid: 0,
gid: 0,
size: 201,
mtime: new Date('Thu, 01 Jan 1970 00:00:00 GMT'),
cksum: 4975,
type: 'K',
linkpath: '',
ustar: false },
'200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' ],
[ 'longPath',
{ path: '././@LongLink',
mode: 0,
uid: 0,
gid: 0,
size: 201,
mtime: new Date('Thu, 01 Jan 1970 00:00:00 GMT'),
cksum: 4976,
type: 'L',
linkpath: '',
ustar: false },
'200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL' ],
[ 'entry',
{ path: '200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL',
mode: 511,
uid: 1000,
gid: 1000,
size: 0,
mtime: new Date('Fri, 28 Oct 2011 23:05:17 GMT'),
cksum: 21603,
type: '2',
linkpath: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
ustar: false },
undefined ],
[ 'extendedHeader',
{ path: 'PaxHeader/200-hard',
mode: 420,
uid: 24561,
gid: 20,
size: 143,
mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'),
cksum: 6533,
type: 'x',
linkpath: '',
ustar: 'ustar\0',
ustarver: '00',
uname: 'isaacs',
gname: 'staff',
devmaj: 0,
devmin: 0,
fill: '' },
{ ctime: 1320617144,
atime: 1320617232,
'LIBARCHIVE.creationtime': '1319686852',
dev: 234881026,
ino: 51681874,
nlink: 2 } ],
[ 'entry',
{ path: '200-hard',
mode: 420,
uid: 24561,
gid: 20,
size: 200,
mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'),
cksum: 5526,
type: '0',
linkpath: '',
ustar: 'ustar\0',
ustarver: '00',
uname: 'isaacs',
gname: 'staff',
devmaj: 0,
devmin: 0,
fill: '',
ctime: new Date('Sun, 06 Nov 2011 22:05:44 GMT'),
atime: new Date('Sun, 06 Nov 2011 22:07:12 GMT'),
'LIBARCHIVE.creationtime': '1319686852',
dev: 234881026,
ino: 51681874,
nlink: 2 },
undefined ],
[ 'extendedHeader',
{ path: 'PaxHeader/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
mode: 420,
uid: 24561,
gid: 20,
size: 353,
mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'),
cksum: 14488,
type: 'x',
linkpath: '',
ustar: 'ustar\0',
ustarver: '00',
uname: 'isaacs',
gname: 'staff',
devmaj: 0,
devmin: 0,
fill: '' },
{ path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
ctime: 1320617144,
atime: 1320617406,
'LIBARCHIVE.creationtime': '1319686852',
dev: 234881026,
ino: 51681874,
nlink: 2 } ],
[ 'entry',
{ path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
mode: 420,
uid: 24561,
gid: 20,
size: 0,
mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'),
cksum: 15173,
type: '1',
linkpath: '200-hard',
ustar: 'ustar\0',
ustarver: '00',
uname: 'isaacs',
gname: 'staff',
devmaj: 0,
devmin: 0,
fill: '',
ctime: new Date('Sun, 06 Nov 2011 22:05:44 GMT'),
atime: new Date('Sun, 06 Nov 2011 22:10:06 GMT'),
'LIBARCHIVE.creationtime': '1319686852',
dev: 234881026,
ino: 51681874,
nlink: 2 },
undefined ] ]
tap.test("parser test", function (t) {
var parser = tar.Parse()
parser.on("end", function () {
t.equal(index, expect.length, "saw all expected events")
t.end()
})
fs.createReadStream(file)
.pipe(parser)
.on("*", function (ev, entry) {
var wanted = expect[index]
if (!wanted) {
return t.fail("Unexpected event: " + ev)
}
var result = [ev, entry.props]
entry.on("end", function () {
result.push(entry.fields || entry.body)
t.equal(ev, wanted[0], index + " event type")
t.equivalent(entry.props, wanted[1], wanted[1].path + " entry properties")
if (wanted[2]) {
t.equivalent(result[2], wanted[2], "metadata values")
}
index ++
})
})
})

20
node_modules/tar/test/zz-cleanup.js generated vendored Normal file
View file

@ -0,0 +1,20 @@
// clean up the fixtures
var tap = require("tap")
, rimraf = require("rimraf")
, test = tap.test
, path = require("path")
test("clean fixtures", function (t) {
rimraf(path.resolve(__dirname, "fixtures"), function (er) {
t.ifError(er, "rimraf ./fixtures/")
t.end()
})
})
test("clean tmp", function (t) {
rimraf(path.resolve(__dirname, "tmp"), function (er) {
t.ifError(er, "rimraf ./tmp/")
t.end()
})
})

View file

@ -31,7 +31,7 @@
"osenv": "0", "osenv": "0",
"request": "2", "request": "2",
"rimraf": "2", "rimraf": "2",
"semver": "~2.0.7", "semver": "~2.1",
"tar": "0", "tar": "0",
"which": "1" "which": "1"
}, },