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

Reference / @getenginex/sdk/extension / currencyCode

currencyCode() ​

currencyCode(options?): ZodMiniType<string>

ISO 4217 currency code in uppercase (BRL); with { allowEmpty: true }, also ''. Strict even in 'warn' mode. For SDK packages (via @getenginex/sdk/extension), not for apps.

Parameters ​

options? ​

CurrencyCodeOptions = {}

Returns ​

ZodMiniType<string>

Example ​

ts
wire({ currency: currencyCode() }) // 'brl' or '' reject the response
wire({ currency: z._default(currencyCode({ allowEmpty: true }), '') }) // '' and missing become ''

Throws ​

Nothing: the schema does not throw; the failure becomes VALIDATION_ERROR in the transport.