MCPcopy Index your code
hub / github.com/Effect-TS/effect / sum

Function sum

packages/effect/test/Effect/sync.test.ts:9–14  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

7import * as Option from "effect/Option"
8
9const sum = (n: number): number => {
10 if (n < 0) {
11 return 0
12 }
13 return n + sum(n - 1)
14}
15
16describe("Effect", () => {
17 it("runSyncExit with async is a defect with stack", () => {

Callers 4

sync.test.tsFile · 0.70
BigDecimal.tsFile · 0.50
sumAllFunction · 0.50
incrementFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected