@logbrew/sdk 0.1.24 → 0.1.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logbrew/sdk",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "description": "Public LogBrew JavaScript SDK for building, validating, and flushing event batches.",
5
5
  "type": "module",
6
6
  "main": "./index.cjs",
@@ -28,6 +28,7 @@ const DEBUG_ID_NAMESPACE = "16f4a837-7e0b-4d7c-97d9-8a7af1fd2768";
28
28
  const DEBUG_ID_RE = /(?:\/\/#|\/\*#)\s*debugId=([A-Za-z0-9._:-]+)/giu;
29
29
  const DEBUG_ID_REGISTRY_NAME = "logbrew.release-artifact.debug-ids";
30
30
  const DEBUG_ID_REGISTRY_EXPRESSION = `Symbol.for(${JSON.stringify(DEBUG_ID_REGISTRY_NAME)})`;
31
+ const HERMES_RUNTIME_DEBUG_ID_RE = /\/\*logbrew-runtime-debug-id\*\/\/\/# debugId=([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12})/iu;
31
32
  const RUNTIME_DEBUG_ID_MARKER = "/*logbrew-runtime-debug-id*/";
32
33
  const MINIFIED_SOURCE_SUFFIXES = [".js", ".mjs", ".bundle", ".jsbundle"];
33
34
  const SCRIPT_VERSION = "0.1.0";
@@ -104,7 +105,8 @@ function findLastMatch(source, regex) {
104
105
  }
105
106
 
106
107
  function findDebugId(source) {
107
- return findLastMatch(source, DEBUG_ID_RE);
108
+ const runtimeDebugId = source.match(HERMES_RUNTIME_DEBUG_ID_RE)?.[1];
109
+ return runtimeDebugId ?? findLastMatch(source, DEBUG_ID_RE);
108
110
  }
109
111
 
110
112
  function findSourceMappingUrl(source) {