MCPcopy
hub / github.com/tinyhttp/tinyhttp / compileTrust

Function compileTrust

packages/proxy-addr/src/index.ts:78–82  ·  view source on GitHub ↗

* Compile range subnet array into trust function. * * @param rangeSubnets

(rangeSubnets: any[])

Source from the content-addressed store, hash-verified

76 * @param rangeSubnets
77 */
78function compileTrust(rangeSubnets: any[]) {
79 // Return optimized function based on length
80 const len = rangeSubnets.length
81 return len === 0 ? trustNone : len === 1 ? trustSingle(rangeSubnets[0]) : trustMulti(rangeSubnets)
82}
83/**
84 * Parse IP notation string into range subnet.
85 *

Callers 1

compileFunction · 0.85

Calls 2

trustSingleFunction · 0.85
trustMultiFunction · 0.85

Tested by

no test coverage detected