@sinch/functions-runtime 0.5.7 → 0.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -10
- package/dist/bin/sinch-runtime.js +1 -1
- package/dist/{chunk-DEFB2NIH.js → chunk-LU5JRQ64.js} +2588 -286
- package/dist/chunk-LU5JRQ64.js.map +1 -0
- package/dist/index.d.ts +10 -6
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-DEFB2NIH.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -2436,16 +2436,20 @@ export declare function getProtectionMode(config?: Record<string, unknown>): Web
|
|
|
2436
2436
|
*/
|
|
2437
2437
|
export declare function createSecurityOptions(config?: Record<string, unknown>): SecurityOptions;
|
|
2438
2438
|
/**
|
|
2439
|
-
* Converts
|
|
2439
|
+
* Converts a phone number to local/national format.
|
|
2440
2440
|
*
|
|
2441
|
-
*
|
|
2442
|
-
*
|
|
2443
|
-
*
|
|
2441
|
+
* Numbers without a country code are parsed as belonging to `defaultRegion`,
|
|
2442
|
+
* which matches the behaviour of the C# runtime's `VoiceHelpers`.
|
|
2443
|
+
*
|
|
2444
|
+
* @param phoneNumber - The phone number, E.164 (e.g., "+15551234567") or national (e.g., "5551234567")
|
|
2445
|
+
* @param defaultRegion - ISO 3166-1 alpha-2 region used to parse numbers without a country code (default: "US")
|
|
2446
|
+
* @returns The phone number in national format, or the original if it cannot be parsed
|
|
2444
2447
|
*
|
|
2445
2448
|
* @example
|
|
2446
2449
|
* ```typescript
|
|
2447
|
-
* toLocalPhoneNumber('+15551234567');
|
|
2448
|
-
* toLocalPhoneNumber('+442071234567');
|
|
2450
|
+
* toLocalPhoneNumber('+15551234567'); // Returns "(555) 123-4567"
|
|
2451
|
+
* toLocalPhoneNumber('+442071234567'); // Returns "020 7123 4567"
|
|
2452
|
+
* toLocalPhoneNumber('0701234567', 'SE'); // Returns "070-123 45 67"
|
|
2449
2453
|
* ```
|
|
2450
2454
|
*/
|
|
2451
2455
|
export declare function toLocalPhoneNumber(phoneNumber: string, defaultRegion?: string): string;
|
package/dist/index.js
CHANGED