@blotoutio/providers-google-analytics-4-sdk 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.
package/index.cjs.js CHANGED
@@ -10,6 +10,40 @@ const upsert = (map, key, update, createDefault) => {
10
10
  return map.set(key, update(currentValue));
11
11
  };
12
12
 
13
+ const expand = (str) => str.split(',').flatMap((entry) => {
14
+ if (!entry.includes('-')) {
15
+ return entry;
16
+ }
17
+ const result = [];
18
+ const [start, end] = entry.split('-').map(Number);
19
+ for (let i = start; i <= end; i++) {
20
+ result.push(i.toString());
21
+ }
22
+ return result;
23
+ });
24
+ /**
25
+ * Exported from https://en.wikipedia.org/wiki/List_of_North_American_Numbering_Plan_area_codes
26
+ *
27
+ * In Dev Tools, select the `tbody` element containing the area codes and run the following code,
28
+ * replacing the emdash character with a simple endash:
29
+ *
30
+ * ```ts
31
+ * [...$0.querySelectorAll('td:first-child')]
32
+ * .filter(cell => cell.firstChild.nodeName != 'A')
33
+ * .map(cell => cell.textContent.trim()).join(',')
34
+ * ```
35
+ */
36
+ new Set([
37
+ ...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'),
38
+ ...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'),
39
+ ...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'),
40
+ ...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'),
41
+ ...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'),
42
+ ...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'),
43
+ ...expand('811,821,822,823-824,827,834,836,841-842,846,851,852-853,871,874-875,879,880-887,889,890-899'),
44
+ ...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'),
45
+ ]);
46
+
13
47
  // eslint-disable-next-line @nx/enforce-module-boundaries
14
48
  const initGA4 = (ID, executionContext) => {
15
49
  var _a;
@@ -299,7 +333,7 @@ const tag = ({ data, eventName, manifestVariables, eventId }) => {
299
333
  }
300
334
  return {
301
335
  loaded: isLoaded,
302
- sdkVersion: "0.43.0" ,
336
+ sdkVersion: "0.44.1" ,
303
337
  };
304
338
  };
305
339
 
package/index.js CHANGED
@@ -11,6 +11,40 @@ var ProvidersGoogleAnalytics4Sdk = (function () {
11
11
  return map.set(key, update(currentValue));
12
12
  };
13
13
 
14
+ const expand = (str) => str.split(',').flatMap((entry) => {
15
+ if (!entry.includes('-')) {
16
+ return entry;
17
+ }
18
+ const result = [];
19
+ const [start, end] = entry.split('-').map(Number);
20
+ for (let i = start; i <= end; i++) {
21
+ result.push(i.toString());
22
+ }
23
+ return result;
24
+ });
25
+ /**
26
+ * Exported from https://en.wikipedia.org/wiki/List_of_North_American_Numbering_Plan_area_codes
27
+ *
28
+ * In Dev Tools, select the `tbody` element containing the area codes and run the following code,
29
+ * replacing the emdash character with a simple endash:
30
+ *
31
+ * ```ts
32
+ * [...$0.querySelectorAll('td:first-child')]
33
+ * .filter(cell => cell.firstChild.nodeName != 'A')
34
+ * .map(cell => cell.textContent.trim()).join(',')
35
+ * ```
36
+ */
37
+ new Set([
38
+ ...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'),
39
+ ...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'),
40
+ ...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'),
41
+ ...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'),
42
+ ...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'),
43
+ ...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'),
44
+ ...expand('811,821,822,823-824,827,834,836,841-842,846,851,852-853,871,874-875,879,880-887,889,890-899'),
45
+ ...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'),
46
+ ]);
47
+
14
48
  // eslint-disable-next-line @nx/enforce-module-boundaries
15
49
  const initGA4 = (ID, executionContext) => {
16
50
  var _a;
@@ -300,7 +334,7 @@ var ProvidersGoogleAnalytics4Sdk = (function () {
300
334
  }
301
335
  return {
302
336
  loaded: isLoaded,
303
- sdkVersion: "0.43.0" ,
337
+ sdkVersion: "0.44.1" ,
304
338
  };
305
339
  };
306
340
 
package/index.mjs CHANGED
@@ -8,6 +8,40 @@ const upsert = (map, key, update, createDefault) => {
8
8
  return map.set(key, update(currentValue));
9
9
  };
10
10
 
11
+ const expand = (str) => str.split(',').flatMap((entry) => {
12
+ if (!entry.includes('-')) {
13
+ return entry;
14
+ }
15
+ const result = [];
16
+ const [start, end] = entry.split('-').map(Number);
17
+ for (let i = start; i <= end; i++) {
18
+ result.push(i.toString());
19
+ }
20
+ return result;
21
+ });
22
+ /**
23
+ * Exported from https://en.wikipedia.org/wiki/List_of_North_American_Numbering_Plan_area_codes
24
+ *
25
+ * In Dev Tools, select the `tbody` element containing the area codes and run the following code,
26
+ * replacing the emdash character with a simple endash:
27
+ *
28
+ * ```ts
29
+ * [...$0.querySelectorAll('td:first-child')]
30
+ * .filter(cell => cell.firstChild.nodeName != 'A')
31
+ * .map(cell => cell.textContent.trim()).join(',')
32
+ * ```
33
+ */
34
+ new Set([
35
+ ...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'),
36
+ ...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'),
37
+ ...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'),
38
+ ...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'),
39
+ ...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'),
40
+ ...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'),
41
+ ...expand('811,821,822,823-824,827,834,836,841-842,846,851,852-853,871,874-875,879,880-887,889,890-899'),
42
+ ...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'),
43
+ ]);
44
+
11
45
  // eslint-disable-next-line @nx/enforce-module-boundaries
12
46
  const initGA4 = (ID, executionContext) => {
13
47
  var _a;
@@ -297,7 +331,7 @@ const tag = ({ data, eventName, manifestVariables, eventId }) => {
297
331
  }
298
332
  return {
299
333
  loaded: isLoaded,
300
- sdkVersion: "0.43.0" ,
334
+ sdkVersion: "0.44.1" ,
301
335
  };
302
336
  };
303
337
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/providers-google-analytics-4-sdk",
3
- "version": "0.43.0",
3
+ "version": "0.44.1",
4
4
  "description": "Google Analytics 4 Browser SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",