您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

index.js 453B

1234567891011121314151617181920
  1. module.exports = shift
  2. function shift (stream) {
  3. var rs = stream._readableState
  4. if (!rs) return null
  5. return rs.objectMode ? stream.read() : stream.read(getStateLength(rs))
  6. }
  7. function getStateLength (state) {
  8. if (state.buffer.length) {
  9. // Since node 6.3.0 state.buffer is a BufferList not an array
  10. if (state.buffer.head) {
  11. return state.buffer.head.data.length
  12. }
  13. return state.buffer[0].length
  14. }
  15. return state.length
  16. }