Initial
This commit is contained in:
20
Client/node_modules/vinyl/LICENSE
generated
vendored
Executable file
20
Client/node_modules/vinyl/LICENSE
generated
vendored
Executable file
@@ -0,0 +1,20 @@
|
||||
Copyright (c) 2013 Fractal <contact@wearefractal.com>
|
||||
|
||||
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.
|
||||
127
Client/node_modules/vinyl/README.md
generated
vendored
Executable file
127
Client/node_modules/vinyl/README.md
generated
vendored
Executable file
@@ -0,0 +1,127 @@
|
||||
# vinyl [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url] [](https://david-dm.org/wearefractal/vinyl)
|
||||
|
||||
|
||||
## Information
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>Package</td><td>vinyl</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Description</td>
|
||||
<td>A virtual file format</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Node Version</td>
|
||||
<td>>= 0.9</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## What is this?
|
||||
|
||||
Read this for more info about how this plays into the grand scheme of things https://medium.com/@eschoff/3828e8126466
|
||||
|
||||
## File
|
||||
|
||||
```javascript
|
||||
var File = require('vinyl');
|
||||
|
||||
var coffeeFile = new File({
|
||||
cwd: "/",
|
||||
base: "/test/",
|
||||
path: "/test/file.coffee",
|
||||
contents: new Buffer("test = 123")
|
||||
});
|
||||
```
|
||||
|
||||
### constructor(options)
|
||||
|
||||
#### options.cwd
|
||||
|
||||
Type: `String`
|
||||
Default: `process.cwd()`
|
||||
|
||||
#### options.base
|
||||
|
||||
Used for relative pathing. Typically where a glob starts.
|
||||
|
||||
Type: `String`
|
||||
Default: `options.cwd`
|
||||
|
||||
#### options.path
|
||||
|
||||
Full path to the file.
|
||||
|
||||
Type: `String`
|
||||
Default: `null`
|
||||
|
||||
#### options.stat
|
||||
|
||||
The result of an fs.stat call. See [fs.Stats](http://nodejs.org/api/fs.html#fs_class_fs_stats) for more information.
|
||||
|
||||
Type: `fs.Stats`
|
||||
Default: `null`
|
||||
|
||||
#### options.contents
|
||||
|
||||
File contents.
|
||||
|
||||
Type: `Buffer, Stream, or null`
|
||||
Default: `null`
|
||||
|
||||
### isBuffer()
|
||||
|
||||
Returns true if file.contents is a Buffer.
|
||||
|
||||
### isStream()
|
||||
|
||||
Returns true if file.contents is a Stream.
|
||||
|
||||
### isNull()
|
||||
|
||||
Returns true if file.contents is null.
|
||||
|
||||
### clone()
|
||||
|
||||
Returns a new File object with all attributes cloned. Custom attributes are deep-cloned.
|
||||
|
||||
### pipe(stream[, opt])
|
||||
|
||||
If file.contents is a Buffer, it will write it to the stream.
|
||||
|
||||
If file.contents is a Stream, it will pipe it to the stream.
|
||||
|
||||
If file.contents is null, it will do nothing.
|
||||
|
||||
If opt.end is false, the destination stream will not be ended (same as node core).
|
||||
|
||||
Returns the stream.
|
||||
|
||||
### inspect()
|
||||
|
||||
Returns a pretty String interpretation of the File. Useful for console.log.
|
||||
|
||||
### relative
|
||||
|
||||
Returns path.relative for the file base and file path.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
var file = new File({
|
||||
cwd: "/",
|
||||
base: "/test/",
|
||||
path: "/test/file.coffee"
|
||||
});
|
||||
|
||||
console.log(file.relative); // file.coffee
|
||||
```
|
||||
|
||||
[npm-url]: https://npmjs.org/package/vinyl
|
||||
[npm-image]: https://badge.fury.io/js/vinyl.png
|
||||
[travis-url]: https://travis-ci.org/wearefractal/vinyl
|
||||
[travis-image]: https://travis-ci.org/wearefractal/vinyl.png?branch=master
|
||||
[coveralls-url]: https://coveralls.io/r/wearefractal/vinyl
|
||||
[coveralls-image]: https://coveralls.io/repos/wearefractal/vinyl/badge.png
|
||||
[depstat-url]: https://david-dm.org/wearefractal/vinyl
|
||||
[depstat-image]: https://david-dm.org/wearefractal/vinyl.png
|
||||
175
Client/node_modules/vinyl/index.js
generated
vendored
Executable file
175
Client/node_modules/vinyl/index.js
generated
vendored
Executable file
@@ -0,0 +1,175 @@
|
||||
var path = require('path');
|
||||
var clone = require('clone');
|
||||
var cloneStats = require('clone-stats');
|
||||
var cloneBuffer = require('./lib/cloneBuffer');
|
||||
var isBuffer = require('./lib/isBuffer');
|
||||
var isStream = require('./lib/isStream');
|
||||
var isNull = require('./lib/isNull');
|
||||
var inspectStream = require('./lib/inspectStream');
|
||||
var Stream = require('stream');
|
||||
|
||||
function File(file) {
|
||||
if (!file) file = {};
|
||||
|
||||
// record path change
|
||||
var history = file.path ? [file.path] : file.history;
|
||||
this.history = history || [];
|
||||
|
||||
// TODO: should this be moved to vinyl-fs?
|
||||
this.cwd = file.cwd || process.cwd();
|
||||
this.base = file.base || this.cwd;
|
||||
|
||||
// stat = fs stats object
|
||||
// TODO: should this be moved to vinyl-fs?
|
||||
this.stat = file.stat || null;
|
||||
|
||||
// contents = stream, buffer, or null if not read
|
||||
this.contents = file.contents || null;
|
||||
}
|
||||
|
||||
File.prototype.isBuffer = function() {
|
||||
return isBuffer(this.contents);
|
||||
};
|
||||
|
||||
File.prototype.isStream = function() {
|
||||
return isStream(this.contents);
|
||||
};
|
||||
|
||||
File.prototype.isNull = function() {
|
||||
return isNull(this.contents);
|
||||
};
|
||||
|
||||
// TODO: should this be moved to vinyl-fs?
|
||||
File.prototype.isDirectory = function() {
|
||||
return this.isNull() && this.stat && this.stat.isDirectory();
|
||||
};
|
||||
|
||||
File.prototype.clone = function(opt) {
|
||||
if (typeof opt === 'boolean') {
|
||||
opt = {
|
||||
deep: opt,
|
||||
contents: true
|
||||
};
|
||||
} else if (!opt) {
|
||||
opt = {
|
||||
deep: false,
|
||||
contents: true
|
||||
};
|
||||
} else {
|
||||
opt.deep = opt.deep === true;
|
||||
opt.contents = opt.contents !== false;
|
||||
}
|
||||
|
||||
// clone our file contents
|
||||
var contents;
|
||||
if (this.isStream()) {
|
||||
contents = this.contents.pipe(new Stream.PassThrough());
|
||||
this.contents = this.contents.pipe(new Stream.PassThrough());
|
||||
} else if (this.isBuffer()) {
|
||||
contents = opt.contents ? cloneBuffer(this.contents) : this.contents;
|
||||
}
|
||||
|
||||
var file = new File({
|
||||
cwd: this.cwd,
|
||||
base: this.base,
|
||||
stat: (this.stat ? cloneStats(this.stat) : null),
|
||||
history: this.history.slice(),
|
||||
contents: contents
|
||||
});
|
||||
|
||||
// clone our custom properties
|
||||
Object.keys(this).forEach(function(key) {
|
||||
// ignore built-in fields
|
||||
if (key === '_contents' || key === 'stat' ||
|
||||
key === 'history' || key === 'path' ||
|
||||
key === 'base' || key === 'cwd') {
|
||||
return;
|
||||
}
|
||||
file[key] = opt.deep ? clone(this[key], true) : this[key];
|
||||
}, this);
|
||||
return file;
|
||||
};
|
||||
|
||||
File.prototype.pipe = function(stream, opt) {
|
||||
if (!opt) opt = {};
|
||||
if (typeof opt.end === 'undefined') opt.end = true;
|
||||
|
||||
if (this.isStream()) {
|
||||
return this.contents.pipe(stream, opt);
|
||||
}
|
||||
if (this.isBuffer()) {
|
||||
if (opt.end) {
|
||||
stream.end(this.contents);
|
||||
} else {
|
||||
stream.write(this.contents);
|
||||
}
|
||||
return stream;
|
||||
}
|
||||
|
||||
// isNull
|
||||
if (opt.end) stream.end();
|
||||
return stream;
|
||||
};
|
||||
|
||||
File.prototype.inspect = function() {
|
||||
var inspect = [];
|
||||
|
||||
// use relative path if possible
|
||||
var filePath = (this.base && this.path) ? this.relative : this.path;
|
||||
|
||||
if (filePath) {
|
||||
inspect.push('"'+filePath+'"');
|
||||
}
|
||||
|
||||
if (this.isBuffer()) {
|
||||
inspect.push(this.contents.inspect());
|
||||
}
|
||||
|
||||
if (this.isStream()) {
|
||||
inspect.push(inspectStream(this.contents));
|
||||
}
|
||||
|
||||
return '<File '+inspect.join(' ')+'>';
|
||||
};
|
||||
|
||||
// virtual attributes
|
||||
// or stuff with extra logic
|
||||
Object.defineProperty(File.prototype, 'contents', {
|
||||
get: function() {
|
||||
return this._contents;
|
||||
},
|
||||
set: function(val) {
|
||||
if (!isBuffer(val) && !isStream(val) && !isNull(val)) {
|
||||
throw new Error('File.contents can only be a Buffer, a Stream, or null.');
|
||||
}
|
||||
this._contents = val;
|
||||
}
|
||||
});
|
||||
|
||||
// TODO: should this be moved to vinyl-fs?
|
||||
Object.defineProperty(File.prototype, 'relative', {
|
||||
get: function() {
|
||||
if (!this.base) throw new Error('No base specified! Can not get relative.');
|
||||
if (!this.path) throw new Error('No path specified! Can not get relative.');
|
||||
return path.relative(this.base, this.path);
|
||||
},
|
||||
set: function() {
|
||||
throw new Error('File.relative is generated from the base and path attributes. Do not modify it.');
|
||||
}
|
||||
});
|
||||
|
||||
Object.defineProperty(File.prototype, 'path', {
|
||||
get: function() {
|
||||
return this.history[this.history.length - 1];
|
||||
},
|
||||
set: function(path) {
|
||||
if (typeof path !== 'string') throw new Error('path should be string');
|
||||
|
||||
// record history only when path changed
|
||||
if (path && path !== this.path) {
|
||||
this.history.push(path);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = File;
|
||||
7
Client/node_modules/vinyl/lib/cloneBuffer.js
generated
vendored
Executable file
7
Client/node_modules/vinyl/lib/cloneBuffer.js
generated
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
var Buffer = require('buffer').Buffer;
|
||||
|
||||
module.exports = function(buf) {
|
||||
var out = new Buffer(buf.length);
|
||||
buf.copy(out);
|
||||
return out;
|
||||
};
|
||||
11
Client/node_modules/vinyl/lib/inspectStream.js
generated
vendored
Executable file
11
Client/node_modules/vinyl/lib/inspectStream.js
generated
vendored
Executable file
@@ -0,0 +1,11 @@
|
||||
var isStream = require('./isStream');
|
||||
|
||||
module.exports = function(stream) {
|
||||
if (!isStream(stream)) return;
|
||||
|
||||
var streamType = stream.constructor.name;
|
||||
// avoid StreamStream
|
||||
if (streamType === 'Stream') streamType = '';
|
||||
|
||||
return '<'+streamType+'Stream>';
|
||||
};
|
||||
7
Client/node_modules/vinyl/lib/isBuffer.js
generated
vendored
Executable file
7
Client/node_modules/vinyl/lib/isBuffer.js
generated
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
var buf = require('buffer');
|
||||
var Buffer = buf.Buffer;
|
||||
|
||||
// could use Buffer.isBuffer but this is the same exact thing...
|
||||
module.exports = function(o) {
|
||||
return typeof o === 'object' && o instanceof Buffer;
|
||||
};
|
||||
3
Client/node_modules/vinyl/lib/isNull.js
generated
vendored
Executable file
3
Client/node_modules/vinyl/lib/isNull.js
generated
vendored
Executable file
@@ -0,0 +1,3 @@
|
||||
module.exports = function(v) {
|
||||
return v === null;
|
||||
};
|
||||
5
Client/node_modules/vinyl/lib/isStream.js
generated
vendored
Executable file
5
Client/node_modules/vinyl/lib/isStream.js
generated
vendored
Executable file
@@ -0,0 +1,5 @@
|
||||
var Stream = require('stream').Stream;
|
||||
|
||||
module.exports = function(o) {
|
||||
return !!o && o instanceof Stream;
|
||||
};
|
||||
78
Client/node_modules/vinyl/package.json
generated
vendored
Executable file
78
Client/node_modules/vinyl/package.json
generated
vendored
Executable file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"_from": "vinyl@~0.4.6",
|
||||
"_id": "vinyl@0.4.6",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-LzVsh6VQolVGHza76ypbqL94SEc=",
|
||||
"_location": "/vinyl",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "vinyl@~0.4.6",
|
||||
"name": "vinyl",
|
||||
"escapedName": "vinyl",
|
||||
"rawSpec": "~0.4.6",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~0.4.6"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/gulp-gunzip",
|
||||
"/vinyl-source-stream"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz",
|
||||
"_shasum": "2f356c87a550a255461f36bbeb2a5ba8bf784847",
|
||||
"_spec": "vinyl@~0.4.6",
|
||||
"_where": "/home/nathan/Projects/Upsilon/UpsilonVsCodeLanguageServer/Client/node_modules/gulp-gunzip",
|
||||
"author": {
|
||||
"name": "Fractal",
|
||||
"email": "contact@wearefractal.com",
|
||||
"url": "http://wearefractal.com/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/wearefractal/vinyl/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"clone": "^0.2.0",
|
||||
"clone-stats": "^0.0.1"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "A virtual file format",
|
||||
"devDependencies": {
|
||||
"buffer-equal": "0.0.1",
|
||||
"coveralls": "^2.6.1",
|
||||
"event-stream": "^3.1.0",
|
||||
"istanbul": "^0.3.0",
|
||||
"jshint": "^2.4.1",
|
||||
"lodash.templatesettings": "^2.4.1",
|
||||
"mocha": "^2.0.0",
|
||||
"mocha-lcov-reporter": "^0.0.1",
|
||||
"rimraf": "^2.2.5",
|
||||
"should": "^4.0.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.9"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"lib"
|
||||
],
|
||||
"homepage": "http://github.com/wearefractal/vinyl",
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "http://github.com/wearefractal/vinyl/raw/master/LICENSE"
|
||||
}
|
||||
],
|
||||
"main": "./index.js",
|
||||
"name": "vinyl",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/wearefractal/vinyl.git"
|
||||
},
|
||||
"scripts": {
|
||||
"coveralls": "istanbul cover _mocha -- -R spec && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",
|
||||
"test": "mocha --reporter spec && jshint lib"
|
||||
},
|
||||
"version": "0.4.6"
|
||||
}
|
||||
Reference in New Issue
Block a user