This commit is contained in:
2019-02-17 18:07:28 +01:00
parent c69ffb9752
commit 95cff6f702
2301 changed files with 307810 additions and 5 deletions

5
Client/node_modules/gulp-remote-src-vscode/.travis.yml generated vendored Executable file
View File

@@ -0,0 +1,5 @@
language: node_js
node_js:
- 0.10
before_script:
- "npm install -g gulp"

27
Client/node_modules/gulp-remote-src-vscode/CHANGELOG.md generated vendored Executable file
View File

@@ -0,0 +1,27 @@
## Changelog
### v0.1.0 (2014-06-30)
First release.
### v0.2.0 (2014-07-01)
Fix streaming pipe.
Add tests for streaming pipe.
### v0.2.1 (2014-07-18)
Add option `strictSSL` (thank you [@Magomogo](https://github.com/Magomogo))
### v0.3.0 (2014-09-02)
Pass through [request](https://github.com/mikeal/request) options to make it flexible.
### v0.4.0 (2015-08-14)
Put `request` options in a single `requestOptions`.
### v0.4.1 (2016-02-26)
Improve response code check.

90
Client/node_modules/gulp-remote-src-vscode/Gulpfile.js generated vendored Executable file
View File

@@ -0,0 +1,90 @@
var remoteSrc = require('./');
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var clean = require('gulp-clean');
var FILES = [
"src/node.js",
"lib/_debugger.js",
"lib/_linklist.js",
"lib/_stream_duplex.js",
"lib/_stream_passthrough.js",
"lib/_stream_readable.js",
"lib/_stream_transform.js",
"lib/_stream_writable.js",
"lib/assert.js",
"lib/buffer.js",
"lib/child_process.js",
"lib/cluster.js",
"lib/console.js",
"lib/constants.js",
"lib/crypto.js",
"lib/dgram.js",
"lib/dns.js",
"lib/domain.js",
"lib/events.js",
"lib/freelist.js",
"lib/fs.js",
"lib/http.js",
"lib/https.js",
"lib/module.js",
"lib/net.js",
"lib/os.js",
"lib/path.js",
"lib/punycode.js",
"lib/querystring.js",
"lib/readline.js",
"lib/repl.js",
"lib/stream.js",
"lib/string_decoder.js",
"lib/sys.js",
"lib/timers.js",
"lib/tls.js",
"lib/tty.js",
"lib/url.js",
"lib/util.js",
"lib/vm.js",
"lib/zlib.js"
];
var URL = "https://raw.githubusercontent.com/joyent/node/v0.10.29/"
gulp.task('clean', function() {
return gulp.src('dist', {read: false})
.pipe(clean());
});
gulp.task('nostream', ['clean'], function() {
return remoteSrc(FILES, {
base: URL
})
.pipe(uglify())
.pipe(gulp.dest('dist/nostream'));
});
gulp.task('stream', ['clean'], function() {
return remoteSrc(FILES, {
buffer: false,
base: URL
})
.pipe(gulp.dest('dist/stream'));
});
gulp.task('self-signed-ssl', ['clean'], function() {
return remoteSrc(['index.html'], {
strictSSL: false,
base: 'https://example.com/'
})
.pipe(gulp.dest('dist/strictSSL'));
});
// run this task alone to test timeout
gulp.task('timeout', ['clean'], function() {
return remoteSrc(FILES, {
base: URL,
timeout: 1
})
.pipe(gulp.dest('dist/timeout'));
});
gulp.task('test', ['stream', 'nostream', 'self-signed-ssl']);

23
Client/node_modules/gulp-remote-src-vscode/LICENSE generated vendored Executable file
View File

@@ -0,0 +1,23 @@
MIT License
===========
Copyright (c) 2014 Dong <ddliuhb@gmail.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.

45
Client/node_modules/gulp-remote-src-vscode/README.md generated vendored Executable file
View File

@@ -0,0 +1,45 @@
# gulp-remote-src
[![Build Status](https://travis-ci.org/ddliu/gulp-remote-src.png)](https://travis-ci.org/ddliu/gulp-remote-src)
Remote `gulp.src`.
## Installation
Install package with NPM and add it to your development dependencies:
npm install --save-dev gulp-remote-src
## Usage
```js
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var remoteSrc = require('gulp-remote-src');
gulp.task('remote', function() {
remoteSrc(['app.js', 'jquery.js'], {
base: 'http://myapps.com/assets/'
})
.pipe(uglify())
.pipe(gulp.dest('./dist/'));
})
```
## Options
- `base`
Url base.
If you want to use absolute urls instead of relative ones, set this to
`null`. When not configured, `/` is assumed.
- `buffer` (default is true)
Pipe out files as buffer or as stream. Note that some plugins do not support streaming.
- `requestOptions`
Options to be passed to [request](https://github.com/mikeal/request)

77
Client/node_modules/gulp-remote-src-vscode/index.js generated vendored Executable file
View File

@@ -0,0 +1,77 @@
var util = require('util');
var es = require('event-stream');
var request = require('request');
var File = require('vinyl');
var through2 = require('through2');
var extend = require('node.extend');
module.exports = function (urls, options) {
if (options === undefined) {
options = {};
}
if (typeof options.base !== 'string' && options.base !== null) {
options.base = '/';
}
if (typeof options.buffer !== 'boolean') {
options.buffer = true;
}
if (!util.isArray(urls)) {
urls = [urls];
}
var allowedRequestOptions = ['qs', 'headers', 'auth', 'followRedirect', 'followAllRedirects', 'maxRedirects', 'timeout', 'proxy',
'strictSSL', 'aws', 'gzip'];
var requestBaseOptions = {};
for (var i = allowedRequestOptions.length - 1; i >= 0; i--) {
var k = allowedRequestOptions[i];
if (k in options) {
requestBaseOptions[k] = options[k];
}
}
if (options.requestOptions) {
for (var k in options.requestOptions) {
requestBaseOptions[k] = options.requestOptions[k];
}
}
return es.readArray(urls).pipe(es.map(function(data, cb) {
var url = [options.base, data].join(''), requestOptions = extend({url: url}, requestBaseOptions);
if (!options.buffer) {
var file = new File({
cwd: '/',
base: options.base,
path: url,
// request must be piped out once created, or we'll get this error: "You cannot pipe after data has been emitted from the response."
contents: request(requestOptions).pipe(through2())
});
cb(null, file);
} else {
// set encoding to `null` to return the body as buffer
requestOptions.encoding = null;
request(requestOptions, function (error, response, body) {
if (!error && (response.statusCode >= 200 && response.statusCode < 300)) {
var file = new File({
cwd: '/',
base: options.base,
path: url,
contents: body
});
cb(null, file);
} else {
if (!error) {
error = new Error('Request ' + url + ' failed with status code:' + response.statusCode);
}
cb(error);
}
});
}
}));
};

View File

@@ -0,0 +1,21 @@
## The MIT License (MIT) ##
Copyright (c) 2014 Hugh Kennedy
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.

View File

@@ -0,0 +1,17 @@
# clone-stats [![Flattr this!](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=hughskennedy&url=http://github.com/hughsk/clone-stats&title=clone-stats&description=hughsk/clone-stats%20on%20GitHub&language=en_GB&tags=flattr,github,javascript&category=software)[![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) #
Safely clone node's
[`fs.Stats`](http://nodejs.org/api/fs.html#fs_class_fs_stats) instances without
losing their class methods, i.e. `stat.isDirectory()` and co.
## Usage ##
[![clone-stats](https://nodei.co/npm/clone-stats.png?mini=true)](https://nodei.co/npm/clone-stats)
### `copy = require('clone-stats')(stat)` ###
Returns a clone of the original `fs.Stats` instance (`stat`).
## License ##
MIT. See [LICENSE.md](http://github.com/hughsk/clone-stats/blob/master/LICENSE.md) for details.

View File

@@ -0,0 +1,13 @@
var Stat = require('fs').Stats
module.exports = cloneStats
function cloneStats(stats) {
var replacement = new Stat
Object.keys(stats).forEach(function(key) {
replacement[key] = stats[key]
})
return replacement
}

View File

@@ -0,0 +1,60 @@
{
"_from": "clone-stats@^1.0.0",
"_id": "clone-stats@1.0.0",
"_inBundle": false,
"_integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=",
"_location": "/gulp-remote-src-vscode/clone-stats",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "clone-stats@^1.0.0",
"name": "clone-stats",
"escapedName": "clone-stats",
"rawSpec": "^1.0.0",
"saveSpec": null,
"fetchSpec": "^1.0.0"
},
"_requiredBy": [
"/gulp-remote-src-vscode/vinyl"
],
"_resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz",
"_shasum": "b3782dff8bb5474e18b9b6bf0fdfe782f8777680",
"_spec": "clone-stats@^1.0.0",
"_where": "/home/nathan/Projects/Upsilon/UpsilonVsCodeLanguageServer/Client/node_modules/gulp-remote-src-vscode/node_modules/vinyl",
"author": {
"name": "Hugh Kennedy",
"email": "hughskennedy@gmail.com",
"url": "http://hughsk.io/"
},
"browser": "index.js",
"bugs": {
"url": "https://github.com/hughsk/clone-stats/issues"
},
"bundleDependencies": false,
"dependencies": {},
"deprecated": false,
"description": "Safely clone node's fs.Stats instances without losing their class methods",
"devDependencies": {
"tape": "~2.3.2"
},
"homepage": "https://github.com/hughsk/clone-stats",
"keywords": [
"stats",
"fs",
"clone",
"copy",
"prototype"
],
"license": "MIT",
"main": "index.js",
"name": "clone-stats",
"repository": {
"type": "git",
"url": "git://github.com/hughsk/clone-stats.git"
},
"scripts": {
"test": "node test"
},
"version": "1.0.0"
}

View File

@@ -0,0 +1,36 @@
var test = require('tape')
var clone = require('./')
var fs = require('fs')
test('file', function(t) {
compare(t, fs.statSync(__filename))
t.end()
})
test('directory', function(t) {
compare(t, fs.statSync(__dirname))
t.end()
})
function compare(t, stat) {
var copy = clone(stat)
t.deepEqual(stat, copy, 'clone has equal properties')
t.ok(stat instanceof fs.Stats, 'original is an fs.Stat')
t.ok(copy instanceof fs.Stats, 'copy is an fs.Stat')
;['isDirectory'
, 'isFile'
, 'isBlockDevice'
, 'isCharacterDevice'
, 'isSymbolicLink'
, 'isFIFO'
, 'isSocket'
].forEach(function(method) {
t.equal(
stat[method].call(stat)
, copy[method].call(copy)
, 'equal value for stat.' + method + '()'
)
})
}

View File

@@ -0,0 +1,4 @@
/node_modules/
/test.js
/.travis.yml
*.html

View File

@@ -0,0 +1,18 @@
Copyright © 2011-2015 Paul Vorbach <paul@vorba.ch>
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, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,194 @@
# clone
[![build status](https://secure.travis-ci.org/pvorb/clone.svg)](http://travis-ci.org/pvorb/clone) [![downloads](https://img.shields.io/npm/dt/clone.svg)](http://npm-stat.com/charts.html?package=clone)
offers foolproof _deep cloning_ of objects, arrays, numbers, strings, maps,
sets, promises, etc. in JavaScript.
**XSS vulnerability detected**
## Installation
npm install clone
(It also works with browserify, ender or standalone. You may want to use the
option `noParse` in browserify to reduce the resulting file size, since usually
`Buffer`s are not needed in browsers.)
## Example
~~~ javascript
var clone = require('clone');
var a, b;
a = { foo: { bar: 'baz' } }; // initial value of a
b = clone(a); // clone a -> b
a.foo.bar = 'foo'; // change a
console.log(a); // show a
console.log(b); // show b
~~~
This will print:
~~~ javascript
{ foo: { bar: 'foo' } }
{ foo: { bar: 'baz' } }
~~~
**clone** masters cloning simple objects (even with custom prototype), arrays,
Date objects, and RegExp objects. Everything is cloned recursively, so that you
can clone dates in arrays in objects, for example.
## API
`clone(val, circular, depth)`
* `val` -- the value that you want to clone, any type allowed
* `circular` -- boolean
Call `clone` with `circular` set to `false` if you are certain that `obj`
contains no circular references. This will give better performance if
needed. There is no error if `undefined` or `null` is passed as `obj`.
* `depth` -- depth to which the object is to be cloned (optional,
defaults to infinity)
* `prototype` -- sets the prototype to be used when cloning an object.
(optional, defaults to parent prototype).
* `includeNonEnumerable` -- set to `true` if the non-enumerable properties
should be cloned as well. Non-enumerable properties on the prototype chain
will be ignored. (optional, defaults to `false`)
`clone.clonePrototype(obj)`
* `obj` -- the object that you want to clone
Does a prototype clone as
[described by Oran Looney](http://oranlooney.com/functional-javascript/).
## Circular References
~~~ javascript
var a, b;
a = { hello: 'world' };
a.myself = a;
b = clone(a);
console.log(b);
~~~
This will print:
~~~ javascript
{ hello: "world", myself: [Circular] }
~~~
So, `b.myself` points to `b`, not `a`. Neat!
## Test
npm test
## Changelog
### v2.1.2
#### 2018-03-21
- Use `Buffer.allocUnsafe()` on Node >= 4.5.0 (contributed by @ChALkeR)
### v2.1.1
#### 2017-03-09
- Fix build badge in README
- Add support for cloning Maps and Sets on Internet Explorer
### v2.1.0
#### 2016-11-22
- Add support for cloning Errors
- Exclude non-enumerable symbol-named object properties from cloning
- Add option to include non-enumerable own properties of objects
### v2.0.0
#### 2016-09-28
- Add support for cloning ES6 Maps, Sets, Promises, and Symbols
### v1.0.3
#### 2017-11-08
- Close XSS vulnerability in the NPM package, which included the file
`test-apart-ctx.html`. This vulnerability was disclosed by Juho Nurminen of
2NS - Second Nature Security.
### v1.0.2 (deprecated)
#### 2015-03-25
- Fix call on getRegExpFlags
- Refactor utilities
- Refactor test suite
### v1.0.1 (deprecated)
#### 2015-03-04
- Fix nodeunit version
- Directly call getRegExpFlags
### v1.0.0 (deprecated)
#### 2015-02-10
- Improve browser support
- Improve browser testability
- Move helper methods to private namespace
## Caveat
Some special objects like a socket or `process.stdout`/`stderr` are known to not
be cloneable. If you find other objects that cannot be cloned, please [open an
issue](https://github.com/pvorb/clone/issues/new).
## Bugs and Issues
If you encounter any bugs or issues, feel free to [open an issue at
github](https://github.com/pvorb/clone/issues) or send me an email to
<paul@vorba.ch>. I also always like to hear from you, if youre using my code.
## License
Copyright © 2011-2016 [Paul Vorbach](https://paul.vorba.ch/) and
[contributors](https://github.com/pvorb/clone/graphs/contributors).
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, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="clone node_modules" level="project" />
</component>
</module>

View File

@@ -0,0 +1,257 @@
var clone = (function() {
'use strict';
function _instanceof(obj, type) {
return type != null && obj instanceof type;
}
var nativeMap;
try {
nativeMap = Map;
} catch(_) {
// maybe a reference error because no `Map`. Give it a dummy value that no
// value will ever be an instanceof.
nativeMap = function() {};
}
var nativeSet;
try {
nativeSet = Set;
} catch(_) {
nativeSet = function() {};
}
var nativePromise;
try {
nativePromise = Promise;
} catch(_) {
nativePromise = function() {};
}
/**
* Clones (copies) an Object using deep copying.
*
* This function supports circular references by default, but if you are certain
* there are no circular references in your object, you can save some CPU time
* by calling clone(obj, false).
*
* Caution: if `circular` is false and `parent` contains circular references,
* your program may enter an infinite loop and crash.
*
* @param `parent` - the object to be cloned
* @param `circular` - set to true if the object to be cloned may contain
* circular references. (optional - true by default)
* @param `depth` - set to a number if the object is only to be cloned to
* a particular depth. (optional - defaults to Infinity)
* @param `prototype` - sets the prototype to be used when cloning an object.
* (optional - defaults to parent prototype).
* @param `includeNonEnumerable` - set to true if the non-enumerable properties
* should be cloned as well. Non-enumerable properties on the prototype
* chain will be ignored. (optional - false by default)
*/
function clone(parent, circular, depth, prototype, includeNonEnumerable) {
if (typeof circular === 'object') {
depth = circular.depth;
prototype = circular.prototype;
includeNonEnumerable = circular.includeNonEnumerable;
circular = circular.circular;
}
// maintain two arrays for circular references, where corresponding parents
// and children have the same index
var allParents = [];
var allChildren = [];
var useBuffer = typeof Buffer != 'undefined';
if (typeof circular == 'undefined')
circular = true;
if (typeof depth == 'undefined')
depth = Infinity;
// recurse this function so we don't reset allParents and allChildren
function _clone(parent, depth) {
// cloning null always returns null
if (parent === null)
return null;
if (depth === 0)
return parent;
var child;
var proto;
if (typeof parent != 'object') {
return parent;
}
if (_instanceof(parent, nativeMap)) {
child = new nativeMap();
} else if (_instanceof(parent, nativeSet)) {
child = new nativeSet();
} else if (_instanceof(parent, nativePromise)) {
child = new nativePromise(function (resolve, reject) {
parent.then(function(value) {
resolve(_clone(value, depth - 1));
}, function(err) {
reject(_clone(err, depth - 1));
});
});
} else if (clone.__isArray(parent)) {
child = [];
} else if (clone.__isRegExp(parent)) {
child = new RegExp(parent.source, __getRegExpFlags(parent));
if (parent.lastIndex) child.lastIndex = parent.lastIndex;
} else if (clone.__isDate(parent)) {
child = new Date(parent.getTime());
} else if (useBuffer && Buffer.isBuffer(parent)) {
if (Buffer.allocUnsafe) {
// Node.js >= 4.5.0
child = Buffer.allocUnsafe(parent.length);
} else {
// Older Node.js versions
child = new Buffer(parent.length);
}
parent.copy(child);
return child;
} else if (_instanceof(parent, Error)) {
child = Object.create(parent);
} else {
if (typeof prototype == 'undefined') {
proto = Object.getPrototypeOf(parent);
child = Object.create(proto);
}
else {
child = Object.create(prototype);
proto = prototype;
}
}
if (circular) {
var index = allParents.indexOf(parent);
if (index != -1) {
return allChildren[index];
}
allParents.push(parent);
allChildren.push(child);
}
if (_instanceof(parent, nativeMap)) {
parent.forEach(function(value, key) {
var keyChild = _clone(key, depth - 1);
var valueChild = _clone(value, depth - 1);
child.set(keyChild, valueChild);
});
}
if (_instanceof(parent, nativeSet)) {
parent.forEach(function(value) {
var entryChild = _clone(value, depth - 1);
child.add(entryChild);
});
}
for (var i in parent) {
var attrs;
if (proto) {
attrs = Object.getOwnPropertyDescriptor(proto, i);
}
if (attrs && attrs.set == null) {
continue;
}
child[i] = _clone(parent[i], depth - 1);
}
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(parent);
for (var i = 0; i < symbols.length; i++) {
// Don't need to worry about cloning a symbol because it is a primitive,
// like a number or string.
var symbol = symbols[i];
var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);
if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {
continue;
}
child[symbol] = _clone(parent[symbol], depth - 1);
if (!descriptor.enumerable) {
Object.defineProperty(child, symbol, {
enumerable: false
});
}
}
}
if (includeNonEnumerable) {
var allPropertyNames = Object.getOwnPropertyNames(parent);
for (var i = 0; i < allPropertyNames.length; i++) {
var propertyName = allPropertyNames[i];
var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);
if (descriptor && descriptor.enumerable) {
continue;
}
child[propertyName] = _clone(parent[propertyName], depth - 1);
Object.defineProperty(child, propertyName, {
enumerable: false
});
}
}
return child;
}
return _clone(parent, depth);
}
/**
* Simple flat clone using prototype, accepts only objects, usefull for property
* override on FLAT configuration object (no nested props).
*
* USE WITH CAUTION! This may not behave as you wish if you do not know how this
* works.
*/
clone.clonePrototype = function clonePrototype(parent) {
if (parent === null)
return null;
var c = function () {};
c.prototype = parent;
return new c();
};
// private utility functions
function __objToStr(o) {
return Object.prototype.toString.call(o);
}
clone.__objToStr = __objToStr;
function __isDate(o) {
return typeof o === 'object' && __objToStr(o) === '[object Date]';
}
clone.__isDate = __isDate;
function __isArray(o) {
return typeof o === 'object' && __objToStr(o) === '[object Array]';
}
clone.__isArray = __isArray;
function __isRegExp(o) {
return typeof o === 'object' && __objToStr(o) === '[object RegExp]';
}
clone.__isRegExp = __isRegExp;
function __getRegExpFlags(re) {
var flags = '';
if (re.global) flags += 'g';
if (re.ignoreCase) flags += 'i';
if (re.multiline) flags += 'm';
return flags;
}
clone.__getRegExpFlags = __getRegExpFlags;
return clone;
})();
if (typeof module === 'object' && module.exports) {
module.exports = clone;
}

View File

@@ -0,0 +1,158 @@
{
"_from": "clone@^2.1.1",
"_id": "clone@2.1.2",
"_inBundle": false,
"_integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=",
"_location": "/gulp-remote-src-vscode/clone",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "clone@^2.1.1",
"name": "clone",
"escapedName": "clone",
"rawSpec": "^2.1.1",
"saveSpec": null,
"fetchSpec": "^2.1.1"
},
"_requiredBy": [
"/gulp-remote-src-vscode/vinyl"
],
"_resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
"_shasum": "1b7f4b9f591f1e8f83670401600345a02887435f",
"_spec": "clone@^2.1.1",
"_where": "/home/nathan/Projects/Upsilon/UpsilonVsCodeLanguageServer/Client/node_modules/gulp-remote-src-vscode/node_modules/vinyl",
"author": {
"name": "Paul Vorbach",
"email": "paul@vorba.ch",
"url": "http://paul.vorba.ch/"
},
"bugs": {
"url": "https://github.com/pvorb/node-clone/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Blake Miner",
"email": "miner.blake@gmail.com",
"url": "http://www.blakeminer.com/"
},
{
"name": "Tian You",
"email": "axqd001@gmail.com",
"url": "http://blog.axqd.net/"
},
{
"name": "George Stagas",
"email": "gstagas@gmail.com",
"url": "http://stagas.com/"
},
{
"name": "Tobiasz Cudnik",
"email": "tobiasz.cudnik@gmail.com",
"url": "https://github.com/TobiaszCudnik"
},
{
"name": "Pavel Lang",
"email": "langpavel@phpskelet.org",
"url": "https://github.com/langpavel"
},
{
"name": "Dan MacTough",
"url": "http://yabfog.com/"
},
{
"name": "w1nk",
"url": "https://github.com/w1nk"
},
{
"name": "Hugh Kennedy",
"url": "http://twitter.com/hughskennedy"
},
{
"name": "Dustin Diaz",
"url": "http://dustindiaz.com"
},
{
"name": "Ilya Shaisultanov",
"url": "https://github.com/diversario"
},
{
"name": "Nathan MacInnes",
"email": "nathan@macinn.es",
"url": "http://macinn.es/"
},
{
"name": "Benjamin E. Coe",
"email": "ben@npmjs.com",
"url": "https://twitter.com/benjamincoe"
},
{
"name": "Nathan Zadoks",
"url": "https://github.com/nathan7"
},
{
"name": "Róbert Oroszi",
"email": "robert+gh@oroszi.net",
"url": "https://github.com/oroce"
},
{
"name": "Aurélio A. Heckert",
"url": "http://softwarelivre.org/aurium"
},
{
"name": "Guy Ellis",
"url": "http://www.guyellisrocks.com/"
},
{
"name": "fscherwi",
"url": "https://fscherwi.github.io"
},
{
"name": "rictic",
"url": "https://github.com/rictic"
},
{
"name": "Martin Jurča",
"url": "https://github.com/jurca"
},
{
"name": "Misery Lee",
"email": "miserylee@foxmail.com",
"url": "https://github.com/miserylee"
},
{
"name": "Clemens Wolff",
"url": "https://github.com/c-w"
}
],
"dependencies": {},
"deprecated": false,
"description": "deep cloning of objects and arrays",
"devDependencies": {
"nodeunit": "~0.9.0"
},
"engines": {
"node": ">=0.8"
},
"homepage": "https://github.com/pvorb/node-clone#readme",
"license": "MIT",
"main": "clone.js",
"name": "clone",
"optionalDependencies": {},
"repository": {
"type": "git",
"url": "git://github.com/pvorb/node-clone.git"
},
"scripts": {
"test": "nodeunit test.js"
},
"tags": [
"clone",
"object",
"array",
"function",
"date"
],
"version": "2.1.2"
}

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2013 Blaine Bublitz <blaine.bublitz@gmail.com>, Eric Schoffstall <yo@contra.io> and other contributors
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.

View File

@@ -0,0 +1,446 @@
<p align="center">
<a href="http://gulpjs.com">
<img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
</a>
</p>
# vinyl
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]
Virtual file format.
## What is Vinyl?
Vinyl is a very simple metadata object that describes a file. When you think of a file, two attributes come to mind: `path` and `contents`. These are the main attributes on a Vinyl object. A file does not necessarily represent something on your computers file system. You have files on S3, FTP, Dropbox, Box, CloudThingly.io and other services. Vinyl can be used to describe files from all of these sources.
## What is a Vinyl Adapter?
While Vinyl provides a clean way to describe a file, we also need a way to access these files. Each file source needs what I call a "Vinyl adapter". A Vinyl adapter simply exposes a `src(globs)` and a `dest(folder)` method. Each return a stream. The `src` stream produces Vinyl objects, and the `dest` stream consumes Vinyl objects. Vinyl adapters can expose extra methods that might be specific to their input/output medium, such as the `symlink` method [`vinyl-fs`][vinyl-fs] provides.
## Usage
```js
var Vinyl = require('vinyl');
var jsFile = new Vinyl({
cwd: '/',
base: '/test/',
path: '/test/file.js',
contents: new Buffer('var x = 123')
});
```
## API
### `new Vinyl([options])`
The constructor is used to create a new instance of `Vinyl`. Each instance represents a separate file, directory or symlink.
All internally managed paths (`cwd`, `base`, `path`, `history`) are normalized and have trailing separators removed. See [Normalization and concatenation][normalization] for more information.
Options may be passed upon instantiation to create a file with specific properties.
#### `options`
Options are not mutated by the constructor.
##### `options.cwd`
The current working directory of the file.
Type: `String`
Default: `process.cwd()`
##### `options.base`
Used for calculating the `relative` property. This is typically where a glob starts.
Type: `String`
Default: `options.cwd`
##### `options.path`
The full path to the file.
Type: `String`
Default: `undefined`
##### `options.history`
Stores the path history. If `options.path` and `options.history` are both passed, `options.path` is appended to `options.history`. All `options.history` paths are normalized by the `file.path` setter.
Type: `Array`
Default: `[]` (or `[options.path]` if `options.path` is passed)
##### `options.stat`
The result of an `fs.stat` call. This is how you mark the file as a directory or symbolic link. See [isDirectory()][is-directory], [isSymbolic()][is-symbolic] and [fs.Stats][fs-stats] for more information.
Type: [`fs.Stats`][fs-stats]
Default: `undefined`
##### `options.contents`
The contents of the file. If `options.contents` is a [`ReadableStream`][readable-stream], it is wrapped in a [`cloneable-readable`][cloneable-readable] stream.
Type: [`ReadableStream`][readable-stream], [`Buffer`][buffer], or `null`
Default: `null`
##### `options.{custom}`
Any other option properties will be directly assigned to the new Vinyl object.
```js
var Vinyl = require('vinyl');
var file = new Vinyl({ foo: 'bar' });
file.foo === 'bar'; // true
```
### Instance methods
Each Vinyl object will have instance methods. Every method will be available but may return differently based on what properties were set upon instantiation or modified since.
#### `file.isBuffer()`
Returns `true` if the file contents are a [`Buffer`][buffer], otherwise `false`.
#### `file.isStream()`
Returns `true` if the file contents are a [`Stream`][stream], otherwise `false`.
#### `file.isNull()`
Returns `true` if the file contents are `null`, otherwise `false`.
#### `file.isDirectory()`
Returns `true` if the file represents a directory, otherwise `false`.
A file is considered a directory when:
- `file.isNull()` is `true`
- `file.stat` is an object
- `file.stat.isDirectory()` returns `true`
When constructing a Vinyl object, pass in a valid [`fs.Stats`][fs-stats] object via `options.stat`. If you are mocking the [`fs.Stats`][fs-stats] object, you may need to stub the `isDirectory()` method.
#### `file.isSymbolic()`
Returns `true` if the file represents a symbolic link, otherwise `false`.
A file is considered symbolic when:
- `file.isNull()` is `true`
- `file.stat` is an object
- `file.stat.isSymbolicLink()` returns `true`
When constructing a Vinyl object, pass in a valid [`fs.Stats`][fs-stats] object via `options.stat`. If you are mocking the [`fs.Stats`][fs-stats] object, you may need to stub the `isSymbolicLink()` method.
#### `file.clone([options])`
Returns a new Vinyl object with all attributes cloned.
__By default custom attributes are cloned deeply.__
If `options` or `options.deep` is `false`, custom attributes will not be cloned deeply.
If `file.contents` is a [`Buffer`][buffer] and `options.contents` is `false`, the [`Buffer`][buffer] reference will be reused instead of copied.
#### `file.inspect()`
Returns a formatted-string interpretation of the Vinyl object. Automatically called by node's `console.log`.
### Instance properties
Each Vinyl object will have instance properties. Some may be unavailable based on what properties were set upon instantiation or modified since.
#### `file.contents`
Gets and sets the contents of the file. If set to a [`ReadableStream`][readable-stream], it is wrapped in a [`cloneable-readable`][cloneable-readable] stream.
Throws when set to any value other than a [`ReadableStream`][readable-stream], a [`Buffer`][buffer] or `null`.
Type: [`ReadableStream`][readable-stream], [`Buffer`][buffer], or `null`
#### `file.cwd`
Gets and sets current working directory. Will always be normalized and have trailing separators removed.
Throws when set to any value other than non-empty strings.
Type: `String`
#### `file.base`
Gets and sets base directory. Used for relative pathing (typically where a glob starts).
When `null` or `undefined`, it simply proxies the `file.cwd` property. Will always be normalized and have trailing separators removed.
Throws when set to any value other than non-empty strings or `null`/`undefined`.
Type: `String`
#### `file.path`
Gets and sets the absolute pathname string or `undefined`. Setting to a different value appends the new path to `file.history`. If set to the same value as the current path, it is ignored. All new values are normalized and have trailing separators removed.
Throws when set to any value other than a string.
Type: `String`
#### `file.history`
Array of `file.path` values the Vinyl object has had, from `file.history[0]` (original) through `file.history[file.history.length - 1]` (current). `file.history` and its elements should normally be treated as read-only and only altered indirectly by setting `file.path`.
Type: `Array`
#### `file.relative`
Gets the result of `path.relative(file.base, file.path)`.
Throws when set or when `file.path` is not set.
Type: `String`
Example:
```js
var file = new File({
cwd: '/',
base: '/test/',
path: '/test/file.js'
});
console.log(file.relative); // file.js
```
#### `file.dirname`
Gets and sets the dirname of `file.path`. Will always be normalized and have trailing separators removed.
Throws when `file.path` is not set.
Type: `String`
Example:
```js
var file = new File({
cwd: '/',
base: '/test/',
path: '/test/file.js'
});
console.log(file.dirname); // /test
file.dirname = '/specs';
console.log(file.dirname); // /specs
console.log(file.path); // /specs/file.js
```
#### `file.basename`
Gets and sets the basename of `file.path`.
Throws when `file.path` is not set.
Type: `String`
Example:
```js
var file = new File({
cwd: '/',
base: '/test/',
path: '/test/file.js'
});
console.log(file.basename); // file.js
file.basename = 'file.txt';
console.log(file.basename); // file.txt
console.log(file.path); // /test/file.txt
```
#### `file.stem`
Gets and sets stem (filename without suffix) of `file.path`.
Throws when `file.path` is not set.
Type: `String`
Example:
```js
var file = new File({
cwd: '/',
base: '/test/',
path: '/test/file.js'
});
console.log(file.stem); // file
file.stem = 'foo';
console.log(file.stem); // foo
console.log(file.path); // /test/foo.js
```
#### `file.extname`
Gets and sets extname of `file.path`.
Throws when `file.path` is not set.
Type: `String`
Example:
```js
var file = new File({
cwd: '/',
base: '/test/',
path: '/test/file.js'
});
console.log(file.extname); // .js
file.extname = '.txt';
console.log(file.extname); // .txt
console.log(file.path); // /test/file.txt
```
#### `file.symlink`
Gets and sets the path where the file points to if it's a symbolic link. Will always be normalized and have trailing separators removed.
Throws when set to any value other than a string.
Type: `String`
### `Vinyl.isVinyl(file)`
Static method used for checking if an object is a Vinyl file. Use this method instead of `instanceof`.
Takes an object and returns `true` if it is a Vinyl file, otherwise returns `false`.
__Note: This method uses an internal flag that some older versions of Vinyl didn't expose.__
Example:
```js
var Vinyl = require('vinyl');
var file = new Vinyl();
var notAFile = {};
Vinyl.isVinyl(file); // true
Vinyl.isVinyl(notAFile); // false
```
### `Vinyl.isCustomProp(property)`
Static method used by Vinyl when setting values inside the constructor or when copying properties in `file.clone()`.
Takes a string `property` and returns `true` if the property is not used internally, otherwise returns `false`.
This method is useful for inheritting from the Vinyl constructor. Read more in [Extending Vinyl][extending-vinyl].
Example:
```js
var Vinyl = require('vinyl');
Vinyl.isCustomProp('sourceMap'); // true
Vinyl.isCustomProp('path'); // false -> internal getter/setter
```
## Normalization and concatenation
Since all properties are normalized in their setters, you can just concatenate with `/`, and normalization takes care of it properly on all platforms.
Example:
```js
var file = new File();
file.path = '/' + 'test' + '/' + 'foo.bar';
console.log(file.path);
// posix => /test/foo.bar
// win32 => \\test\\foo.bar
```
But never concatenate with `\`, since that is a valid filename character on posix system.
## Extending Vinyl
When extending Vinyl into your own class with extra features, you need to think about a few things.
When you have your own properties that are managed internally, you need to extend the static `isCustomProp` method to return `false` when one of these properties is queried.
```js
var Vinyl = require('vinyl');
var builtInProps = ['foo', '_foo'];
class SuperFile extends Vinyl {
constructor(options) {
super(options);
this._foo = 'example internal read-only value';
}
get foo() {
return this._foo;
}
static isCustomProp(name) {
return super.isCustomProp(name) && builtInProps.indexOf(name) === -1;
}
}
```
This makes properties `foo` and `_foo` ignored when cloning, and when passed in options to `constructor(options)` so they don't get assigned to the new object.
Same goes for `clone()`. If you have your own internal stuff that needs special handling during cloning, you should extend it to do so.
## License
MIT
[is-symbolic]: #issymbolic
[is-directory]: #isdirectory
[normalization]: #normalization-and-concatenation
[extending-vinyl]: #extending-vinyl
[stream]: https://nodejs.org/api/stream.html#stream_stream
[readable-stream]: https://nodejs.org/api/stream.html#stream_readable_streams
[buffer]: https://nodejs.org/api/buffer.html#buffer_class_buffer
[fs-stats]: http://nodejs.org/api/fs.html#fs_class_fs_stats
[vinyl-fs]: https://github.com/gulpjs/vinyl-fs
[cloneable-readable]: https://github.com/mcollina/cloneable-readable
[downloads-image]: http://img.shields.io/npm/dm/vinyl.svg
[npm-url]: https://www.npmjs.com/package/vinyl
[npm-image]: http://img.shields.io/npm/v/vinyl.svg
[travis-url]: https://travis-ci.org/gulpjs/vinyl
[travis-image]: http://img.shields.io/travis/gulpjs/vinyl.svg?label=travis-ci
[appveyor-url]: https://ci.appveyor.com/project/gulpjs/vinyl
[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/vinyl.svg?label=appveyor
[coveralls-url]: https://coveralls.io/r/gulpjs/vinyl
[coveralls-image]: http://img.shields.io/coveralls/gulpjs/vinyl/master.svg
[gitter-url]: https://gitter.im/gulpjs/gulp
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg

View File

@@ -0,0 +1,334 @@
'use strict';
var path = require('path');
var util = require('util');
var isBuffer = require('buffer').Buffer.isBuffer;
var clone = require('clone');
var cloneable = require('cloneable-readable');
var replaceExt = require('replace-ext');
var cloneStats = require('clone-stats');
var cloneBuffer = require('clone-buffer');
var removeTrailingSep = require('remove-trailing-separator');
var isStream = require('./lib/is-stream');
var normalize = require('./lib/normalize');
var inspectStream = require('./lib/inspect-stream');
var builtInFields = [
'_contents', '_symlink', 'contents', 'stat', 'history', 'path',
'_base', 'base', '_cwd', 'cwd',
];
function File(file) {
var self = this;
if (!file) {
file = {};
}
// Stat = files stats object
this.stat = file.stat || null;
// Contents = stream, buffer, or null if not read
this.contents = file.contents || null;
// Replay path history to ensure proper normalization and trailing sep
var history = Array.prototype.slice.call(file.history || []);
if (file.path) {
history.push(file.path);
}
this.history = [];
history.forEach(function(path) {
self.path = path;
});
this.cwd = file.cwd || process.cwd();
this.base = file.base;
this._isVinyl = true;
this._symlink = null;
// Set custom properties
Object.keys(file).forEach(function(key) {
if (self.constructor.isCustomProp(key)) {
self[key] = file[key];
}
});
}
File.prototype.isBuffer = function() {
return isBuffer(this.contents);
};
File.prototype.isStream = function() {
return isStream(this.contents);
};
File.prototype.isNull = function() {
return (this.contents === null);
};
File.prototype.isDirectory = function() {
if (!this.isNull()) {
return false;
}
if (this.stat && typeof this.stat.isDirectory === 'function') {
return this.stat.isDirectory();
}
return false;
};
File.prototype.isSymbolic = function() {
if (!this.isNull()) {
return false;
}
if (this.stat && typeof this.stat.isSymbolicLink === 'function') {
return this.stat.isSymbolicLink();
}
return false;
};
File.prototype.clone = function(opt) {
var self = this;
if (typeof opt === 'boolean') {
opt = {
deep: opt,
contents: true,
};
} else if (!opt) {
opt = {
deep: true,
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.clone();
} else if (this.isBuffer()) {
contents = opt.contents ? cloneBuffer(this.contents) : this.contents;
}
var file = new this.constructor({
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) {
if (self.constructor.isCustomProp(key)) {
file[key] = opt.deep ? clone(self[key], true) : self[key];
}
});
return file;
};
File.prototype.inspect = function() {
var inspect = [];
// Use relative path if possible
var filePath = this.path ? this.relative : null;
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(' ') + '>';
};
// Newer Node.js versions use this symbol for custom inspection.
if (util.inspect.custom) {
File.prototype[util.inspect.custom] = File.prototype.inspect;
}
File.isCustomProp = function(key) {
return builtInFields.indexOf(key) === -1;
};
File.isVinyl = function(file) {
return (file && file._isVinyl === true) || false;
};
// 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) && (val !== null)) {
throw new Error('File.contents can only be a Buffer, a Stream, or null.');
}
// Ask cloneable if the stream is a already a cloneable
// this avoid piping into many streams
// reducing the overhead of cloning
if (isStream(val) && !cloneable.isCloneable(val)) {
val = cloneable(val);
}
this._contents = val;
},
});
Object.defineProperty(File.prototype, 'cwd', {
get: function() {
return this._cwd;
},
set: function(cwd) {
if (!cwd || typeof cwd !== 'string') {
throw new Error('cwd must be a non-empty string.');
}
this._cwd = removeTrailingSep(normalize(cwd));
},
});
Object.defineProperty(File.prototype, 'base', {
get: function() {
return this._base || this._cwd;
},
set: function(base) {
if (base == null) {
delete this._base;
return;
}
if (typeof base !== 'string' || !base) {
throw new Error('base must be a non-empty string, or null/undefined.');
}
base = removeTrailingSep(normalize(base));
if (base !== this._cwd) {
this._base = base;
} else {
delete this._base;
}
},
});
// TODO: Should this be moved to vinyl-fs?
Object.defineProperty(File.prototype, 'relative', {
get: function() {
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, 'dirname', {
get: function() {
if (!this.path) {
throw new Error('No path specified! Can not get dirname.');
}
return path.dirname(this.path);
},
set: function(dirname) {
if (!this.path) {
throw new Error('No path specified! Can not set dirname.');
}
this.path = path.join(dirname, this.basename);
},
});
Object.defineProperty(File.prototype, 'basename', {
get: function() {
if (!this.path) {
throw new Error('No path specified! Can not get basename.');
}
return path.basename(this.path);
},
set: function(basename) {
if (!this.path) {
throw new Error('No path specified! Can not set basename.');
}
this.path = path.join(this.dirname, basename);
},
});
// Property for getting/setting stem of the filename.
Object.defineProperty(File.prototype, 'stem', {
get: function() {
if (!this.path) {
throw new Error('No path specified! Can not get stem.');
}
return path.basename(this.path, this.extname);
},
set: function(stem) {
if (!this.path) {
throw new Error('No path specified! Can not set stem.');
}
this.path = path.join(this.dirname, stem + this.extname);
},
});
Object.defineProperty(File.prototype, 'extname', {
get: function() {
if (!this.path) {
throw new Error('No path specified! Can not get extname.');
}
return path.extname(this.path);
},
set: function(extname) {
if (!this.path) {
throw new Error('No path specified! Can not set extname.');
}
this.path = replaceExt(this.path, extname);
},
});
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 a string.');
}
path = removeTrailingSep(normalize(path));
// Record history only when path changed
if (path && path !== this.path) {
this.history.push(path);
}
},
});
Object.defineProperty(File.prototype, 'symlink', {
get: function() {
return this._symlink;
},
set: function(symlink) {
// TODO: should this set the mode to symbolic if set?
if (typeof symlink !== 'string') {
throw new Error('symlink should be a string');
}
this._symlink = removeTrailingSep(normalize(symlink));
},
});
module.exports = File;

View File

@@ -0,0 +1,13 @@
'use strict';
function inspectStream(stream) {
var streamType = stream.constructor.name;
// Avoid StreamStream
if (streamType === 'Stream') {
streamType = '';
}
return '<' + streamType + 'Stream>';
}
module.exports = inspectStream;

View File

@@ -0,0 +1,15 @@
'use strict';
function isStream(stream) {
if (!stream) {
return false;
}
if (typeof stream.pipe !== 'function') {
return false;
}
return true;
}
module.exports = isStream;

View File

@@ -0,0 +1,9 @@
'use strict';
var path = require('path');
function normalize(str) {
return str === '' ? str : path.normalize(str);
}
module.exports = normalize;

View File

@@ -0,0 +1,97 @@
{
"_from": "vinyl@^2.0.1",
"_id": "vinyl@2.2.0",
"_inBundle": false,
"_integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==",
"_location": "/gulp-remote-src-vscode/vinyl",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "vinyl@^2.0.1",
"name": "vinyl",
"escapedName": "vinyl",
"rawSpec": "^2.0.1",
"saveSpec": null,
"fetchSpec": "^2.0.1"
},
"_requiredBy": [
"/gulp-remote-src-vscode"
],
"_resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz",
"_shasum": "d85b07da96e458d25b2ffe19fece9f2caa13ed86",
"_spec": "vinyl@^2.0.1",
"_where": "/home/nathan/Projects/Upsilon/UpsilonVsCodeLanguageServer/Client/node_modules/gulp-remote-src-vscode",
"author": {
"name": "Gulp Team",
"email": "team@gulpjs.com",
"url": "http://gulpjs.com/"
},
"bugs": {
"url": "https://github.com/gulpjs/vinyl/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Eric Schoffstall",
"email": "yo@contra.io"
},
{
"name": "Blaine Bublitz",
"email": "blaine.bublitz@gmail.com"
}
],
"dependencies": {
"clone": "^2.1.1",
"clone-buffer": "^1.0.0",
"clone-stats": "^1.0.0",
"cloneable-readable": "^1.0.0",
"remove-trailing-separator": "^1.0.1",
"replace-ext": "^1.0.0"
},
"deprecated": false,
"description": "Virtual file format.",
"devDependencies": {
"eslint": "^1.7.3",
"eslint-config-gulp": "^2.0.0",
"expect": "^1.20.2",
"istanbul": "^0.4.3",
"istanbul-coveralls": "^1.0.3",
"jscs": "^2.3.5",
"jscs-preset-gulp": "^1.0.0",
"mississippi": "^1.2.0",
"mocha": "^2.4.5"
},
"engines": {
"node": ">= 0.10"
},
"files": [
"LICENSE",
"index.js",
"lib"
],
"homepage": "https://github.com/gulpjs/vinyl#readme",
"keywords": [
"virtual",
"filesystem",
"file",
"directory",
"stat",
"path"
],
"license": "MIT",
"main": "index.js",
"name": "vinyl",
"repository": {
"type": "git",
"url": "git+https://github.com/gulpjs/vinyl.git"
},
"scripts": {
"cover": "istanbul cover _mocha --report lcovonly",
"coveralls": "npm run cover && istanbul-coveralls",
"lint": "eslint . && jscs index.js lib/ test/",
"pretest": "npm run lint",
"test": "mocha --async-only"
},
"version": "2.2.0"
}

75
Client/node_modules/gulp-remote-src-vscode/package.json generated vendored Executable file
View File

@@ -0,0 +1,75 @@
{
"_from": "gulp-remote-src-vscode@^0.5.0",
"_id": "gulp-remote-src-vscode@0.5.0",
"_inBundle": false,
"_integrity": "sha512-/9vtSk9eI9DEWCqzGieglPqmx0WUQ9pwPHyHFpKmfxqdgqGJC2l0vFMdYs54hLdDsMDEZFLDL2J4ikjc4hQ5HQ==",
"_location": "/gulp-remote-src-vscode",
"_phantomChildren": {
"clone-buffer": "1.0.0",
"cloneable-readable": "1.1.2",
"remove-trailing-separator": "1.1.0",
"replace-ext": "1.0.0"
},
"_requested": {
"type": "range",
"registry": true,
"raw": "gulp-remote-src-vscode@^0.5.0",
"name": "gulp-remote-src-vscode",
"escapedName": "gulp-remote-src-vscode",
"rawSpec": "^0.5.0",
"saveSpec": null,
"fetchSpec": "^0.5.0"
},
"_requiredBy": [
"/vscode"
],
"_resolved": "https://registry.npmjs.org/gulp-remote-src-vscode/-/gulp-remote-src-vscode-0.5.0.tgz",
"_shasum": "71785553bc491880088ad971f90910c4b2d80a99",
"_spec": "gulp-remote-src-vscode@^0.5.0",
"_where": "/home/nathan/Projects/Upsilon/UpsilonVsCodeLanguageServer/Client/node_modules/vscode",
"author": {
"name": "dong",
"email": "ddliuhb@gmail.com"
},
"bugs": {
"url": "https://github.com/ddliu/gulp-remote-src/issues"
},
"bundleDependencies": false,
"dependencies": {
"event-stream": "^3.3.4",
"node.extend": "^1.1.2",
"request": "^2.79.0",
"through2": "^2.0.3",
"vinyl": "^2.0.1"
},
"deprecated": false,
"description": "Remote gulp.src",
"devDependencies": {
"gulp": "^3.9.1",
"gulp-clean": "^0.3.1",
"gulp-uglify": "^2.0.1"
},
"homepage": "https://github.com/ddliu/gulp-remote-src",
"keywords": [
"gulpplugin",
"remote",
"src"
],
"license": "MIT",
"licenses": [
{
"type": "MIT",
"url": "https://github.com/ddliu/gulp-remote-src/blob/master/LICENSE"
}
],
"main": "index.js",
"name": "gulp-remote-src-vscode",
"repository": {
"type": "git",
"url": "git+https://github.com/ddliu/gulp-remote-src.git"
},
"scripts": {
"test": "gulp test"
},
"version": "0.5.0"
}