Skip to content

Commit

Permalink
Updated: Deprecated isValid
Browse files Browse the repository at this point in the history
  • Loading branch information
dhershman1 committed Oct 15, 2024
1 parent 8609a47 commit c452de5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/isValid.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
import breakdown from './breakdown.js'
import uglify from './uglify.js'

/**
* @private
* @function
* @param {String} x The value to check if it is empty
* @returns {Boolean} Whether or not the value is empty
*/
function isEmpty (x) {
return x === ''
}

/**
* @private
* @function
Expand Down Expand Up @@ -39,6 +29,7 @@ function longNumberTest (phone) {

/**
* @name isValid
* @deprecated Use isValidWithFormat instead
* @since v0.1.0
* @function
* @category Function
Expand All @@ -56,7 +47,7 @@ export default function isValid (phone) {
const uglyPhone = uglify(phone)
const len = uglyPhone.length

if (isEmpty(uglyPhone) || len < 7) {
if (len < 7) {
return false
}

Expand Down
1 change: 1 addition & 0 deletions types/index.d.cts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ declare namespace phoneFns {

/**
* Validates the base number, does not take the country code or extension into consideration for this validation
* @deprecated Use isValidWithFormat instead
*/
isValid(phone: string): boolean

Expand Down
1 change: 1 addition & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ declare namespace phoneFns {

/**
* Validates the base number, does not take the country code or extension into consideration for this validation
* @deprecated Use isValidWithFormat instead
*/
isValid(phone: string): boolean

Expand Down

0 comments on commit c452de5

Please sign in to comment.