MCPcopy
hub / github.com/prisma/prisma / isDecimalJsLike

Function isDecimalJsLike

packages/client/src/runtime/utils/decimalJsLike.ts:5–17  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

3import { DecimalJsLike } from '../core/types/exported/DecimalJsLike'
4
5export function isDecimalJsLike(value: unknown): value is DecimalJsLike {
6 if (Decimal.isDecimal(value)) {
7 return true
8 }
9 return (
10 value !== null &&
11 typeof value === 'object' &&
12 typeof value['s'] === 'number' &&
13 typeof value['e'] === 'number' &&
14 typeof value['toFixed'] === 'function' &&
15 Array.isArray(value['d'])
16 )
17}

Callers 4

deepCloneValueFunction · 0.90
buildInputValueFunction · 0.90
serializeArgumentsValueFunction · 0.90

Calls 1

isDecimalMethod · 0.80

Tested by

no test coverage detected