Neighbor's Preppy Maltese

    joi-iban-extension

    1.0.0 • Public • Published

    Joi IBAN Extension

    A Joi extension for validation of Bank Account IBAN and BIC (SWIFT code)

    Installation

    npm install --save joi-iban-extension
    

    Usage

    const BaseJoi = require('joi')
    const JoiIbanExtension = require('joi-iban-extension')
    const Joi = BaseJoi.extend(JoiIbanExtension)
    
    const schema = Joi.string().iban()
    const result = await schema.validate('DE89 3704 0044 0532 0130 00')
    
    console.log(result) // DE89370400440532013000

    Strict mode

    Throws error if the string is not formatted precisely.

    const BaseJoi = require('joi')
    const JoiIbanExtension = require('joi-iban-extension')
    const Joi = BaseJoi.extend(JoiIbanExtension)
    
    const schema = Joi.string().iban({ strict: true })
    const result = await schema.validate('DE89 3704 0044 0532 0130 00') // Throws error

    Keywords

    none

    Install

    npm i joi-iban-extension

    DownloadsWeekly Downloads

    114

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    8.81 kB

    Total Files

    5

    Last publish

    Collaborators

    • g-wilson