@posthog/browser-common 0.8.2 → 0.8.3

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/dist/config.js CHANGED
@@ -27,7 +27,7 @@ var __webpack_require__ = {};
27
27
  })();
28
28
  var __webpack_exports__ = {};
29
29
  __webpack_require__.r(__webpack_exports__);
30
- const packageVersion = "0.8.2";
30
+ const packageVersion = "0.8.3";
31
31
  const Config = {
32
32
  DEBUG: false,
33
33
  LIB_VERSION: packageVersion,
package/dist/config.mjs CHANGED
@@ -1,4 +1,4 @@
1
- const packageVersion = "0.8.2";
1
+ const packageVersion = "0.8.3";
2
2
  const Config = {
3
3
  DEBUG: false,
4
4
  LIB_VERSION: packageVersion,
@@ -1,4 +1,5 @@
1
1
  import type { PostHogConfig, Properties } from '@posthog/types';
2
+ export { trySafe } from '@posthog/core';
2
3
  export declare function find<T>(value: T[], predicate: (value: T) => boolean): T | undefined;
3
4
  export declare function eachArray<E = any>(obj: E[] | null | undefined, iterator: (value: E, key: number) => void): void;
4
5
  export declare function each(obj: any, iterator: (value: any, key: any) => void): void;
@@ -8,7 +9,6 @@ export declare const extend: (obj: Record<string, any>, ...args: Record<string,
8
9
  * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries
9
10
  */
10
11
  export declare function entries<T = any>(obj: Record<string, T>): [string, T][];
11
- export declare const trySafe: <T>(fn: () => T) => T | undefined;
12
12
  export declare const safewrap: <F extends (...args: any[]) => any = (...args: any[]) => any>(f: F) => F;
13
13
  export declare const safewrapClass: (klass: Function, functions: string[]) => void;
14
14
  export declare const stripEmptyProperties: (p: Properties) => Properties;
@@ -42,7 +42,7 @@ __webpack_require__.d(__webpack_exports__, {
42
42
  safewrap: ()=>safewrap,
43
43
  safewrapClass: ()=>safewrapClass,
44
44
  stripEmptyProperties: ()=>stripEmptyProperties,
45
- trySafe: ()=>trySafe
45
+ trySafe: ()=>core_namespaceObject.trySafe
46
46
  });
47
47
  const core_namespaceObject = require("@posthog/core");
48
48
  const external_logger_js_namespaceObject = require("./logger.js");
@@ -72,13 +72,6 @@ function entries(obj) {
72
72
  ];
73
73
  return resArray;
74
74
  }
75
- const trySafe = function(fn) {
76
- try {
77
- return fn();
78
- } catch {
79
- return;
80
- }
81
- };
82
75
  const safewrap = function(f) {
83
76
  return function(...args) {
84
77
  try {
@@ -1,4 +1,4 @@
1
- import { hasOwnProperty as core_hasOwnProperty, isArray, isError, isFormData, isNullish, isNumber, isString } from "@posthog/core";
1
+ import { hasOwnProperty as core_hasOwnProperty, isArray, isError, isFormData, isNullish, isNumber, isString, trySafe } from "@posthog/core";
2
2
  import { logger } from "./logger.mjs";
3
3
  function find(value, predicate) {
4
4
  for(let i = 0; i < value.length; i++)if (predicate(value[i])) return value[i];
@@ -26,13 +26,6 @@ function entries(obj) {
26
26
  ];
27
27
  return resArray;
28
28
  }
29
- const trySafe = function(fn) {
30
- try {
31
- return fn();
32
- } catch {
33
- return;
34
- }
35
- };
36
29
  const safewrap = function(f) {
37
30
  return function(...args) {
38
31
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/browser-common",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "Internal shared browser utilities and extension primitives for PostHog Browser SDKs",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -73,8 +73,8 @@
73
73
  }
74
74
  },
75
75
  "dependencies": {
76
- "@posthog/core": "^1.51.0",
77
- "@posthog/types": "^1.409.1"
76
+ "@posthog/types": "^1.411.1",
77
+ "@posthog/core": "^1.53.2"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@rslib/core": "0.23.2",
@@ -90,7 +90,7 @@
90
90
  "build": "rslib build",
91
91
  "dev": "rslib build -w",
92
92
  "test:unit": "vitest run",
93
- "check-types": "pnpm build",
93
+ "check-types": "tsc --noEmit --project tsconfig.build.json",
94
94
  "package": "pnpm pack --out $PACKAGE_DEST/%s.tgz"
95
95
  }
96
96
  }