All Projects → kiwi-josh → NZ-Bank-Account-Validator

kiwi-josh / NZ-Bank-Account-Validator

Licence: MIT License
A small, zero dependency NZ bank account validation library that runs everywhere.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to NZ-Bank-Account-Validator

ird-nz
Checksum validator for New Zealand's IRD/GST number.
Stars: ✭ 15 (+0%)
Mutual labels:  validator, ird
verum-php
Server-Side Validation Library for PHP
Stars: ✭ 17 (+13.33%)
Mutual labels:  validation, validator
validation
Aplus Framework Validation Library
Stars: ✭ 99 (+560%)
Mutual labels:  validation, validator
Validation
The power of Respect Validation on Laravel
Stars: ✭ 188 (+1153.33%)
Mutual labels:  validation, validator
datalize
Parameter, query, form data validation and filtering for NodeJS.
Stars: ✭ 55 (+266.67%)
Mutual labels:  validation, validator
Validot
Validot is a performance-first, compact library for advanced model validation. Using a simple declarative fluent interface, it efficiently handles classes, structs, nested members, collections, nullables, plus any relation or combination of them. It also supports translations, custom logic extensions with tests, and DI containers.
Stars: ✭ 198 (+1220%)
Mutual labels:  validation, validator
openui5-validator
A library to validate OpenUI5 fields
Stars: ✭ 17 (+13.33%)
Mutual labels:  validation, validator
Ozzo Validation
An idiomatic Go (golang) validation package. Supports configurable and extensible validation rules (validators) using normal language constructs instead of error-prone struct tags.
Stars: ✭ 2,471 (+16373.33%)
Mutual labels:  validation, validator
filter
Go语言的数据过滤包,由 数据输入、格式化、校验、输出 几个部份组成。
Stars: ✭ 22 (+46.67%)
Mutual labels:  validation, validator
pyvaru
Rule based data validation library for python 3.
Stars: ✭ 17 (+13.33%)
Mutual labels:  validation, validator
We Validator
💯 简单灵活的表单验证插件,支持小程序、浏览器以及Nodejs端使用
Stars: ✭ 180 (+1100%)
Mutual labels:  validation, validator
dockerfile-utils
A library and command line interface for formatting and linting Dockerfiles.
Stars: ✭ 17 (+13.33%)
Mutual labels:  validation, validator
Validator
The Validator component provides tools to validate values following the JSR-303 Bean Validation specification.
Stars: ✭ 2,238 (+14820%)
Mutual labels:  validation, validator
Validr
A simple, fast, extensible python library for data validation.
Stars: ✭ 205 (+1266.67%)
Mutual labels:  validation, validator
Joiful
TypeScript Declarative Validation for Joi
Stars: ✭ 177 (+1080%)
Mutual labels:  validation, validator
node-input-validator
Validation library for node.js
Stars: ✭ 74 (+393.33%)
Mutual labels:  validation, validator
Validation Composite
Allows uniting of several validation rules into single one for easy re-usage
Stars: ✭ 159 (+960%)
Mutual labels:  validation, validator
Schema Utils
Options Validation
Stars: ✭ 162 (+980%)
Mutual labels:  validation, validator
Maat
Validation and transformation library powered by deductive ascending parser. Made to be extended for any kind of project.
Stars: ✭ 27 (+80%)
Mutual labels:  validation, validator
python-valid8
Yet another validation lib ;). Provides tools for general-purpose variable validation, function inputs/outputs validation as well as class fields validation. All entry points raise consistent ValidationError including all contextual details, with dynamic inheritance of ValueError/TypeError as appropriate.
Stars: ✭ 24 (+60%)
Mutual labels:  validation, validator

NZ Bank Account Validator

v0.0.4 - A small, zero dependency Javascript NZ bank account validation library that runs everywhere.

It is based on the documentation provided by the Inland Revenue Department. This library is not however affiliated with or endorsed by the IRD.

Getting Started

Using npm:

$ npm i --save nz-bank-account-validator

Using yarn:

$ yarn add nz-bank-account-validator

Installation

In a browser: (See examples/browser.html for code example)

<script type="text/javascript" src="NZ-Bank-Account-Validator.min.js"></script>
<script type="text/javascript">
  var bankAccountValidator = window['NZ-Bank-Account-Validator'];

  bankAccountValidator.validate('01-902-0068389-00');
</script>

In Node.js (require):

const bankValidator = require('nz-bank-account-validator/lib/NZ-Bank-Account-Validator');

bankValidator.validate('01-902-0068389-00');
// => true

ES6 Modules:

import bankValidator from 'nz-bank-account-validator/lib/NZ-Bank-Account-Validator';

bankValidator.validate('01-902-0068389-00');
// => true

Usage

const bankValidator = require('nz-bank-account-validator/lib/NZ-Bank-Account-Validator');

bankValidator.getId('01-902-0068389-00'); // '01'
bankValidator.getBranch('01-902-0068389-00'); // '02'
bankValidator.getBase('01-902-0068389-00'); // '0068389'
bankValidator.getSuffix('01-902-0068389-00'); // '00'

bankValidator.getPartsObject('01-902-0068389-00'); // { id: '01', branch: '902', base: '0068389', suffix: '00' }

bankValidator.validate('01-902-0068389-00') // true
bankValidator.validate({ id: '01', branch: '902', base: '0068389', suffix: '00' }) // true

bankValidator.validate('01-902-XXXXX-00') // false
bankValidator.validate('01-902--00') // false
bankValidator.validate('01-902-123456-00') // false

Running the tests

To run the tests locally:

npm i
npm run tests

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

References

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].