From c452de5a74f59ef986018915938dedf079780466 Mon Sep 17 00:00:00 2001 From: dhershman1 Date: Tue, 15 Oct 2024 00:07:08 -0400 Subject: [PATCH] Updated: Deprecated isValid --- src/isValid.js | 13 ++----------- types/index.d.cts | 1 + types/index.d.ts | 1 + 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/isValid.js b/src/isValid.js index 97dfb39..f0a3b0a 100644 --- a/src/isValid.js +++ b/src/isValid.js @@ -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 @@ -39,6 +29,7 @@ function longNumberTest (phone) { /** * @name isValid + * @deprecated Use isValidWithFormat instead * @since v0.1.0 * @function * @category Function @@ -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 } diff --git a/types/index.d.cts b/types/index.d.cts index f8c0536..fb40921 100644 --- a/types/index.d.cts +++ b/types/index.d.cts @@ -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 diff --git a/types/index.d.ts b/types/index.d.ts index 7d66433..32d89a4 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -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