This version (v0.7) has not been published to npm yet.
Skip to content

Reference / @getenginex/sdk/extension / mapOf

mapOf() ​

mapOf<V>(value): ZodMiniPipe<ZodMiniOptional<ZodMiniNullable<ZodMiniRecord<ZodMiniString<string>, V>>>, ZodMiniTransform<Record<string, output<V>>, Record<string, output<V>> | null | undefined>>

Free-form map (keys are data, not fields): preserves the keys and replaces null/missing with {}. For SDK packages (via @getenginex/sdk/extension), not for apps.

Type Parameters ​

V ​

V extends ZodMiniType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>

Parameters ​

value ​

V

Returns ​

ZodMiniPipe<ZodMiniOptional<ZodMiniNullable<ZodMiniRecord<ZodMiniString<string>, V>>>, ZodMiniTransform<Record<string, output<V>>, Record<string, output<V>> | null | undefined>>

Example ​

ts
wire({ balances: mapOf(z.number()) }) // { BRL: 1000 } stays { BRL: 1000 }