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

Function transformValue

packages/effect/src/sql/Statement.ts:1302–1312  ·  view source on GitHub ↗
(value: any)

Source from the content-addressed store, hash-verified

1300 nested = true
1301) => {
1302 const transformValue = (value: any) => {
1303 if (Array.isArray(value)) {
1304 if (value.length === 0 || value[0]?.constructor !== Object) {
1305 return value
1306 }
1307 return array(value)
1308 } else if (value?.constructor === Object) {
1309 return transformObject(value)
1310 }
1311 return value
1312 }
1313
1314 const transformObject = (obj: Record<string, any>): any => {
1315 const newObj: Record<string, any> = {}

Callers 4

onCustomFunction · 0.85
onCustomFunction · 0.85
transformObjectFunction · 0.85
transformArrayNestedFunction · 0.85

Calls 2

transformObjectFunction · 0.85
arrayFunction · 0.50

Tested by

no test coverage detected