Skip to content

Commit

Permalink
fix: remove isLuhn
Browse files Browse the repository at this point in the history
  • Loading branch information
mhf-ir committed Mar 17, 2021
1 parent 9be5e50 commit 7e2aa16
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 49 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ Validator | Description
**isLicensePlate(str [, locale])** | check if string matches the format of a country's license plate.<br/><br/>(locale is one of `['de-DE', 'de-LI', 'pt-PT', 'sq-AL', 'pt-BR'']` or `any`).
**isLocale(str)** | check if the string is a locale
**isLowercase(str)** | check if the string is lowercase.
**isLuhn(str)** | check if the string is a valid [Luhn](https://en.wikipedia.org/wiki/Luhn_algorithm).
**isMACAddress(str)** | check if the string is a MAC address.<br/><br/>`options` is an object which defaults to `{no_separators: false}`. If `no_separators` is true, the validator will allow MAC addresses without separators. Also, it allows the use of hyphens, spaces or dots e.g '01 02 03 04 05 ab', '01-02-03-04-05-ab' or '0102.0304.05ab'.
**isMagnetURI(str)** | check if the string is a [magnet uri format](https://en.wikipedia.org/wiki/Magnet_URI_scheme).
**isMD5(str)** | check if the string is a MD5 hash.<br/><br/>Please note that you can also use the `isHash(str, 'md5')` function. Keep in mind that MD5 has some collision weaknesses compared to other algorithms (e.g., SHA).
Expand Down
2 changes: 0 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import isAlphanumeric, { locales as isAlphanumericLocales } from './lib/isAlphan
import isNumeric from './lib/isNumeric';
import isPassportNumber from './lib/isPassportNumber';
import isPort from './lib/isPort';
import isLuhn from './lib/isLuhn';
import isLowercase from './lib/isLowercase';
import isUppercase from './lib/isUppercase';

Expand Down Expand Up @@ -149,7 +148,6 @@ const validator = {
isPassportNumber,
isPort,
isLowercase,
isLuhn,
isUppercase,
isAscii,
isFullWidth,
Expand Down
23 changes: 0 additions & 23 deletions src/lib/isLuhn.js

This file was deleted.

23 changes: 0 additions & 23 deletions test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -3156,29 +3156,6 @@ describe('Validators', () => {
});
});

it('should validate is luhn', () => {
test({
validator: 'isLuhn',
valid: [
'6037991199520440',
'5022291047705718',
'50-22-2910 47705-718',
],
invalid: [
'foo',
'-',
' ',
'foo',
'375556917985515999999923',
'899999996234917882863852',
'prefix6234917882863855',
'623491788middle2863855',
'6234917882863855suffix',
'4716989580001715213',
],
});
});

it('should validate lowercase strings', () => {
test({
validator: 'isLowercase',
Expand Down

0 comments on commit 7e2aa16

Please sign in to comment.