Skip to content

Commit 35708a5

Browse files
committed
chore: remove google-libphonenumber dependency and associated types from package.json and package-lock.json
1 parent 4b4c619 commit 35708a5

File tree

3 files changed

+0
-36
lines changed

3 files changed

+0
-36
lines changed

package-lock.json

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
"@tippyjs/react": "^4.2.0",
4545
"@typeform/embed-react": "2.20.0",
4646
"@types/dompurify": "^3.0.5",
47-
"@types/google-libphonenumber": "^7.4.30",
4847
"@types/json-schema": "^7.0.15",
4948
"@types/react": "17.0.39",
5049
"@types/react-dom": "17.0.13",
@@ -116,7 +115,6 @@
116115
"dayjs": "^1.11.13",
117116
"fast-json-patch": "^3.1.1",
118117
"framer-motion": "^6.5.1",
119-
"google-libphonenumber": "^3.2.40",
120118
"jsonpath-plus": "^10.3.0",
121119
"marked": "^13.0.3",
122120
"nanoid": "^3.3.8",

src/Shared/validations.tsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,13 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { PhoneNumberUtil } from 'google-libphonenumber'
1817
import { getSanitizedIframe } from '@Common/Helper'
1918
import { customizeValidator } from '@rjsf/validator-ajv8'
2019
import { PATTERNS } from '@Common/Constants'
2120
import { parse } from 'yaml'
2221
import { URLProtocolType } from './types'
2322
import { SKIP_LABEL_KEY_VALIDATION_PREFIX } from './constants'
2423

25-
const phoneUtil = PhoneNumberUtil.getInstance()
26-
2724
export interface ValidationResponseType {
2825
isValid: boolean
2926
message?: string
@@ -498,18 +495,3 @@ export const validateYAML = (yamlString: string, isRequired?: boolean): Validati
498495
}
499496
}
500497
}
501-
502-
export const isPhoneValid = (phone: string): ValidationResponseType => {
503-
try {
504-
const isValid = phoneUtil.isValidNumber(phoneUtil.parseAndKeepRawInput(phone))
505-
return {
506-
isValid,
507-
message: isValid ? '' : 'Invalid phone number',
508-
}
509-
} catch (error) {
510-
return {
511-
isValid: false,
512-
message: error.message || 'Invalid phone number',
513-
}
514-
}
515-
}

0 commit comments

Comments
 (0)