V
CARD_BRANDS
Every supported card brand. Resolve a number with findCardBrand.
Signature
ts
const CARD_BRANDS: readonly CardBrand[]Related Types
I
CardBrand
One payment-card brand.
ts
interface CardBrand| Property | Type | Default | Description |
|---|---|---|---|
brandreadonly | string | — | Brand id, e.g. 'visa'. |
namereadonly | string | — | Display name, e.g. 'Visa'. |
templatereadonly | string | — | Number template; # is a digit, e.g. '#### #### #### ####'. |
lengthsreadonly | readonly number[] | — | Valid total digit lengths, e.g. [16, 18, 19]. |
codereadonly | { readonly name: string; readonly size: number } | — | Security code metadata, e.g. { name: 'CVV', size: 3 }. |
patternsreadonly | readonly CardPattern[] | — | IIN/BIN detection patterns (prefixes and ranges). |
T
CardPattern
Payment-card brands: detection patterns (IIN/BIN prefixes and ranges), the
number template (# = a digit), valid total lengths, and the security-code
info. Derived from the MIT-licensed credit-card-type dataset (Braintree).
The template uses the brand's gap positions; the trailing group is sized to the
longest valid length, so shorter numbers simply leave it partly empty.
ts
export type CardPattern = string | readonly [min: number, max: number];