forked from enviPath/enviPy
Current Dev State
This commit is contained in:
39
static/js/ketcher2/node_modules/exposify/node_modules/through2/LICENSE
generated
vendored
Normal file
39
static/js/ketcher2/node_modules/exposify/node_modules/through2/LICENSE
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
Copyright 2013, Rod Vagg (the "Original Author")
|
||||
All rights reserved.
|
||||
|
||||
MIT +no-false-attribs License
|
||||
|
||||
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.
|
||||
|
||||
Distributions of all or part of the Software intended to be used
|
||||
by the recipients as they would use the unmodified Software,
|
||||
containing modifications that substantially alter, remove, or
|
||||
disable functionality of the Software, outside of the documented
|
||||
configuration mechanisms provided by the Software, shall be
|
||||
modified such that the Original Author's bug reporting email
|
||||
addresses and urls are either replaced with the contact information
|
||||
of the parties responsible for the changes, or removed entirely.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
Except where noted, this license applies to any and all software
|
||||
programs and associated documentation files created by the
|
||||
Original Author, when distributed with the Software.
|
||||
140
static/js/ketcher2/node_modules/exposify/node_modules/through2/README.md
generated
vendored
Normal file
140
static/js/ketcher2/node_modules/exposify/node_modules/through2/README.md
generated
vendored
Normal file
@ -0,0 +1,140 @@
|
||||
# through2
|
||||
|
||||
<!--
|
||||
|
||||
soon ...
|
||||
|
||||
[](http://travis-ci.org/rvagg/through2)
|
||||
|
||||
[](https://travis-ci.org/rvagg/through2)
|
||||
|
||||
-->
|
||||
|
||||
[](https://nodei.co/npm/through2/)
|
||||
|
||||
<!--
|
||||
not happy with these, we need to peg to readable-stream@1.0.x so it'll always report out-of-date
|
||||
|
||||
[](https://david-dm.org/rvagg/through2/)
|
||||
[](https://david-dm.org/rvagg/through2#info=devDependencies/)
|
||||
-->
|
||||
|
||||
**A tiny wrapper around Node streams.Transform (Streams2) to avoid explicit subclassing noise**
|
||||
|
||||
Inspired by [Dominic Tarr](https://github.com/dominictarr)'s [through](https://github.com/dominictarr/through) in that it's so much easier to make a stream out of a function than it is to set up the prototype chain properly: `through(function (chunk) { ... })`.
|
||||
|
||||
Note: A **Streams3** version of through2 is available in npm with the tag `"1.0"` rather than `"latest"` so an `npm install through2` will get you the current Streams2 version (version number is 0.x.x). To use a Streams3 version use `npm install through2@1` to fetch the latest version 1.x.x. More information about Streams2 vs Streams3 and recommendations [here](http://www.nearform.com/nodecrunch/dont-use-nodes-core-stream-module).
|
||||
|
||||
```js
|
||||
fs.createReadStream('ex.txt')
|
||||
.pipe(through2(function (chunk, enc, callback) {
|
||||
|
||||
for (var i = 0; i < chunk.length; i++)
|
||||
if (chunk[i] == 97)
|
||||
chunk[i] = 122 // swap 'a' for 'z'
|
||||
|
||||
this.push(chunk)
|
||||
|
||||
callback()
|
||||
|
||||
}))
|
||||
.pipe(fs.createWriteStream('out.txt'))
|
||||
```
|
||||
|
||||
Or object streams:
|
||||
|
||||
```js
|
||||
var all = []
|
||||
|
||||
fs.createReadStream('data.csv')
|
||||
.pipe(csv2())
|
||||
.pipe(through2.obj(function (chunk, enc, callback) {
|
||||
|
||||
var data = {
|
||||
name : chunk[0]
|
||||
, address : chunk[3]
|
||||
, phone : chunk[10]
|
||||
}
|
||||
|
||||
this.push(data)
|
||||
|
||||
callback()
|
||||
|
||||
}))
|
||||
.on('data', function (data) {
|
||||
all.push(data)
|
||||
})
|
||||
.on('end', function () {
|
||||
doSomethingSpecial(all)
|
||||
})
|
||||
```
|
||||
|
||||
Note that `through2.obj(fn)` is a convenience wrapper around `through2({ objectMode: true }, fn)`.
|
||||
|
||||
## API
|
||||
|
||||
<b><code>through2([ options, ] [ transformFunction ] [, flushFunction ])</code></b>
|
||||
|
||||
Consult the **[stream.Transform](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform)** documentation for the exact rules of the `transformFunction` (i.e. `this._transform`) and the optional `flushFunction` (i.e. `this._flush`).
|
||||
|
||||
### options
|
||||
|
||||
The options argument is optional and is passed straight through to `stream.Transform`. So you can use `objectMode:true` if you are processing non-binary streams (or just use `through2.obj()`).
|
||||
|
||||
The `options` argument is first, unlike standard convention, because if I'm passing in an anonymous function then I'd prefer for the options argument to not get lost at the end of the call:
|
||||
|
||||
```js
|
||||
fs.createReadStream('/tmp/important.dat')
|
||||
.pipe(through2({ objectMode: true, allowHalfOpen: false }, function (chunk, enc, cb) {
|
||||
|
||||
this.push(new Buffer('wut?'))
|
||||
cb()
|
||||
|
||||
})
|
||||
.pipe(fs.createWriteStream('/tmp/wut.txt'))
|
||||
```
|
||||
|
||||
### transformFunction
|
||||
|
||||
The `transformFunction` must have the following signature: `function (chunk, encoding, callback) {}`. A minimal implementation should call the `callback` function to indicate that the transformation is done, even if that transformation means discarding the chunk.
|
||||
|
||||
To queue a new chunk, call `this.push(chunk)`—this can be called as many times as required before the `callback()` if you have multiple pieces to send on.
|
||||
|
||||
If you **do not provide a `transformFunction`** then you will get a simple simple pass-through stream.
|
||||
|
||||
### flushFunction
|
||||
|
||||
The optional `flushFunction` is provided as the last argument (2nd or 3rd, depending on whether you've supplied options) is called just prior to the stream ending. Can be used to finish up any processing that may be in progress.
|
||||
|
||||
<b><code>through2.ctor([ options, ] transformFunction[, flushFunction ])</code></b>
|
||||
|
||||
Instead of returning a `stream.Transform` instance, `through2.ctor()` returns a **constructor** for a custom Transform. This is useful when you want to use the same transform logic in multiple instances.
|
||||
|
||||
```js
|
||||
var FToC = through2.ctor({objectMode: true}, function (record, encoding, callback) {
|
||||
if (record.temp != null && record.unit = "F") {
|
||||
record.temp = ( ( record.temp - 32 ) * 5 ) / 9
|
||||
record.unit = "C"
|
||||
}
|
||||
this.push(record)
|
||||
callback()
|
||||
})
|
||||
|
||||
// Create instances of FToC like so:
|
||||
var converter = new FToC()
|
||||
// Or:
|
||||
var converter = FToC()
|
||||
// Or specify/override options when you instantiate, if you prefer:
|
||||
var converter = FToC({objectMode: true})
|
||||
```
|
||||
|
||||
## See Also
|
||||
|
||||
- [through2-map](https://github.com/brycebaril/through2-map) - Array.prototype.map analog for streams.
|
||||
- [through2-filter](https://github.com/brycebaril/through2-filter) - Array.prototype.filter analog for streams.
|
||||
- [through2-reduce](https://github.com/brycebaril/through2-reduce) - Array.prototype.reduce analog for streams.
|
||||
- [through2-spy](https://github.com/brycebaril/through2-spy) - Wrapper for simple stream.PassThrough spies.
|
||||
|
||||
## License
|
||||
|
||||
**through2** is Copyright (c) 2013 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.
|
||||
65
static/js/ketcher2/node_modules/exposify/node_modules/through2/package.json
generated
vendored
Normal file
65
static/js/ketcher2/node_modules/exposify/node_modules/through2/package.json
generated
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
{
|
||||
"_from": "through2@~0.4.0",
|
||||
"_id": "through2@0.4.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-2/WGYDEVHsg1K7bE22SiKSqEC5s=",
|
||||
"_location": "/exposify/through2",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "through2@~0.4.0",
|
||||
"name": "through2",
|
||||
"escapedName": "through2",
|
||||
"rawSpec": "~0.4.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~0.4.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/exposify"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/through2/-/through2-0.4.2.tgz",
|
||||
"_shasum": "dbf5866031151ec8352bb6c4db64a2292a840b9b",
|
||||
"_spec": "through2@~0.4.0",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/exposify",
|
||||
"author": {
|
||||
"name": "Rod Vagg",
|
||||
"email": "r@va.gg",
|
||||
"url": "https://github.com/rvagg"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/rvagg/through2/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"readable-stream": "~1.0.17",
|
||||
"xtend": "~2.1.1"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise",
|
||||
"devDependencies": {
|
||||
"bl": "~0.6.0",
|
||||
"brtapsauce": "~0.2.2",
|
||||
"stream-spigot": "~3.0.1",
|
||||
"tape": "~2.3.0"
|
||||
},
|
||||
"homepage": "https://github.com/rvagg/through2#readme",
|
||||
"keywords": [
|
||||
"stream",
|
||||
"streams2",
|
||||
"through",
|
||||
"transform"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "through2.js",
|
||||
"name": "through2",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/rvagg/through2.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test/test.js",
|
||||
"test-local": "brtapsauce-local test/basic-test.js"
|
||||
},
|
||||
"version": "0.4.2"
|
||||
}
|
||||
78
static/js/ketcher2/node_modules/exposify/node_modules/through2/through2.js
generated
vendored
Normal file
78
static/js/ketcher2/node_modules/exposify/node_modules/through2/through2.js
generated
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
var Transform = require('readable-stream/transform')
|
||||
, inherits = require('util').inherits
|
||||
, xtend = require('xtend')
|
||||
|
||||
|
||||
// a noop _transform function
|
||||
function noop (chunk, enc, callback) {
|
||||
callback(null, chunk)
|
||||
}
|
||||
|
||||
|
||||
// create a new export function, used by both the main export and
|
||||
// the .ctor export, contains common logic for dealing with arguments
|
||||
function through2 (construct) {
|
||||
return function (options, transform, flush) {
|
||||
if (typeof options == 'function') {
|
||||
flush = transform
|
||||
transform = options
|
||||
options = {}
|
||||
}
|
||||
|
||||
if (typeof transform != 'function')
|
||||
transform = noop
|
||||
|
||||
if (typeof flush != 'function')
|
||||
flush = null
|
||||
|
||||
return construct(options, transform, flush)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// main export, just make me a transform stream!
|
||||
module.exports = through2(function (options, transform, flush) {
|
||||
var t2 = new Transform(options)
|
||||
|
||||
t2._transform = transform
|
||||
|
||||
if (flush)
|
||||
t2._flush = flush
|
||||
|
||||
return t2
|
||||
})
|
||||
|
||||
|
||||
// make me a reusable prototype that I can `new`, or implicitly `new`
|
||||
// with a constructor call
|
||||
module.exports.ctor = through2(function (options, transform, flush) {
|
||||
function Through2 (override) {
|
||||
if (!(this instanceof Through2))
|
||||
return new Through2(override)
|
||||
|
||||
this.options = xtend(options, override)
|
||||
|
||||
Transform.call(this, this.options)
|
||||
}
|
||||
|
||||
inherits(Through2, Transform)
|
||||
|
||||
Through2.prototype._transform = transform
|
||||
|
||||
if (flush)
|
||||
Through2.prototype._flush = flush
|
||||
|
||||
return Through2
|
||||
})
|
||||
|
||||
|
||||
module.exports.obj = through2(function (options, transform, flush) {
|
||||
var t2 = new Transform(xtend({ objectMode: true }, options))
|
||||
|
||||
t2._transform = transform
|
||||
|
||||
if (flush)
|
||||
t2._flush = flush
|
||||
|
||||
return t2
|
||||
})
|
||||
Reference in New Issue
Block a user