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

Function fileResponseSize

packages/effect/src/http/HttpPlatform.ts:153–162  ·  view source on GitHub ↗
(input: ByteSize.Input, field: string)

Source from the content-addressed store, hash-verified

151}
152
153const fileResponseSize = (input: ByteSize.Input, field: string): Effect.Effect<ByteSize.ByteSize, PlatformError> => {
154 const size = ByteSize.fromInput(input)
155 return Option.isSome(size)
156 ? Effect.succeed(size.value)
157 : Effect.fail(badArgument({
158 module: "HttpPlatform",
159 method: "fileResponse",
160 description: `Invalid ${field}: ${input}`
161 }))
162}
163
164const fileResponseNumber = (value: bigint, field: string): Effect.Effect<number, PlatformError> => {
165 const number = Number(value)

Callers 1

HttpPlatform.tsFile · 0.85

Calls 3

badArgumentFunction · 0.90
failMethod · 0.65
succeedMethod · 0.45

Tested by

no test coverage detected