MCPcopy Create free account
hub / github.com/Effect-TS/effect / size

Function size

packages/effect/src/Iterable.ts:447–454  ·  view source on GitHub ↗
(self: Iterable<A>)

Source from the content-addressed store, hash-verified

445 * @since 2.0.0
446 */
447export const size = <A>(self: Iterable<A>): number => {
448 const iterator = self[Symbol.iterator]()
449 let count = 0
450 while (!iterator.next().done) {
451 count++
452 }
453 return count
454}
455
456/**
457 * Gets the first element of a `Iterable` safely, or `None` if the `Iterable` is empty.

Callers

nothing calls this directly

Calls 1

nextMethod · 0.65

Tested by

no test coverage detected