summaryrefslogtreecommitdiff
path: root/node_modules/stream-shift
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-01-15 18:39:22 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-01-15 18:39:22 +0800
commitfc20313fc9b457d6676ad273227f6bad3c652b92 (patch)
tree9935855ffdd7a2d5d0ef5659f63309b4e15fa014 /node_modules/stream-shift
parentd76c63da1426adbb2031ae4562d29521d621d817 (diff)
upgrade for package
Diffstat (limited to 'node_modules/stream-shift')
-rw-r--r--node_modules/stream-shift/.github/workflows/test.yml23
-rw-r--r--node_modules/stream-shift/.travis.yml6
-rw-r--r--node_modules/stream-shift/index.js4
-rw-r--r--node_modules/stream-shift/package.json2
-rw-r--r--node_modules/stream-shift/test.js8
5 files changed, 30 insertions, 13 deletions
diff --git a/node_modules/stream-shift/.github/workflows/test.yml b/node_modules/stream-shift/.github/workflows/test.yml
new file mode 100644
index 00000000..9b94272e
--- /dev/null
+++ b/node_modules/stream-shift/.github/workflows/test.yml
@@ -0,0 +1,23 @@
+name: Build Status
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+jobs:
+ build:
+ strategy:
+ matrix:
+ node-version: [lts/*]
+ os: [ubuntu-latest, macos-latest, windows-latest]
+ runs-on: ${{ matrix.os }}
+ steps:
+ - uses: actions/checkout@v3
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v3
+ with:
+ node-version: ${{ matrix.node-version }}
+ - run: npm install
+ - run: npm test
diff --git a/node_modules/stream-shift/.travis.yml b/node_modules/stream-shift/.travis.yml
deleted file mode 100644
index ecd4193f..00000000
--- a/node_modules/stream-shift/.travis.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-language: node_js
-node_js:
- - "0.10"
- - "0.12"
- - "4"
- - "6"
diff --git a/node_modules/stream-shift/index.js b/node_modules/stream-shift/index.js
index 33cc4d74..ea267c8c 100644
--- a/node_modules/stream-shift/index.js
+++ b/node_modules/stream-shift/index.js
@@ -11,9 +11,9 @@ function getStateLength (state) {
// Since node 6.3.0 state.buffer is a BufferList not an array
if (state.buffer.head) {
return state.buffer.head.data.length
+ } else if (state.buffer.length > 0 && state.buffer[0]) {
+ return state.buffer[0].length
}
-
- return state.buffer[0].length
}
return state.length
diff --git a/node_modules/stream-shift/package.json b/node_modules/stream-shift/package.json
index fe7347a0..26bfc982 100644
--- a/node_modules/stream-shift/package.json
+++ b/node_modules/stream-shift/package.json
@@ -1,6 +1,6 @@
{
"name": "stream-shift",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "Returns the next buffer/object in a stream's readable queue",
"main": "index.js",
"dependencies": {},
diff --git a/node_modules/stream-shift/test.js b/node_modules/stream-shift/test.js
index c0222c37..bf4ed668 100644
--- a/node_modules/stream-shift/test.js
+++ b/node_modules/stream-shift/test.js
@@ -9,8 +9,8 @@ tape('shifts next', function (t) {
passthrough.write('hello')
passthrough.write('world')
- t.same(shift(passthrough), Buffer('hello'))
- t.same(shift(passthrough), Buffer('world'))
+ t.same(shift(passthrough), Buffer.from('hello'))
+ t.same(shift(passthrough), Buffer.from('world'))
t.end()
})
@@ -20,8 +20,8 @@ tape('shifts next with core', function (t) {
passthrough.write('hello')
passthrough.write('world')
- t.same(shift(passthrough), Buffer('hello'))
- t.same(shift(passthrough), Buffer('world'))
+ t.same(shift(passthrough), Buffer.from('hello'))
+ t.same(shift(passthrough), Buffer.from('world'))
t.end()
})