@yext/phonenumber-util 0.2.9 → 0.2.11

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/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 22
package/CODEOWNERS CHANGED
@@ -1,2 +1,2 @@
1
1
  # The following aliases have approval permissions in this repo:
2
- * @imbrianj @mi4l @DerekWW
2
+ * @imbrianj @mi4l @DerekWW @jperezhearsay @Bearbar00008
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yext/phonenumber-util",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "author": "bajohnson@hearsaycorp.com",
5
5
  "license": "BSD-3-Clause",
6
6
  "description": "Utility for extracting and validating phone numbers",
@@ -25,16 +25,16 @@
25
25
  "make-badges": "istanbul-badges-readme"
26
26
  },
27
27
  "devDependencies": {
28
- "@eslint/js": "^9.27.0",
29
- "@vitest/coverage-v8": "^3.1.4",
30
- "eslint": "^9.27.0",
28
+ "@eslint/js": "^9.28.0",
29
+ "@vitest/coverage-v8": "^3.2.0",
30
+ "eslint": "^9.28.0",
31
31
  "generate-license-file": "4.0.0",
32
- "globals": "^16.1.0",
32
+ "globals": "^16.2.0",
33
33
  "husky": "^9.1.7",
34
34
  "istanbul-badges-readme": "^1.9.0",
35
- "lint-staged": "^16.0.0",
35
+ "lint-staged": "^16.1.0",
36
36
  "prettier": "^3.5.3",
37
- "vitest": "^3.1.4"
37
+ "vitest": "^3.2.0"
38
38
  },
39
39
  "eslintConfig": {},
40
40
  "lint-staged": {
package/src/base.d.ts CHANGED
@@ -26,12 +26,15 @@ export function sanitizeRawNumber(phoneNumber: string): string;
26
26
  export function findNumbersInString(text: string): Array<{
27
27
  index: number;
28
28
  lastIndex: number;
29
- phoneParts: PhoneParts;
30
- }>;
29
+ } & PhoneParts>;
31
30
 
32
- export function findPhoneFormat(regionCode: string): string;
31
+ export function findPhoneFormat(params: {
32
+ regionCode: string;
33
+ e164: string;
34
+ }): string;
33
35
 
34
36
  export function formatPhoneNumber(params: {
35
37
  format: string;
36
38
  e164: string;
39
+ regionCode: string;
37
40
  }): string | null;
package/src/geo.d.ts CHANGED
@@ -23,9 +23,18 @@ export function findTimeFromAreaCode(
23
23
  timezoneOffset: string | null;
24
24
  daylightSavings: boolean | null;
25
25
  stateHasMultipleTimezones: boolean | null;
26
- state: string | null;
26
+ state: { name: string; code: string } | null;
27
+ region?: { name: string; code: string; flag: string };
27
28
  areaCodeHasMultipleTimezones: boolean | null;
28
29
  estimatedTime: boolean;
30
+ localTime24Hour?: string;
31
+ localTimeReadable?: string;
32
+ isTCPAQuietHours?: boolean;
33
+ isCRTCQuietHours?: boolean;
34
+ isQuietHours?: boolean;
29
35
  };
30
36
 
31
- export function findRegionFromRegionCode(regionCode: string): string | undefined;
37
+ export function findRegionFromRegionCode(
38
+ regionCode: string | number,
39
+ areaCode?: string
40
+ ): { name: string; code: string; flag: string } | undefined;
package/src/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './base';
2
+ export * from './geo';