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

Function primitiveKind

packages/effect/src/unstable/sql/Statement.ts:1103–1128  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

1101 * @since 4.0.0
1102 */
1103export const primitiveKind = (value: unknown): PrimitiveKind => {
1104 switch (typeof value) {
1105 case "string":
1106 return "string"
1107 case "number":
1108 return "number"
1109 case "boolean":
1110 return "boolean"
1111 case "bigint":
1112 return "bigint"
1113 case "undefined":
1114 return "null"
1115 }
1116
1117 if (value === null) {
1118 return "null"
1119 } else if (value instanceof Date) {
1120 return "Date"
1121 } else if (value instanceof Uint8Array) {
1122 return "Uint8Array"
1123 } else if (value instanceof Int8Array) {
1124 return "Int8Array"
1125 }
1126
1127 return "string"
1128}
1129
1130/**
1131 * Builds value, object, and row-array transformers that rename object keys with

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected