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

Function getTypeName

packages/effect/src/unstable/cli/Primitive.ts:953–984  ·  view source on GitHub ↗
(primitive: Primitive<A>)

Source from the content-addressed store, hash-verified

951 * @since 4.0.0
952 */
953export const getTypeName = <A>(primitive: Primitive<A>): string => {
954 switch (primitive._tag) {
955 case "Boolean":
956 return "boolean"
957 case "String":
958 return "string"
959 case "Integer":
960 return "integer"
961 case "Float":
962 return "number"
963 case "Date":
964 return "date"
965 case "Path":
966 return "path"
967 case "Choice":
968 return "choice"
969 case "Redacted":
970 return "string"
971 case "FileText":
972 return "file"
973 case "FileParse":
974 return "file"
975 case "FileSchema":
976 return "file"
977 case "KeyValuePair":
978 return "key=value"
979 case "None":
980 return "none"
981 default:
982 return "value"
983 }
984}
985
986/** @internal */
987export const getChoiceKeys = (primitive: Primitive<unknown>): ReadonlyArray<string> | undefined =>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected