@blotoutio/edgetag-sdk-browser 0.43.0 → 0.44.1

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.
Files changed (2) hide show
  1. package/index.js +35 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -365,7 +365,7 @@
365
365
  referrer: getReferrer(),
366
366
  search: getSearch(),
367
367
  locale: getLocale(),
368
- sdkVersion: "0.43.0" ,
368
+ sdkVersion: "0.44.1" ,
369
369
  ...(payload || {}),
370
370
  };
371
371
  let storage = {};
@@ -534,6 +534,40 @@
534
534
  return map.set(key, update(currentValue));
535
535
  };
536
536
 
537
+ const expand = (str) => str.split(',').flatMap((entry) => {
538
+ if (!entry.includes('-')) {
539
+ return entry;
540
+ }
541
+ const result = [];
542
+ const [start, end] = entry.split('-').map(Number);
543
+ for (let i = start; i <= end; i++) {
544
+ result.push(i.toString());
545
+ }
546
+ return result;
547
+ });
548
+ /**
549
+ * Exported from https://en.wikipedia.org/wiki/List_of_North_American_Numbering_Plan_area_codes
550
+ *
551
+ * In Dev Tools, select the `tbody` element containing the area codes and run the following code,
552
+ * replacing the emdash character with a simple endash:
553
+ *
554
+ * ```ts
555
+ * [...$0.querySelectorAll('td:first-child')]
556
+ * .filter(cell => cell.firstChild.nodeName != 'A')
557
+ * .map(cell => cell.textContent.trim()).join(',')
558
+ * ```
559
+ */
560
+ new Set([
561
+ ...expand('200,211,221,222,230,232,233,235,237-238,241,243,244,245,247,255,257,258-259,261,265,266,271,273,274,275,277,278,280,282,283,285-287,288,290-299'),
562
+ ...expand('300,311,322,324,327,328,333,335,338,342,344,348-349,353,355,356,357-359,362,366,369,370-379,381,382,383-384,387,388,389,390-399'),
563
+ ...expand('400,411,420,421-422,426-427,428,429,433,439,444,446,449,451-454,455,456,457,459,460,461-462,465,466,467,471,476,477,481-483,485-486,487,488,489,490-499'),
564
+ ...expand('511,532,535,536,537,538,542-543,545-547,549-550,552-554,555,556,558,560,565,568,569,576,578,583,589,590-599'),
565
+ ...expand('611,621,624,625,627,632,633,634-635,637-638,642-643,644,648,652-654,655,663,665,666,668,673-676,677,679,685,686,687,688,690-699'),
566
+ ...expand('711,722,723,729,733,735-736,739,741,744,745-746,748,749-751,752,755,756,759,761,764,766,768,776,777,783,788,789,790-799'),
567
+ ...expand('811,821,822,823-824,827,834,836,841-842,846,851,852-853,871,874-875,879,880-887,889,890-899'),
568
+ ...expand('911,921,922,923,924,926,927,932,933,935,942,944,946,950,953,955,957-958,960-969,974,975,976,977,981-982,987,988,990-999'),
569
+ ]);
570
+
537
571
  let initialized = false;
538
572
  const providersPackages = {};
539
573
  const setPreferences = (preferences) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/edgetag-sdk-browser",
3
- "version": "0.43.0",
3
+ "version": "0.44.1",
4
4
  "description": "Browser SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",