@514labs/moose-lib 0.6.262 → 0.6.263

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.
@@ -387,8 +387,35 @@ function getSourceFileInfo(stack) {
387
387
  }
388
388
  return {};
389
389
  }
390
+ function getSourceLocationFromStack(stack) {
391
+ if (!stack) return void 0;
392
+ const lines = stack.split("\n");
393
+ for (const line of lines.slice(1)) {
394
+ if (shouldSkipStackLine(line)) {
395
+ continue;
396
+ }
397
+ const v8Match = line.match(/at\s+(?:.*?\s+\()?(.+):(\d+):(\d+)\)?/);
398
+ if (v8Match) {
399
+ return {
400
+ file: v8Match[1],
401
+ line: parseInt(v8Match[2], 10),
402
+ column: parseInt(v8Match[3], 10)
403
+ };
404
+ }
405
+ const smMatch = line.match(/(?:.*@)?(.+):(\d+):(\d+)/);
406
+ if (smMatch) {
407
+ return {
408
+ file: smMatch[1],
409
+ line: parseInt(smMatch[2], 10),
410
+ column: parseInt(smMatch[3], 10)
411
+ };
412
+ }
413
+ }
414
+ return void 0;
415
+ }
390
416
  function getSourceFileFromStack(stack) {
391
- return getSourceFileInfo(stack).file;
417
+ const location = getSourceLocationFromStack(stack);
418
+ return location?.file;
392
419
  }
393
420
 
394
421
  // src/dmv2/typedBase.ts
@@ -2296,6 +2323,10 @@ var SqlResource = class {
2296
2323
  pushesDataTo;
2297
2324
  /** @internal Source file path where this resource was defined */
2298
2325
  sourceFile;
2326
+ /** @internal Source line number where this resource was defined */
2327
+ sourceLine;
2328
+ /** @internal Source column number where this resource was defined */
2329
+ sourceColumn;
2299
2330
  /**
2300
2331
  * Creates a new SqlResource instance.
2301
2332
  * @param name The name of the resource.
@@ -2321,7 +2352,12 @@ var SqlResource = class {
2321
2352
  this.pullsDataFrom = options?.pullsDataFrom ?? [];
2322
2353
  this.pushesDataTo = options?.pushesDataTo ?? [];
2323
2354
  const stack = new Error().stack;
2324
- this.sourceFile = getSourceFileFromStack(stack);
2355
+ const location = getSourceLocationFromStack(stack);
2356
+ if (location) {
2357
+ this.sourceFile = location.file;
2358
+ this.sourceLine = location.line;
2359
+ this.sourceColumn = location.column;
2360
+ }
2325
2361
  }
2326
2362
  };
2327
2363