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 }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
.npmignore | File | 13 B | 0644 |
|
.travis.yml | File | 65 B | 0644 |
|
LICENSE | File | 1.05 KB | 0644 |
|
README.md | File | 480 B | 0644 |
|
index.js | File | 453 B | 0644 |
|
package.json | File | 1.44 KB | 0644 |
|
test.js | File | 1.12 KB | 0644 |
|