"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ts/types/PhoneNumber.ts" between
Signal-Desktop-1.35.2.tar.gz and Signal-Desktop-1.36.1.tar.gz

About: Signal-Desktop is a cross-platform encrypted messaging service (also available for mobile devices).

PhoneNumber.ts  (Signal-Desktop-1.35.2):PhoneNumber.ts  (Signal-Desktop-1.36.1)
skipping to change at line 25 skipping to change at line 25
if (ourRegionCode && regionCode === ourRegionCode) { if (ourRegionCode && regionCode === ourRegionCode) {
return instance.format(parsedNumber, PhoneNumberFormat.NATIONAL); return instance.format(parsedNumber, PhoneNumberFormat.NATIONAL);
} }
return instance.format(parsedNumber, PhoneNumberFormat.INTERNATIONAL); return instance.format(parsedNumber, PhoneNumberFormat.INTERNATIONAL);
} catch (error) { } catch (error) {
return phoneNumber; return phoneNumber;
} }
} }
export function isValidNumber(
phoneNumber: string,
options?: {
regionCode?: string;
}
): boolean {
const { regionCode } = options || { regionCode: undefined };
try {
const parsedNumber = instance.parse(phoneNumber, regionCode);
return instance.isValidNumber(parsedNumber);
} catch (error) {
return false;
}
}
export const format = memoizee(_format, { export const format = memoizee(_format, {
primitive: true, primitive: true,
// Convert the arguments to a unique string, required for primitive mode. // Convert the arguments to a unique string, required for primitive mode.
normalizer: (...args) => JSON.stringify(args), normalizer: (...args) => JSON.stringify(args),
max: 5000, max: 5000,
}); });
export function parse( export function parse(
phoneNumber: string, phoneNumber: string,
options: { options: {
 End of changes. 1 change blocks. 
0 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)