MCPcopy Create free account
hub / github.com/nodejs/node / paginate

Function paginate

deps/npm/lib/commands/token.js:7–14  ·  view source on GitHub ↗
(href, opts, items = [])

Source from the content-addressed store, hash-verified

5const BaseCommand = require('../base-cmd.js')
6
7async function paginate (href, opts, items = []) {
8 while (href) {
9 const result = await fetch.json(href, opts)
10 items = items.concat(result.objects)
11 href = result.urls.next
12 }
13 return items
14}
15
16class Token extends BaseCommand {
17 static description = 'Manage your authentication tokens'

Callers 2

listMethod · 0.85
rmMethod · 0.85

Calls 2

concatMethod · 0.80
jsonMethod · 0.65

Tested by

no test coverage detected