Skip to content
This repository was archived by the owner on Jan 19, 2022. It is now read-only.

Commit 5e6b41e

Browse files
author
Michael Perrotte
committedFeb 27, 2020
fix: removed get-streams as a dependency
- Can lean on 'npm-registry-fetch' using minipass now and leverage methods like '.collect()'
1 parent 0c51827 commit 5e6b41e

File tree

4 files changed

+12
-36
lines changed

4 files changed

+12
-36
lines changed
 

‎index.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict'
22

33
const eu = encodeURIComponent
4-
const getStream = require('get-stream')
54
const npmFetch = require('npm-registry-fetch')
65
const validate = require('aproba')
76

@@ -64,7 +63,7 @@ cmd.rm = (user, entity, opts = {}) => {
6463

6564
cmd.lsTeams = (scope, opts = {}) => {
6665
return pwrap(opts, () => {
67-
return getStream.array(cmd.lsTeams.stream(scope, { ...opts }))
66+
return cmd.lsTeams.stream(scope, { ...opts }).collect()
6867
})
6968
}
7069
cmd.lsTeams.stream = (scope, opts = {}) => {
@@ -78,7 +77,7 @@ cmd.lsTeams.stream = (scope, opts = {}) => {
7877

7978
cmd.lsUsers = (entity, opts = {}) => {
8079
return pwrap(opts, () => {
81-
return getStream.array(cmd.lsUsers.stream(entity, { ...opts }))
80+
return cmd.lsUsers.stream(entity, { ...opts }).collect()
8281
})
8382
}
8483
cmd.lsUsers.stream = (entity, opts = {}) => {

‎package-lock.json

-25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"homepage": "https://npmjs.com/package/libnpmteam",
2626
"dependencies": {
2727
"aproba": "^2.0.0",
28-
"get-stream": "^4.0.0",
2928
"npm-registry-fetch": "^8.0.0"
3029
},
3130
"engines": {

‎test/index.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict'
22

3-
const getStream = require('get-stream')
43
const { test } = require('tap')
54
const tnock = require('./fixtures/tnock.js')
65

@@ -97,9 +96,11 @@ test('lsTeams.stream', t => {
9796
tnock(t, REG).get(
9897
'/-/org/foo/team?format=cli'
9998
).reply(200, ['foo:bar', 'foo:cli'])
100-
return getStream.array(team.lsTeams.stream('foo', OPTS)).then(ret => {
101-
t.deepEqual(ret, ['foo:bar', 'foo:cli'], 'got teams')
102-
})
99+
return team.lsTeams.stream('foo', OPTS)
100+
.collect()
101+
.then(ret => {
102+
t.deepEqual(ret, ['foo:bar', 'foo:cli'], 'got teams')
103+
})
103104
})
104105

105106
test('lsUsers', t => {
@@ -125,9 +126,11 @@ test('lsUsers.stream', t => {
125126
tnock(t, REG).get(
126127
'/-/team/foo/cli/user?format=cli'
127128
).reply(200, ['iarna', 'zkat'])
128-
return getStream.array(team.lsUsers.stream('@foo:cli', OPTS)).then(ret => {
129-
t.deepEqual(ret, ['iarna', 'zkat'], 'got team members')
130-
})
129+
return team.lsUsers.stream('@foo:cli', OPTS)
130+
.collect()
131+
.then(ret => {
132+
t.deepEqual(ret, ['iarna', 'zkat'], 'got team members')
133+
})
131134
})
132135

133136
test('edit', t => {

0 commit comments

Comments
 (0)
This repository has been archived.