@posthog/browser-common 0.9.3 → 0.9.5

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.
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, getters, values)=>{
5
+ var define = (defs, kind)=>{
6
+ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
+ enumerable: true,
8
+ [kind]: defs[key]
9
+ });
10
+ };
11
+ define(getters, "get");
12
+ define(values, "value");
13
+ };
14
+ })();
15
+ (()=>{
16
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
17
+ })();
18
+ (()=>{
19
+ __webpack_require__.r = (exports1)=>{
20
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
21
+ value: 'Module'
22
+ });
23
+ Object.defineProperty(exports1, '__esModule', {
24
+ value: true
25
+ });
26
+ };
27
+ })();
28
+ var __webpack_exports__ = {};
29
+ __webpack_require__.r(__webpack_exports__);
30
+ function sanitizeUrl(url, options) {
31
+ try {
32
+ const result = new URL(String(url));
33
+ result.username = '';
34
+ result.password = '';
35
+ if (false === options.path) {
36
+ result.pathname = '/';
37
+ if ('/' !== result.pathname) return;
38
+ }
39
+ if (!options.search) result.search = '';
40
+ if (!options.hash) result.hash = '';
41
+ return result.toString();
42
+ } catch {
43
+ return;
44
+ }
45
+ }
46
+ __webpack_require__.d(__webpack_exports__, {
47
+ sanitizeUrl: ()=>sanitizeUrl
48
+ });
49
+ exports.sanitizeUrl = __webpack_exports__.sanitizeUrl;
50
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
51
+ "sanitizeUrl"
52
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
53
+ Object.defineProperty(exports, '__esModule', {
54
+ value: true
55
+ });
@@ -0,0 +1,17 @@
1
+ function sanitizeUrl(url, options) {
2
+ try {
3
+ const result = new URL(String(url));
4
+ result.username = '';
5
+ result.password = '';
6
+ if (false === options.path) {
7
+ result.pathname = '/';
8
+ if ('/' !== result.pathname) return;
9
+ }
10
+ if (!options.search) result.search = '';
11
+ if (!options.hash) result.hash = '';
12
+ return result.toString();
13
+ } catch {
14
+ return;
15
+ }
16
+ }
17
+ export { sanitizeUrl };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/browser-common",
3
- "version": "0.9.3",
3
+ "version": "0.9.5",
4
4
  "description": "Internal shared browser utilities and extension primitives for PostHog Browser SDKs",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -29,6 +29,9 @@
29
29
  "constants": [
30
30
  "dist/constants.d.ts"
31
31
  ],
32
+ "extension-tokens": [
33
+ "dist/extension-tokens.d.ts"
34
+ ],
32
35
  "extension-runtime": [
33
36
  "dist/extension-runtime.d.ts"
34
37
  ],
@@ -43,6 +46,18 @@
43
46
  ],
44
47
  "feature-flags-config": [
45
48
  "dist/feature-flags-config.d.ts"
49
+ ],
50
+ "logs": [
51
+ "dist/logs.d.ts"
52
+ ],
53
+ "logs-types": [
54
+ "dist/logs-types.d.ts"
55
+ ],
56
+ "logs-config": [
57
+ "dist/logs-config.d.ts"
58
+ ],
59
+ "console-logs": [
60
+ "dist/console-logs.d.ts"
46
61
  ]
47
62
  }
48
63
  },
@@ -62,6 +77,11 @@
62
77
  "require": "./dist/constants.js",
63
78
  "import": "./dist/constants.mjs"
64
79
  },
80
+ "./extension-tokens": {
81
+ "types": "./dist/extension-tokens.d.ts",
82
+ "require": "./dist/extension-tokens.js",
83
+ "import": "./dist/extension-tokens.mjs"
84
+ },
65
85
  "./extension-runtime": {
66
86
  "types": "./dist/extension-runtime.d.ts",
67
87
  "require": "./dist/extension-runtime.js",
@@ -86,11 +106,31 @@
86
106
  "types": "./dist/feature-flags-config.d.ts",
87
107
  "require": "./dist/feature-flags-config.js",
88
108
  "import": "./dist/feature-flags-config.mjs"
109
+ },
110
+ "./logs": {
111
+ "types": "./dist/logs.d.ts",
112
+ "require": "./dist/logs.js",
113
+ "import": "./dist/logs.mjs"
114
+ },
115
+ "./logs-types": {
116
+ "types": "./dist/logs-types.d.ts",
117
+ "require": "./dist/logs-types.js",
118
+ "import": "./dist/logs-types.mjs"
119
+ },
120
+ "./logs-config": {
121
+ "types": "./dist/logs-config.d.ts",
122
+ "require": "./dist/logs-config.js",
123
+ "import": "./dist/logs-config.mjs"
124
+ },
125
+ "./console-logs": {
126
+ "types": "./dist/console-logs.d.ts",
127
+ "import": "./dist/console-logs.mjs",
128
+ "require": "./dist/console-logs.js"
89
129
  }
90
130
  },
91
131
  "dependencies": {
92
- "@posthog/core": "^1.57.3",
93
- "@posthog/types": "^1.415.2"
132
+ "@posthog/core": "^1.59.1",
133
+ "@posthog/types": "^1.416.0"
94
134
  },
95
135
  "devDependencies": {
96
136
  "@rslib/core": "0.23.2",