Skip to content

Commit 7e2aa16

Browse files
committed
fix: remove isLuhn
1 parent 9be5e50 commit 7e2aa16

File tree

4 files changed

+0
-49
lines changed

4 files changed

+0
-49
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ Validator | Description
135135
**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`).
136136
**isLocale(str)** | check if the string is a locale
137137
**isLowercase(str)** | check if the string is lowercase.
138-
**isLuhn(str)** | check if the string is a valid [Luhn](https://en.wikipedia.org/wiki/Luhn_algorithm).
139138
**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'.
140139
**isMagnetURI(str)** | check if the string is a [magnet uri format](https://en.wikipedia.org/wiki/Magnet_URI_scheme).
141140
**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).

src/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import isAlphanumeric, { locales as isAlphanumericLocales } from './lib/isAlphan
2222
import isNumeric from './lib/isNumeric';
2323
import isPassportNumber from './lib/isPassportNumber';
2424
import isPort from './lib/isPort';
25-
import isLuhn from './lib/isLuhn';
2625
import isLowercase from './lib/isLowercase';
2726
import isUppercase from './lib/isUppercase';
2827

@@ -149,7 +148,6 @@ const validator = {
149148
isPassportNumber,
150149
isPort,
151150
isLowercase,
152-
isLuhn,
153151
isUppercase,
154152
isAscii,
155153
isFullWidth,

src/lib/isLuhn.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

test/validators.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3156,29 +3156,6 @@ describe('Validators', () => {
31563156
});
31573157
});
31583158

3159-
it('should validate is luhn', () => {
3160-
test({
3161-
validator: 'isLuhn',
3162-
valid: [
3163-
'6037991199520440',
3164-
'5022291047705718',
3165-
'50-22-2910 47705-718',
3166-
],
3167-
invalid: [
3168-
'foo',
3169-
'-',
3170-
' ',
3171-
'foo',
3172-
'375556917985515999999923',
3173-
'899999996234917882863852',
3174-
'prefix6234917882863855',
3175-
'623491788middle2863855',
3176-
'6234917882863855suffix',
3177-
'4716989580001715213',
3178-
],
3179-
});
3180-
});
3181-
31823159
it('should validate lowercase strings', () => {
31833160
test({
31843161
validator: 'isLowercase',

0 commit comments

Comments
 (0)