mirror of
https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools.git
synced 2026-02-04 05:50:50 +00:00
nhj
more
This commit is contained in:
5
unified-ai-platform/node_modules/through/.travis.yml
generated
vendored
Normal file
5
unified-ai-platform/node_modules/through/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 0.6
|
||||
- 0.8
|
||||
- "0.10"
|
||||
15
unified-ai-platform/node_modules/through/LICENSE.APACHE2
generated
vendored
Normal file
15
unified-ai-platform/node_modules/through/LICENSE.APACHE2
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
Apache License, Version 2.0
|
||||
|
||||
Copyright (c) 2011 Dominic Tarr
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
108
unified-ai-platform/node_modules/through/index.js
generated
vendored
Normal file
108
unified-ai-platform/node_modules/through/index.js
generated
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
var Stream = require('stream')
|
||||
|
||||
// through
|
||||
//
|
||||
// a stream that does nothing but re-emit the input.
|
||||
// useful for aggregating a series of changing but not ending streams into one stream)
|
||||
|
||||
exports = module.exports = through
|
||||
through.through = through
|
||||
|
||||
//create a readable writable stream.
|
||||
|
||||
function through (write, end, opts) {
|
||||
write = write || function (data) { this.queue(data) }
|
||||
end = end || function () { this.queue(null) }
|
||||
|
||||
var ended = false, destroyed = false, buffer = [], _ended = false
|
||||
var stream = new Stream()
|
||||
stream.readable = stream.writable = true
|
||||
stream.paused = false
|
||||
|
||||
// stream.autoPause = !(opts && opts.autoPause === false)
|
||||
stream.autoDestroy = !(opts && opts.autoDestroy === false)
|
||||
|
||||
stream.write = function (data) {
|
||||
write.call(this, data)
|
||||
return !stream.paused
|
||||
}
|
||||
|
||||
function drain() {
|
||||
while(buffer.length && !stream.paused) {
|
||||
var data = buffer.shift()
|
||||
if(null === data)
|
||||
return stream.emit('end')
|
||||
else
|
||||
stream.emit('data', data)
|
||||
}
|
||||
}
|
||||
|
||||
stream.queue = stream.push = function (data) {
|
||||
// console.error(ended)
|
||||
if(_ended) return stream
|
||||
if(data === null) _ended = true
|
||||
buffer.push(data)
|
||||
drain()
|
||||
return stream
|
||||
}
|
||||
|
||||
//this will be registered as the first 'end' listener
|
||||
//must call destroy next tick, to make sure we're after any
|
||||
//stream piped from here.
|
||||
//this is only a problem if end is not emitted synchronously.
|
||||
//a nicer way to do this is to make sure this is the last listener for 'end'
|
||||
|
||||
stream.on('end', function () {
|
||||
stream.readable = false
|
||||
if(!stream.writable && stream.autoDestroy)
|
||||
process.nextTick(function () {
|
||||
stream.destroy()
|
||||
})
|
||||
})
|
||||
|
||||
function _end () {
|
||||
stream.writable = false
|
||||
end.call(stream)
|
||||
if(!stream.readable && stream.autoDestroy)
|
||||
stream.destroy()
|
||||
}
|
||||
|
||||
stream.end = function (data) {
|
||||
if(ended) return
|
||||
ended = true
|
||||
if(arguments.length) stream.write(data)
|
||||
_end() // will emit or queue
|
||||
return stream
|
||||
}
|
||||
|
||||
stream.destroy = function () {
|
||||
if(destroyed) return
|
||||
destroyed = true
|
||||
ended = true
|
||||
buffer.length = 0
|
||||
stream.writable = stream.readable = false
|
||||
stream.emit('close')
|
||||
return stream
|
||||
}
|
||||
|
||||
stream.pause = function () {
|
||||
if(stream.paused) return
|
||||
stream.paused = true
|
||||
return stream
|
||||
}
|
||||
|
||||
stream.resume = function () {
|
||||
if(stream.paused) {
|
||||
stream.paused = false
|
||||
stream.emit('resume')
|
||||
}
|
||||
drain()
|
||||
//may have become paused again,
|
||||
//as drain emits 'data'.
|
||||
if(!stream.paused)
|
||||
stream.emit('drain')
|
||||
return stream
|
||||
}
|
||||
return stream
|
||||
}
|
||||
|
||||
36
unified-ai-platform/node_modules/through/package.json
generated
vendored
Normal file
36
unified-ai-platform/node_modules/through/package.json
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "through",
|
||||
"version": "2.3.8",
|
||||
"description": "simplified stream construction",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "set -e; for t in test/*.js; do node $t; done"
|
||||
},
|
||||
"devDependencies": {
|
||||
"stream-spec": "~0.3.5",
|
||||
"tape": "~2.3.2",
|
||||
"from": "~0.1.3"
|
||||
},
|
||||
"keywords": [
|
||||
"stream",
|
||||
"streams",
|
||||
"user-streams",
|
||||
"pipe"
|
||||
],
|
||||
"author": "Dominic Tarr <dominic.tarr@gmail.com> (dominictarr.com)",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dominictarr/through.git"
|
||||
},
|
||||
"homepage": "https://github.com/dominictarr/through",
|
||||
"testling": {
|
||||
"browsers": [
|
||||
"ie/8..latest",
|
||||
"ff/15..latest",
|
||||
"chrome/20..latest",
|
||||
"safari/5.1..latest"
|
||||
],
|
||||
"files": "test/*.js"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user