@opendevtools/rescript-clearingnummer

1.1.1 • Public • Published

Clearingnummer

npm (scoped)

Sort codes, clearingnummer in Swedish, are four or five digit identifiers for Swedish banks. This package helps you find the bank related to a specific number. All clearing numbers are taken from Wikipedia and Swedish Bankers Association.

This is a semi-port of my JavaScript library Clearingnummer written completely in Reason.

Installation

npm install @opendevtools/rescript-clearingnummer

Add @opendevtools/rescript-clearingnummer to bs-dependencies in bsconfig.json

Modules

BankName

fromInt

Takes a clearing number as int. This is the most common format.

(* int => string *)
let bankName = Clearingnummer.BankName.fromInt(5202)
(* bankName = "SEB" *)

fromString

Used by Swedbank and their old bank names (sparbanker)

(* string => string *)
let bankName = Clearingnummer.BankName.fromString("8060-6")
(* bankName = "Swedbank" *)

Banks

all

(* array(string) *)
let banks = Clearingnummer.Banks.all
(* banks = ["Amfa Bank", "Avanza Bank", ...] *)

Tests

Build JavaScript files first using npm run build or npm run start

$ npm test

Package Sidebar

Install

npm i @opendevtools/rescript-clearingnummer

Weekly Downloads

0

Version

1.1.1

License

MIT

Unpacked Size

23.6 kB

Total Files

14

Last publish

Collaborators

  • dubbelnisse
  • believer