@posthog/core 1.64.0 → 1.64.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.
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/error-tracking/parsers/node.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,eAAe,EAAE,MAAM,UAAU,CAAA;AAUpD,eAAO,MAAM,mBAAmB,EAAE,eAiFjC,CAAA"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/error-tracking/parsers/node.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,eAAe,EAAE,MAAM,UAAU,CAAA;AAWpD,eAAO,MAAM,mBAAmB,EAAE,eAiFjC,CAAA"}
@@ -32,7 +32,7 @@ __webpack_require__.d(__webpack_exports__, {
32
32
  });
33
33
  const external_base_js_namespaceObject = require("./base.js");
34
34
  const FILENAME_MATCH = /^\s*[-]{4,}$/;
35
- const FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
35
+ const FULL_MATCH = /at (?:async (?!\((?!.*\)\s+\()))?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
36
36
  const PROMISE_COMBINATOR = /^Promise\.(?:all|any)$/;
37
37
  const PROMISE_INDEX = /^index \d+$/;
38
38
  const PROMISE_FRAME_FILENAME = 'node:internal/promise';
@@ -1,6 +1,6 @@
1
1
  import { UNKNOWN_FUNCTION } from "./base.mjs";
2
2
  const FILENAME_MATCH = /^\s*[-]{4,}$/;
3
- const FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
3
+ const FULL_MATCH = /at (?:async (?!\((?!.*\)\s+\()))?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
4
4
  const PROMISE_COMBINATOR = /^Promise\.(?:all|any)$/;
5
5
  const PROMISE_INDEX = /^index \d+$/;
6
6
  const PROMISE_FRAME_FILENAME = 'node:internal/promise';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/core",
3
- "version": "1.64.0",
3
+ "version": "1.64.1",
4
4
  "bugs": {
5
5
  "url": "https://github.com/PostHog/posthog-js/issues"
6
6
  },
@@ -16,4 +16,19 @@ describe('nodeStackLineParser', () => {
16
16
  platform: 'node:javascript',
17
17
  })
18
18
  })
19
+
20
+ it.each([
21
+ ['at async (/app/server/api/handler.ts:91:27)', 'async'],
22
+ ['at async (work) (/app/server/api/handler.ts:91:27)', '(work)'],
23
+ ])('parses the function name and filename in %s', (line, functionName) => {
24
+ expect(nodeStackLineParser(line, 'node:javascript')).toEqual({
25
+ filename: '/app/server/api/handler.ts',
26
+ module: undefined,
27
+ function: functionName,
28
+ lineno: 91,
29
+ colno: 27,
30
+ in_app: true,
31
+ platform: 'node:javascript',
32
+ })
33
+ })
19
34
  })
@@ -7,7 +7,8 @@ import { UNKNOWN_FUNCTION } from './base'
7
7
 
8
8
  /** Node Stack line parser */
9
9
  const FILENAME_MATCH = /^\s*[-]{4,}$/
10
- const FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/
10
+ // `at async (file:1:2)` is a function named `async`; `at async (name) (file:1:2)` is an async frame.
11
+ const FULL_MATCH = /at (?:async (?!\((?!.*\)\s+\()))?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/
11
12
  const PROMISE_COMBINATOR = /^Promise\.(?:all|any)$/
12
13
  const PROMISE_INDEX = /^index \d+$/
13
14
  const PROMISE_FRAME_FILENAME = 'node:internal/promise'