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

Function setKey

packages/effect/src/unstable/cli/internal/parser.ts:258–266  ·  view source on GitHub ↗
(key: string, command: Command<string, unknown, unknown, unknown, unknown>)

Source from the content-addressed store, hash-verified

256): Map<string, Command<string, unknown, unknown, unknown, unknown>> => {
257 const index = new Map<string, Command<string, unknown, unknown, unknown, unknown>>()
258 const setKey = (key: string, command: Command<string, unknown, unknown, unknown, unknown>) => {
259 const existing = index.get(key)
260 if (existing && existing !== command) {
261 throw new Error(
262 `Duplicate subcommand name/alias "${key}" in command definition (conflicts with "${existing.name}")`
263 )
264 }
265 index.set(key, command)
266 }
267
268 for (const group of subcommands) {
269 for (const subcommand of group.commands) {

Callers 1

buildSubcommandIndexFunction · 0.85

Calls 2

getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected