New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@teleturbis/js-validator

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@teleturbis/js-validator

This is a simple Validator, to check Strings for valid Characters. Also you can check an Email and an IBAN. Read more: https://www.npmjs.com/package/@teleturbis/js-validator

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

License npm-Version TypeScript Buildversion Test

js-validator

This is a simple Validator, to check Strings for valid Characters. Also you can check an Email and an IBAN.

How to

Install the Package with npm i @teleturbis/js-validator

Then import the needed Functions into your File, for example: import { iban } from '@teleturbis/js-validator'

IBAN

Currently we support IBAN-Validation only for DE, CH, ES, NL and AT.

To check an IBAN you have to import the iban-function like that: import { isValidIban } from '@teleturbis/js-validator'

Now you can check the IBAN: isValidIban(iban)

This Function returns an Object. If the IBAN is Valid, the Object will look something like that:

KeyTypeValue if ValidValue if invalid
isValidBOOLEANtruefalse
messageSTRINGIban validated'Iban format invalid' or 'Iban length invalid for [COUNTRY]' or 'BLZ invalid for [COUNTRY]'
bankInformationObjectBankinformation depending on Countryundefined

All IBANs will be checked for valid length & valid check digit. You can read about that here. As addition IBANs for DE & AT will also be checked for valid bank code numbers. There are possibilities for deleted bank code numbers, but those will also be checked.

Currently we support Bankinformations only for DE and AT.

** Bankinformation for DE - Example **
Bankleitzahl: '67450048',
Merkmal: 1,
Bezeichnung: 'Sparkasse Neckartal-Odenwald',
PLZ: '74819',
Ort: 'Mosbach',
Kurzbezeichnung: 'Spk Neckartal-Odenwald',
PAN: '56716',
BIC: 'SOLADES1MOS',
'Prüfziffer-berechnungs-methode': '00',
'Datensatz-nummer': '000820',
'Änderungs-kennzeichen': 'U',
'Bankleitzahl-löschung': 0,
'Nachfolge-Bankleitzahl': '00000000'


 ** Bankinformation for AT - Example **
Kennzeichen: 'Hauptanstalt',
Identnummer: 7780729,
Bankleitzahl: 20111,
Institutsart: 'KI',
Sektor: 'Sparkassen',
Firmenbuchnummer: '286283f',
Bankenname: 'Erste Bank der oesterreichischen Sparkassen AG',
'Straße': 'Am Belvedere 1',
PLZ: 1100,
Ort: 'Wien',
Bundesland: 'Wien',
Telefon: '050100/10100',
Fax: '050100/910100',
'E-Mail': 'service@s-servicecenter.at',
'SWIFT-Code': 'GIBAATWWXXX',
Homepage: 'www.erstebank.at',
'Gründungsdatum': '11/08/2006',
LEI: '549300HUKIA1IZQHFZ83'

In future, there will come more Countries.

Email

To check an Email you have to import the isValidMail-function like that: import { isValidMail} from '@teleturbis/js-validator'

Now you can check the IBAN: isValidMail(mail)

This Function returns an Object:

KeyTypeValue if ValidValue if invalid
isValidBOOLEANtruefalse
messageSTRING'Email is valid!''Email is invalid!'
String-Checks

Each of the following Functions can take an Object as second Argument. This will then look like that: isNumeric('123 456', { space: true }) If space is true, spaces inside the String are Valid (e.g. "123 456" & "123456" are valid), else spaces are forbidden (e.g. "123 456" will return false while "123456" will be true).

FunctionExampleOptionsReturnAllowed Chars
isNumericisNumeric('12.3'){ space: BOOLEAN }BOOLEAN0-9
isAlphabetisAlphabet("Anton"){ space: BOOLEAN }BOOLEANA-Z & a-z
isAlphaNumericisAlphaNumeric("Anton12.3"){ space: BOOLEAN }BOOLEANA-Z & a-z & 0-9
isAlphaPunctuationisAlphaNumeric("Anton&Michael"){ space: BOOLEAN }BOOLEANA-Z & a-z & .,;:&%$§"!?()'`´-
isAlphaNumericPunctuationisAlphaNumeric("Anton&Michael12.3"){ space: BOOLEAN }BOOLEANA-Z & a-z & 0-9 & .,;:&%$§"!?()'`´-

Keywords

FAQs

Package last updated on 15 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc