mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2025-09-10 00:27:21 +00:00
push all website files
This commit is contained in:
4
website/node_modules/npm/node_modules/sha/.npmignore
generated
vendored
Normal file
4
website/node_modules/npm/node_modules/sha/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
node_modules
|
||||
test
|
||||
.gitignore
|
||||
.travis.yml
|
46
website/node_modules/npm/node_modules/sha/LICENSE
generated
vendored
Normal file
46
website/node_modules/npm/node_modules/sha/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
Copyright (c) 2013 Forbes Lindesay
|
||||
|
||||
The BSD License
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
|
||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
49
website/node_modules/npm/node_modules/sha/README.md
generated
vendored
Normal file
49
website/node_modules/npm/node_modules/sha/README.md
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
# sha
|
||||
|
||||
Check and get file hashes (using any algorithm)
|
||||
|
||||
[](https://travis-ci.org/ForbesLindesay/sha)
|
||||
[](https://gemnasium.com/ForbesLindesay/sha)
|
||||
[](http://badge.fury.io/js/sha)
|
||||
|
||||
## Installation
|
||||
|
||||
$ npm install sha
|
||||
|
||||
## API
|
||||
|
||||
### check(fileName, expected, [options,] cb) / checkSync(filename, expected, [options])
|
||||
|
||||
Asynchronously check that `fileName` has a "hash" of `expected`. The callback will be called with either `null` or an error (indicating that they did not match).
|
||||
|
||||
Options:
|
||||
|
||||
- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`
|
||||
|
||||
### get(fileName, [options,] cb) / getSync(filename, [options])
|
||||
|
||||
Asynchronously get the "hash" of `fileName`. The callback will be called with an optional `error` object and the (lower cased) hex digest of the hash.
|
||||
|
||||
Options:
|
||||
|
||||
- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`
|
||||
|
||||
### stream(expected, [options])
|
||||
|
||||
Check the hash of a stream without ever buffering it. This is a pass through stream so you can do things like:
|
||||
|
||||
```js
|
||||
fs.createReadStream('src')
|
||||
.pipe(sha.stream('expected'))
|
||||
.pipe(fs.createWriteStream('dest'))
|
||||
```
|
||||
|
||||
`dest` will be a complete copy of `src` and an error will be emitted if the hash did not match `'expected'`.
|
||||
|
||||
Options:
|
||||
|
||||
- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`
|
||||
|
||||
## License
|
||||
|
||||
You may use this software under the BSD or MIT. Take your pick. If you want me to release it under another license, open a pull request.
|
107
website/node_modules/npm/node_modules/sha/index.js
generated
vendored
Normal file
107
website/node_modules/npm/node_modules/sha/index.js
generated
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
'use strict'
|
||||
|
||||
var Transform = require('stream').Transform || require('readable-stream').Transform
|
||||
var crypto = require('crypto')
|
||||
var fs = require('graceful-fs')
|
||||
|
||||
exports.check = check
|
||||
exports.checkSync = checkSync
|
||||
exports.get = get
|
||||
exports.getSync = getSync
|
||||
exports.stream = stream
|
||||
|
||||
function check(file, expected, options, cb) {
|
||||
if (typeof options === 'function') {
|
||||
cb = options
|
||||
options = undefined
|
||||
}
|
||||
expected = expected.toLowerCase().trim()
|
||||
get(file, options, function (er, actual) {
|
||||
if (er) {
|
||||
if (er.message) er.message += ' while getting shasum for ' + file
|
||||
return cb(er)
|
||||
}
|
||||
if (actual === expected) return cb(null)
|
||||
cb(new Error(
|
||||
'shasum check failed for ' + file + '\n'
|
||||
+ 'Expected: ' + expected + '\n'
|
||||
+ 'Actual: ' + actual))
|
||||
})
|
||||
}
|
||||
function checkSync(file, expected, options) {
|
||||
expected = expected.toLowerCase().trim()
|
||||
var actual
|
||||
try {
|
||||
actual = getSync(file, options)
|
||||
} catch (er) {
|
||||
if (er.message) er.message += ' while getting shasum for ' + file
|
||||
throw er
|
||||
}
|
||||
if (actual !== expected) {
|
||||
var ex = new Error(
|
||||
'shasum check failed for ' + file + '\n'
|
||||
+ 'Expected: ' + expected + '\n'
|
||||
+ 'Actual: ' + actual)
|
||||
throw ex
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function get(file, options, cb) {
|
||||
if (typeof options === 'function') {
|
||||
cb = options
|
||||
options = undefined
|
||||
}
|
||||
options = options || {}
|
||||
var algorithm = options.algorithm || 'sha1'
|
||||
var hash = crypto.createHash(algorithm)
|
||||
var source = fs.createReadStream(file)
|
||||
var errState = null
|
||||
source
|
||||
.on('error', function (er) {
|
||||
if (errState) return
|
||||
return cb(errState = er)
|
||||
})
|
||||
.on('data', function (chunk) {
|
||||
if (errState) return
|
||||
hash.update(chunk)
|
||||
})
|
||||
.on('end', function () {
|
||||
if (errState) return
|
||||
var actual = hash.digest("hex").toLowerCase().trim()
|
||||
cb(null, actual)
|
||||
})
|
||||
}
|
||||
|
||||
function getSync(file, options) {
|
||||
options = options || {}
|
||||
var algorithm = options.algorithm || 'sha1'
|
||||
var hash = crypto.createHash(algorithm)
|
||||
var source = fs.readFileSync(file)
|
||||
hash.update(source)
|
||||
return hash.digest("hex").toLowerCase().trim()
|
||||
}
|
||||
|
||||
function stream(expected, options) {
|
||||
expected = expected.toLowerCase().trim()
|
||||
options = options || {}
|
||||
var algorithm = options.algorithm || 'sha1'
|
||||
var hash = crypto.createHash(algorithm)
|
||||
|
||||
var stream = new Transform()
|
||||
stream._transform = function (chunk, encoding, callback) {
|
||||
hash.update(chunk)
|
||||
stream.push(chunk)
|
||||
callback()
|
||||
}
|
||||
stream._flush = function (cb) {
|
||||
var actual = hash.digest("hex").toLowerCase().trim()
|
||||
if (actual === expected) return cb(null)
|
||||
cb(new Error(
|
||||
'shasum check failed for:\n'
|
||||
+ ' Expected: ' + expected + '\n'
|
||||
+ ' Actual: ' + actual))
|
||||
this.push(null)
|
||||
}
|
||||
return stream
|
||||
}
|
52
website/node_modules/npm/node_modules/sha/package.json
generated
vendored
Normal file
52
website/node_modules/npm/node_modules/sha/package.json
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"sha@2.0.1",
|
||||
"/Users/rebecca/code/npm"
|
||||
]
|
||||
],
|
||||
"_from": "sha@2.0.1",
|
||||
"_id": "sha@2.0.1",
|
||||
"_inBundle": true,
|
||||
"_integrity": "sha1-YDCCL70smCOUn49y7WQR7lzyWq4=",
|
||||
"_location": "/npm/sha",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "sha@2.0.1",
|
||||
"name": "sha",
|
||||
"escapedName": "sha",
|
||||
"rawSpec": "2.0.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.0.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/npm"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/sha/-/sha-2.0.1.tgz",
|
||||
"_spec": "2.0.1",
|
||||
"_where": "/Users/rebecca/code/npm",
|
||||
"bugs": {
|
||||
"url": "https://github.com/ForbesLindesay/sha/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.1.2",
|
||||
"readable-stream": "^2.0.2"
|
||||
},
|
||||
"description": "Check and get file hashes",
|
||||
"devDependencies": {
|
||||
"mocha": "~1.9.0"
|
||||
},
|
||||
"homepage": "https://github.com/ForbesLindesay/sha#readme",
|
||||
"license": "(BSD-2-Clause OR MIT)",
|
||||
"name": "sha",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/ForbesLindesay/sha.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha -R spec"
|
||||
},
|
||||
"version": "2.0.1"
|
||||
}
|
Reference in New Issue
Block a user