Skip to content

Commit 11385b5

Browse files
chore: wip
1 parent 48aae72 commit 11385b5

29 files changed

+152
-130
lines changed

src/lib/contains.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { ContainsOptions } from '../types'
12
import assertString from './util/assertString'
23
import merge from './util/merge'
34
import toString from './util/toString'
@@ -7,11 +8,6 @@ const defaultContainsOptions = {
78
minOccurrences: 1,
89
}
910

10-
interface ContainsOptions {
11-
ignoreCase: boolean
12-
minOccurrences: number
13-
}
14-
1511
/**
1612
* contains
1713
*

src/lib/isAfter.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1+
import type { IsAfterOptions } from './types'
12
import toDate from './toDate'
23

3-
export interface IsAfterOptions {
4-
comparisonDate?: string | number | Date
5-
}
6-
74
/**
85
* Check if the string is After
96
*

src/lib/isAlpha.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1+
import type { IsAlphaOptions } from './types'
12
import { alpha } from './alpha'
23
import assertString from './util/assertString'
34

4-
interface IsAlphaOptions {
5-
ignore?: string | RegExp
6-
}
7-
85
export default function isAlpha(_str, locale = 'en-US', options: IsAlphaOptions = {}) {
96
assertString(_str)
107

src/lib/isAlphanumeric.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { AlphanumericOptions, LocaleInstance } from '../types'
12
import assertString from './util/assertString'
23

34
// Common alphanumeric patterns for different locales
@@ -35,18 +36,11 @@ export const alphanumeric: Record<string, RegExp> = {
3536
'he': /^[0-9\u05D0-\u05EA]+$/,
3637
'hi-IN': /^[\u0900-\u0961\u0966-\u097F]+$/,
3738
// eslint-disable-next-line no-misleading-character-class
38-
'ur-PK': /^[\u0600-\u06FF\u0750-\u077F\u0590-\u05FF\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF\u0900-\u097F\u0980-\u09FF\u0A00-\u0A7F\u0A80-\u0AFF\u0B00-\u0B7F\u0B80-\u0BFF\u0C00-\u0C7F\u0C80-\u0CFF\u0D00-\u0D7F\u0D80-\u0DFF\u0E00-\u0E7F\u0E80-\u0EFF\u0F00-\u0FFF\u1000-\u109F\u10A0-\u10FF\u1100-\u11FF\u1200-\u137F\u1380-\u139F\u13A0-\u13FF\u1400-\u167F\u1680-\u169F\u16A0-\u16FF\u1700-\u171F\u1720-\u173F\u1740-\u175F\u1760-\u177F\u1780-\u17FF\u1800-\u18AF\u1900-\u194F\u1950-\u197F\u1980-\u19DF\u19E0-\u19FF\u1A00-\u1A1F\u1B00-\u1B7F\u1D00-\u1D7F\u1D80-\u1DBF\u1DC0-\u1DFF\u1E00-\u1EFF\u1F00-\u1FFF\u20D0-\u20FF\u2100-\u214F\u2C00-\u2C5F\u2C60-\u2C7F\u2C80-\u2CFF\u2D00-\u2D2F\u2D30-\u2D7F\u2D80-\u2DDF\u2F00-\u2FDF\u3040-\u309F\u30A0-\u30FF\u3100-\u312F\u3130-\u318F\u31A0-\u31BF\u31F0-\u31FF\u3200-\u32FF\u3300-\u33FF\u3400-\u4DBF\u4DC0-\u4DFF\u4E00-\u9FFF\uA000-\uA48F\uA490-\uA4CF\uA500-\uA63F\uA640-\uA69F\uA6A0-\uA6FF\uA700-\uA71F\uA720-\uA7FF\uA800-\uA82F\uA840-\uA87F\uA880-\uA8DF\uA900-\uA92F\uA930-\uA95F\uA960-\uA97F\uA980-\uA9DF\uAA00-\uAA5F\uAA60-\uAA7F\uAA80-\uAADF\uAB00-\uAB2F\uABC0-\uABFF\uAC00-\uD7AF\uD800-\uFA2F\uFA30-\uFA6F\uFA70-\uFADF\uFB00-\uFB4F\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]+$/
39+
'ur-PK': /^[\u0600-\u06FF\u0750-\u077F\u0590-\u05FF\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF\u0900-\u097F\u0980-\u09FF\u0A00-\u0A7F\u0A80-\u0AFF\u0B00-\u0B7F\u0B80-\u0BFF\u0C00-\u0C7F\u0C80-\u0CFF\u0D00-\u0D7F\u0D80-\u0DFF\u0E00-\u0E7F\u0E80-\u0EFF\u0F00-\u0FFF\u1000-\u109F\u10A0-\u10FF\u1100-\u11FF\u1200-\u137F\u1380-\u139F\u13A0-\u13FF\u1400-\u167F\u1680-\u169F\u16A0-\u16FF\u1700-\u171F\u1720-\u173F\u1740-\u175F\u1760-\u177F\u1780-\u17FF\u1800-\u18AF\u1900-\u194F\u1950-\u197F\u1980-\u19DF\u19E0-\u19FF\u1A00-\u1A1F\u1B00-\u1B7F\u1D00-\u1D7F\u1D80-\u1DBF\u1DC0-\u1DFF\u1E00-\u1EFF\u1F00-\u1FFF\u20D0-\u20FF\u2100-\u214F\u2C00-\u2C5F\u2C60-\u2C7F\u2C80-\u2CFF\u2D00-\u2D2F\u2D30-\u2D7F\u2D80-\u2DDF\u2F00-\u2FDF\u3040-\u309F\u30A0-\u30FF\u3100-\u312F\u3130-\u318F\u31A0-\u31BF\u31F0-\u31FF\u3200-\u32FF\u3300-\u33FF\u3400-\u4DBF\u4DC0-\u4DFF\u4E00-\u9FFF\uA000-\uA48F\uA490-\uA4CF\uA500-\uA63F\uA640-\uA69F\uA6A0-\uA6FF\uA700-\uA71F\uA720-\uA7FF\uA800-\uA82F\uA840-\uA87F\uA880-\uA8DF\uA900-\uA92F\uA930-\uA95F\uA960-\uA97F\uA980-\uA9DF\uAA00-\uAA5F\uAA60-\uAA7F\uAA80-\uAADF\uAB00-\uAB2F\uABC0-\uABFF\uAC00-\uD7AF\uD800-\uFA2F\uFA30-\uFA6F\uFA70-\uFADF\uFB00-\uFB4F\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]+$/,
3940
} as const
4041

41-
type LocaleInstance = keyof typeof alphanumeric
42-
4342
export const locales = Object.keys(alphanumeric) as LocaleInstance[]
4443

45-
export interface AlphanumericOptions {
46-
ignore?: string | RegExp
47-
locale?: LocaleInstance
48-
}
49-
5044
/**
5145
* Check if the string contains only alphanumeric characters (letters and numbers).
5246
*

src/lib/isBase32.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1+
import type { IsBase32Options } from '../types'
12
import assertString from './util/assertString'
23
import merge from './util/merge'
34

4-
export interface IsBase32Options {
5-
crockford?: boolean | string
6-
}
7-
85
const base32 = /^[A-Z2-7]+=*$/
96
const crockfordBase32 = /^[A-HJKMNP-TV-Z0-9]+$/
107

src/lib/isBase64.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1+
import type { IsBase64Options } from '../types'
12
import assertString from './util/assertString'
23
import merge from './util/merge'
34

4-
export interface IsBase64Options {
5-
urlSafe?: boolean | string
6-
padding?: boolean | string
7-
}
8-
95
const base64WithPadding = /^(?:[A-Z0-9+/]{4})*(?:[A-Z0-9+/]{2}==|[A-Z0-9+/]{3}=|[A-Z0-9+/]{4})$/i
106
const base64WithoutPadding = /^[A-Z0-9+/]+$/i
117
const base64UrlWithPadding = /^(?:[\w-]{4})*(?:[\w-]{2}==|[\w-]{3}=|[\w-]{4})$/

src/lib/isBefore.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1+
import type { IsBeforeOptions } from '../types'
12
import toDate from './toDate'
23

3-
export interface IsBeforeOptions {
4-
comparisonDate?: string | number | Date
5-
}
6-
74
/**
85
* Check if the string is Before
96
*

src/lib/isBoolean.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1+
import type { IsBooleanOptions } from '../types'
12
import assertString from './util/assertString'
23
import includes from './util/includesArray'
34

4-
export interface IsBooleanOptions {
5-
loose?: boolean
6-
}
7-
85
const defaultOptions: IsBooleanOptions = { loose: false }
96
const strictBooleans = ['true', 'false', '1', '0']
107
const looseBooleans = [...strictBooleans, 'yes', 'no']

src/lib/isByteLength.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1+
import type { IsByteLengthOptions } from '../types'
12
import assertString from './util/assertString'
23

3-
export interface IsByteLengthOptions {
4-
min?: number
5-
max?: number
6-
}
7-
84
/* eslint-disable prefer-rest-params */
95
/**
106
* Check if the string is ByteLength

src/lib/isCreditCard.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { CreditCardOptions } from '../types'
12
import isLuhnValid from './isLuhnNumber'
23
import assertString from './util/assertString'
34

@@ -22,10 +23,6 @@ const allCards = (() => {
2223
return tmpCardsArray
2324
})()
2425

25-
interface CreditCardOptions {
26-
provider?: string
27-
}
28-
2926
/**
3027
* Check if the string is CreditCard
3128
*

0 commit comments

Comments
 (0)