
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
zod-phone-number
Advanced tools
Zod Phone Number is validation schema for Zod.
$ npm i zod-phone-number
const { ZodPhoneNumber, RETURNING_FORMAT } = require('zod-phone-number');
const { data } = ZodPhoneNumber.phoneNumber({
returningFormat: RETURNING_FORMAT.NATIONAL,
}).safeParse('+2010 605 944 77'); // 010 60594488
const { data } = ZodPhoneNumber.phoneNumber({
returningFormat: RETURNING_FORMAT.INTERNATIONAL,
}).safeParse('+2010 605 944 88'); // +20 10 60594488
const { data } = ZodPhoneNumber.phoneNumber({
returningFormat: RETURNING_FORMAT.ORIGINAL,
}).safeParse('+2010 605 944 88'); // +2010 605 944 88
const { data } = ZodPhoneNumber.phoneNumber({
returningFormat: RETURNING_FORMAT.FORMATTED_VALUE,
}).safeParse('+2010 605 944 88'); // +201060594488
const { data } = ZodPhoneNumber.phoneNumber({
returningFormat: RETURNING_FORMAT.RFC3966,
}).safeParse('+2010 605 944 88'); // tel:+201060594488
const { data } = ZodPhoneNumber.phoneNumber({
returningFormat: RETURNING_FORMAT['E.164'],
}).safeParse('+2010 605 944 88'); // +201060594488
const { data } = ZodPhoneNumber.phoneNumber({
returningFormat: RETURNING_FORMAT.VALUE_WITH_EXTRA_INFO,
}).safeParse('+2010 605 944 88');
/*
output: {
countryCode: 'EG',
formattedNumber: '+201060594488',
nationalNumber: '1060594488',
originalValue: '+2010 605 944 88',
countryCallingCode: '20',
}
*/
To run the test suite, first install the dependencies then run npm test:
$ npm install
$ npm test
Feel free to open issues on github.
FAQs
Zod Phone Number is validation schema for Zod
The npm package zod-phone-number receives a total of 1 weekly downloads. As such, zod-phone-number popularity was classified as not popular.
We found that zod-phone-number demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.