mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[phone] Add allowLandLine parameter from 2.4.0 (#39439)
This commit is contained in:
parent
f7f7463517
commit
092408150b
6
types/phone/index.d.ts
vendored
6
types/phone/index.d.ts
vendored
@ -1,7 +1,7 @@
|
||||
// Type definitions for phone 1.0.8
|
||||
// Type definitions for phone 2.4.0
|
||||
// Project: https://github.com/aftership/phone
|
||||
// Definitions by: Hagai Cohen <https://github.com/DxCx>
|
||||
// Definitions by: Hagai Cohen <https://github.com/DxCx>, Tim Brown <https://github.com/brimtown>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function phone(phoneNumber: string, countryCode?: string): Array<string>;
|
||||
declare function phone(phoneNumber: string, countryCode?: string, allowLandLine?: boolean): Array<string>;
|
||||
export = phone;
|
||||
|
||||
@ -4,6 +4,9 @@ phone('+852 6569-8900'); // return ['+85265698900', 'HKG']
|
||||
phone('(817) 569-8900'); // return ['+18175698900, 'USA']
|
||||
phone('(817) 569-8900', ''); // return ['+18175698900, 'USA']
|
||||
phone('(817) 569-8900', 'USA'); // return ['+18175698900', 'USA']
|
||||
phone('(555) 569-8900', 'USA'); // return [], as it is not a valid USA mobile phone number
|
||||
phone('(555) 569-8900', 'USA', false); // return [], as it is not a valid USA mobile phone number
|
||||
phone('(555) 569-8900', 'USA', true); // return ['+15555698900', 'USA'], as we passed `true` to `allowLandLine`
|
||||
phone('(817) 569-8900', 'HKG'); // return []
|
||||
phone('+1(817) 569-8900', 'HKG'); // return [], as it is not a valid HKG mobile phone number
|
||||
phone('+1(817) 569-8900', ''); // return ['+18175698900', 'USA']
|
||||
|
||||
Loading…
Reference in New Issue
Block a user