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

Function checkLimit

packages/effect/src/encoding/Xml.ts:909–915  ·  view source on GitHub ↗
(name: string, value: number | undefined, defaultValue: number)

Source from the content-addressed store, hash-verified

907const defaultMaxElementSize = 16 * 1024 * 1024
908
909const checkLimit = (name: string, value: number | undefined, defaultValue: number): number => {
910 const limit = value ?? defaultValue
911 if (!(limit > 0)) {
912 throw new Error(`Xml: ${name} must be positive, got ${limit}`)
913 }
914 return limit
915}
916
917// The per-run state of a channel. `push` and `end` add output to `out`, and
918// throw `XmlError`s.

Callers 2

elementsFunction · 0.85
makeParserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected