Zod Phone Number
Zod Phone Number is validation schema for Zod.

Installation
$ npm i zod-phone-number
Usage
const { data } = ZodPhoneNumber.phoneNumber({
returningFormat: RETURNING_FORMAT.NATIONAL,
}).safeParse('+2010 605 944 77');
const { data } = ZodPhoneNumber.phoneNumber({
returningFormat: RETURNING_FORMAT.INTERNATIONAL,
}).safeParse('+2010 605 944 88');
const { data } = ZodPhoneNumber.phoneNumber({
returningFormat: RETURNING_FORMAT.ORIGINAL,
}).safeParse('+2010 605 944 88');
const { data } = ZodPhoneNumber.phoneNumber({
returningFormat: RETURNING_FORMAT.FORMATTED_VALUE,
}).safeParse('+2010 605 944 88');
const { data } = ZodPhoneNumber.phoneNumber({
returningFormat: RETURNING_FORMAT.RFC3966,
}).safeParse('+2010 605 944 88');
const { data } = ZodPhoneNumber.phoneNumber({
returningFormat: RETURNING_FORMAT['E.164'],
}).safeParse('+2010 605 944 88');
const { data } = ZodPhoneNumber.phoneNumber({
returningFormat: RETURNING_FORMAT.VALUE__WITH_EXTRA_INFO,
}).safeParse('+2010 605 944 88');
Tests
To run the test suite, first install the dependencies then run npm test:
$ npm install
$ npm test
Support
Feel free to open issues on github.