forked from enviPath/enviPy
Current Dev State
This commit is contained in:
20
static/js/ketcher2/node_modules/vinyl/LICENSE
generated
vendored
Normal file
20
static/js/ketcher2/node_modules/vinyl/LICENSE
generated
vendored
Normal 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.
|
||||
195
static/js/ketcher2/node_modules/vinyl/README.md
generated
vendored
Normal file
195
static/js/ketcher2/node_modules/vinyl/README.md
generated
vendored
Normal file
@ -0,0 +1,195 @@
|
||||
# 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><br><tr><br><td>Package</td><td>vinyl</td><br></tr><br><tr><br><td>Description</td><br><td>A virtual file format</td><br></tr><br><tr><br><td>Node Version</td><br><td>>= 0.9</td><br></tr><br></table>
|
||||
|
||||
## What is this?
|
||||
Read this for more info about how this plays into the grand scheme of things [https://medium.com/@eschoff/3828e8126466](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")
|
||||
});
|
||||
```
|
||||
|
||||
### isVinyl
|
||||
When checking if an object is a vinyl file, you should not use instanceof. Use the isVinyl function instead.
|
||||
|
||||
```js
|
||||
var File = require('vinyl');
|
||||
|
||||
var dummy = new File({stuff});
|
||||
var notAFile = {};
|
||||
|
||||
File.isVinyl(dummy); // true
|
||||
File.isVinyl(notAFile); // false
|
||||
```
|
||||
|
||||
### constructor(options)
|
||||
#### options.cwd
|
||||
Type: `String`<br><br>Default: `process.cwd()`
|
||||
|
||||
#### options.base
|
||||
Used for relative pathing. Typically where a glob starts.
|
||||
|
||||
Type: `String`<br><br>Default: `options.cwd`
|
||||
|
||||
#### options.path
|
||||
Full path to the file.
|
||||
|
||||
Type: `String`<br><br>Default: `undefined`
|
||||
|
||||
#### options.history
|
||||
Path history. Has no effect if `options.path` is passed.
|
||||
|
||||
Type: `Array`<br><br>Default: `options.path ? [options.path] : []`
|
||||
|
||||
#### 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`<br><br>Default: `null`
|
||||
|
||||
#### options.contents
|
||||
File contents.
|
||||
|
||||
Type: `Buffer, Stream, or null`<br><br>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([opt])
|
||||
Returns a new File object with all attributes cloned.<br>By default custom attributes are deep-cloned.
|
||||
|
||||
If opt or opt.deep is false, custom attributes will not be deep-cloned.
|
||||
|
||||
If opt.contents is false, it will copy file.contents Buffer's reference.
|
||||
|
||||
### 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.
|
||||
|
||||
### contents
|
||||
The [Stream](https://nodejs.org/api/stream.html#stream_stream) or [Buffer](https://nodejs.org/api/buffer.html#buffer_class_buffer) of the file as it was passed in via options, or as the result of modification.
|
||||
|
||||
For example:
|
||||
|
||||
```js
|
||||
if (file.isBuffer()) {
|
||||
console.log(file.contents.toString()); // logs out the string of contents
|
||||
}
|
||||
```
|
||||
|
||||
### path
|
||||
Absolute pathname string or `undefined`. Setting to a different value pushes the old value to `history`.
|
||||
|
||||
### history
|
||||
Array of `path` values the file object has had, from `history[0]` (original) through `history[history.length - 1]` (current). `history` and its elements should normally be treated as read-only and only altered indirectly by setting `path`.
|
||||
|
||||
### 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
|
||||
```
|
||||
|
||||
### dirname
|
||||
Gets and sets path.dirname for the file path.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
var file = new File({
|
||||
cwd: "/",
|
||||
base: "/test/",
|
||||
path: "/test/file.coffee"
|
||||
});
|
||||
|
||||
console.log(file.dirname); // /test
|
||||
|
||||
file.dirname = '/specs';
|
||||
|
||||
console.log(file.dirname); // /specs
|
||||
console.log(file.path); // /specs/file.coffee
|
||||
`
|
||||
```
|
||||
|
||||
### basename
|
||||
Gets and sets path.basename for the file path.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
var file = new File({
|
||||
cwd: "/",
|
||||
base: "/test/",
|
||||
path: "/test/file.coffee"
|
||||
});
|
||||
|
||||
console.log(file.basename); // file.coffee
|
||||
|
||||
file.basename = 'file.js';
|
||||
|
||||
console.log(file.basename); // file.js
|
||||
console.log(file.path); // /test/file.js
|
||||
`
|
||||
```
|
||||
|
||||
### extname
|
||||
Gets and sets path.extname for the file path.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
var file = new File({
|
||||
cwd: "/",
|
||||
base: "/test/",
|
||||
path: "/test/file.coffee"
|
||||
});
|
||||
|
||||
console.log(file.extname); // .coffee
|
||||
|
||||
file.extname = '.js';
|
||||
|
||||
console.log(file.extname); // .js
|
||||
console.log(file.path); // /test/file.js
|
||||
`
|
||||
```
|
||||
|
||||
[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
|
||||
213
static/js/ketcher2/node_modules/vinyl/index.js
generated
vendored
Normal file
213
static/js/ketcher2/node_modules/vinyl/index.js
generated
vendored
Normal file
@ -0,0 +1,213 @@
|
||||
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');
|
||||
var replaceExt = require('replace-ext');
|
||||
|
||||
function File(file) {
|
||||
if (!file) file = {};
|
||||
|
||||
// record path change
|
||||
var history = file.path ? [file.path] : file.history;
|
||||
this.history = history || [];
|
||||
|
||||
this.cwd = file.cwd || process.cwd();
|
||||
this.base = file.base || this.cwd;
|
||||
|
||||
// stat = files stats object
|
||||
this.stat = file.stat || null;
|
||||
|
||||
// contents = stream, buffer, or null if not read
|
||||
this.contents = file.contents || null;
|
||||
|
||||
this._isVinyl = true;
|
||||
}
|
||||
|
||||
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: 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.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(' ')+'>';
|
||||
};
|
||||
|
||||
File.isVinyl = function(file) {
|
||||
return file && file._isVinyl === true;
|
||||
};
|
||||
|
||||
// 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, '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, path.basename(this.path));
|
||||
}
|
||||
});
|
||||
|
||||
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(path.dirname(this.path), basename);
|
||||
}
|
||||
});
|
||||
|
||||
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 string');
|
||||
|
||||
// record history only when path changed
|
||||
if (path && path !== this.path) {
|
||||
this.history.push(path);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = File;
|
||||
7
static/js/ketcher2/node_modules/vinyl/lib/cloneBuffer.js
generated
vendored
Normal file
7
static/js/ketcher2/node_modules/vinyl/lib/cloneBuffer.js
generated
vendored
Normal 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
static/js/ketcher2/node_modules/vinyl/lib/inspectStream.js
generated
vendored
Normal file
11
static/js/ketcher2/node_modules/vinyl/lib/inspectStream.js
generated
vendored
Normal 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>';
|
||||
};
|
||||
1
static/js/ketcher2/node_modules/vinyl/lib/isBuffer.js
generated
vendored
Normal file
1
static/js/ketcher2/node_modules/vinyl/lib/isBuffer.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('buffer').Buffer.isBuffer;
|
||||
3
static/js/ketcher2/node_modules/vinyl/lib/isNull.js
generated
vendored
Normal file
3
static/js/ketcher2/node_modules/vinyl/lib/isNull.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
module.exports = function(v) {
|
||||
return v === null;
|
||||
};
|
||||
5
static/js/ketcher2/node_modules/vinyl/lib/isStream.js
generated
vendored
Normal file
5
static/js/ketcher2/node_modules/vinyl/lib/isStream.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
var Stream = require('stream').Stream;
|
||||
|
||||
module.exports = function(o) {
|
||||
return !!o && o instanceof Stream;
|
||||
};
|
||||
72
static/js/ketcher2/node_modules/vinyl/package.json
generated
vendored
Normal file
72
static/js/ketcher2/node_modules/vinyl/package.json
generated
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
{
|
||||
"_from": "vinyl@^0.5.0",
|
||||
"_id": "vinyl@0.5.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4=",
|
||||
"_location": "/vinyl",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "vinyl@^0.5.0",
|
||||
"name": "vinyl",
|
||||
"escapedName": "vinyl",
|
||||
"rawSpec": "^0.5.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^0.5.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/gulp-util"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz",
|
||||
"_shasum": "b0455b38fc5e0cf30d4325132e461970c2091cde",
|
||||
"_spec": "vinyl@^0.5.0",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/gulp-util",
|
||||
"author": {
|
||||
"name": "Fractal",
|
||||
"email": "contact@wearefractal.com",
|
||||
"url": "http://wearefractal.com/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/wearefractal/vinyl/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"clone": "^1.0.0",
|
||||
"clone-stats": "^0.0.1",
|
||||
"replace-ext": "0.0.1"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "A virtual file format",
|
||||
"devDependencies": {
|
||||
"buffer-equal": "0.0.1",
|
||||
"event-stream": "^3.1.0",
|
||||
"istanbul": "^0.3.0",
|
||||
"istanbul-coveralls": "^1.0.1",
|
||||
"jshint": "^2.4.1",
|
||||
"lodash.templatesettings": "^3.1.0",
|
||||
"mocha": "^2.0.0",
|
||||
"rimraf": "^2.2.5",
|
||||
"should": "^7.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.9"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"lib"
|
||||
],
|
||||
"homepage": "http://github.com/wearefractal/vinyl",
|
||||
"license": "MIT",
|
||||
"main": "./index.js",
|
||||
"name": "vinyl",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/wearefractal/vinyl.git"
|
||||
},
|
||||
"scripts": {
|
||||
"coveralls": "istanbul cover _mocha && istanbul-coveralls",
|
||||
"test": "mocha && jshint lib"
|
||||
},
|
||||
"version": "0.5.3"
|
||||
}
|
||||
Reference in New Issue
Block a user