npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@konfirm/is-sepa

v1.0.3

Published

Determine whether a country is part of SEPA (Single Euro Payments Area)

Downloads

3

Readme

is-sepa

Determine whether an iso3166 region code or an iso13616 IBAN country code is part of SEPA (Single Euro Payments Area).

Installation

The is-sepa package is a scoped package, which means one needs to provide the scope (both in installation and use).

$ npm install --save @konfirm/is-sepa

Usage

isSEPA

The package exposes a function which will provide a boolean value on whether the supplied iso3166 regions code(s) and/or provided iso13616 (IBAN) code(s) are present in SEPA.

const isSEPA = require('@konfirm/is-sepa');

console.log(isSEPA('NL')); //  true
console.log(isSEPA('US')); //  false

If multiple iso3166/iso13616 codes are provided, the validation will return true only if all codes are part of SEPA.

const isSEPA = require('@konfirm/is-sepa');

console.log(isSEPA('NL', 'BE', 'LU')); //  true
console.log(isSEPA('NL', 'BE', 'LU', 'US')); //  false

match

As part of the isSEPA function, a match method is provided, which will return the requested SEPA Region object.

const isSEPA = require('@konfirm/is-sepa');
const match = isSEPA.match('GB'); //  returns the RegionGB object, representing the United Kingdom

This also works for subdivision matching

const isSEPA = require('@konfirm/is-sepa');
const match = isSEPA.match('JE'); //  returns the RegionJE object, representing Jersey (a subdivision of the United Kingdom)

SEPARegion

The SEPARegion object consists of the following structure

| member | type | description | | -------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------- | | iso3166 | string | the iso3166 region code | | iso13616 | string | the iso13616 IBAN code (this may be different from the iso3166 code) | | regions | [SEPARegion] | subdivisions, if any | | since | Date | the date on which SEPA was first available in the region | | Symbol.match | function | Allow for use as String.match argument, returning the appropriate SEPA Region if it matches (this includes subdivisions) |

SEPARegion matching example
//
const { GB } = require('@konfirm/is-sepa');
const match = 'IM'.match(GB); // returns the RegionIM object, representing the Isle of Man

The result is no different from using match on the isSEPA module.

exported regions

The 36 SEPA regions are exported directly, any subdivision participating in SEPA is available using matching are provided by the containing regions.

The table below summarizes which iso3166 codes are available on the is-sepa module and can be used directly.

const { FR } = require('@konfirm/is-sepa');

| iso3166 | country | includes | | ------- | ------------------ | ------------------------------ | | AD | Andorra | | | AT | Austria | | | BE | Belgium | | | BG | Bulgaria | | | CH | Switzerland | | | CY | Cyprus | | | CZ | Czech Republic | | | DE | Germany | | | DK | Denmark | | | EE | Estonia | | | ES | Spain | (Canary Islands) | | FI | Finland | AX | | FR | France | BL, GF, GP, MF, MQ, PM, RE, YT | | GB | United Kingdom | GG, GI, IM, JE | | GR | Greece | | | HR | Croatia | | | HU | Hungary | | | IE | Ireland | | | IS | Iceland | | | IT | Italy | | | LI | Liechtenstein | | | LT | Lithuania | | | LU | Luxembourg | | | LV | Latvia | | | MC | Monaco | | | MT | Malta | | | NL | Netherlands | | | NO | Norway | | | PL | Poland | | | PT | Portugal | (Azores, Madeira) | | RO | Romania | | | SE | Sweden | | | SI | Slovenia | | | SK | Slovakia | | | SM | San Marino | | | VA | Vatican City State | |

The full subdivision names indicate they are explicitly mentioned in the SEPA documentation, but do not provide an iso3166 code of their own

The subdivision SEPARegion objects can only be accessed through their containing regions, or through match

| iso3166 | country | included by | | ------- | -------------------------- | ----------- | | AX | Åland Islands | FI | | BL | Saint Barthélemy | FR | | GF | French Guiana | FR | | GG | Guernsey | GB | | GI | Gibraltar | GB | | GP | Guadeloupe | FR | | IM | Isle of Man | GB | | JE | Jersey | GB | | MF | Saint Martin (French part) | FR | | MQ | Martinique | FR | | PM | Saint Pierre and Miquelon | FR | | RE | Réunion | FR | | YT | Mayotte | FR |

License

MIT License Copyright (c) 2019 Rogier Spieker (Konfirm)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.