Initial commit
This commit is contained in:
21
node_modules/stream-shift/LICENSE
generated
vendored
Normal file
21
node_modules/stream-shift/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Mathias Buus
|
||||
|
||||
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.
|
||||
20
node_modules/stream-shift/index.js
generated
vendored
Normal file
20
node_modules/stream-shift/index.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
module.exports = shift
|
||||
|
||||
function shift (stream) {
|
||||
var rs = stream._readableState
|
||||
if (!rs) return null
|
||||
return rs.objectMode ? stream.read() : stream.read(getStateLength(rs))
|
||||
}
|
||||
|
||||
function getStateLength (state) {
|
||||
if (state.buffer.length) {
|
||||
// Since node 6.3.0 state.buffer is a BufferList not an array
|
||||
if (state.buffer.head) {
|
||||
return state.buffer.head.data.length
|
||||
}
|
||||
|
||||
return state.buffer[0].length
|
||||
}
|
||||
|
||||
return state.length
|
||||
}
|
||||
19
node_modules/stream-shift/package.json
generated
vendored
Normal file
19
node_modules/stream-shift/package.json
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "stream-shift",
|
||||
"version": "1.0.0",
|
||||
"description": "Returns the next buffer/object in a stream's readable queue",
|
||||
"main": "index.js",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"standard": "^7.1.2",
|
||||
"tape": "^4.6.0",
|
||||
"through2": "^2.0.1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/mafintosh/stream-shift.git"
|
||||
},
|
||||
"author": "Mathias Buus (@mafintosh)",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/mafintosh/stream-shift"
|
||||
}
|
||||
Reference in New Issue
Block a user