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

Function keyValueMap

packages/cli/src/internal/options.ts:367–379  ·  view source on GitHub ↗
(
  option: string | Options.Options<string>
)

Source from the content-addressed store, hash-verified

365
366/** @internal */
367export const keyValueMap = (
368 option: string | Options.Options<string>
369): Options.Options<HashMap.HashMap<string, string>> => {
370 if (typeof option === "string") {
371 const single = makeSingle(option, Arr.empty(), InternalPrimitive.text)
372 return makeKeyValueMap(single as Single)
373 }
374 if (!isSingle(option as Instruction)) {
375 throw new Error("InvalidArgumentException: only single options can be key/value maps")
376 } else {
377 return makeKeyValueMap(option as Single)
378 }
379}
380
381/** @internal */
382export const none: Options.Options<void> = (() => {

Callers

nothing calls this directly

Calls 3

makeKeyValueMapFunction · 0.85
makeSingleFunction · 0.70
isSingleFunction · 0.70

Tested by

no test coverage detected