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

Function parseRaw

packages/effect/src/ui/Query.ts:4353–4370  ·  view source on GitHub ↗
(
  input: unknown
)

Source from the content-addressed store, hash-verified

4351
4352/** The `~query` payload by query name and args key, or `undefined` when it isn't the tuple shape. */
4353const parseRaw = (
4354 input: unknown
4355): Map<string, Map<string, RawTuple>> | undefined => {
4356 if (typeof input !== "object" || input === null || Array.isArray(input)) {
4357 return undefined
4358 }
4359 const out = new Map<string, Map<string, RawTuple>>()
4360 for (const [name, tuples] of Object.entries(input)) {
4361 if (!Array.isArray(tuples)) return undefined
4362 const byKey = new Map<string, RawTuple>()
4363 for (const tuple of tuples) {
4364 if (!isRawTuple(tuple)) return undefined
4365 if (!byKey.has(tuple[0])) byKey.set(tuple[0], tuple)
4366 }
4367 if (byKey.size > 0) out.set(name, byKey)
4368 }
4369 return out
4370}
4371
4372interface PendingDecode {
4373 readonly _tag: "Pending"

Callers 3

makeShippedFunction · 0.85
hydrateFunction · 0.85
checkWireFunction · 0.85

Calls 3

isRawTupleFunction · 0.85
hasMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected