MCPcopy
hub / github.com/tinyhttp/tinyhttp / length

Method length

packages/session/src/index.ts:655–660  ·  view source on GitHub ↗

* Get number of active sessions. * @param cb Callback

(cb: (err?: any, length?: number) => void)

Source from the content-addressed store, hash-verified

653 * @param cb Callback
654 */
655 length(cb: (err?: any, length?: number) => void) {
656 this.all((_, sessions) => {
657 if (!sessions) return cb(null, 0)
658 cb(null, Object.keys(sessions).length)
659 })
660 }
661
662 /**
663 * Touch the given session object associated with the given session ID.

Callers 1

Calls 1

allMethod · 0.95

Tested by

no test coverage detected