@suss/adapter-typescript 0.5.6 → 0.5.8

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/index.cjs CHANGED
@@ -2405,12 +2405,13 @@ function dispatchAccessRecognizers(root, recognizers, isStop) {
2405
2405
  }
2406
2406
  const out = [];
2407
2407
  const sourceFile = root.getSourceFile();
2408
+ const seenEffects = /* @__PURE__ */ new Set();
2408
2409
  root.forEachDescendant((node, traversal) => {
2409
2410
  if (isStop(node)) {
2410
2411
  traversal.skip();
2411
2412
  return;
2412
2413
  }
2413
- if (!import_ts_morph12.Node.isPropertyAccessExpression(node)) {
2414
+ if (!import_ts_morph12.Node.isPropertyAccessExpression(node) && !import_ts_morph12.Node.isCallExpression(node)) {
2414
2415
  return;
2415
2416
  }
2416
2417
  const ctx = {
@@ -2435,6 +2436,11 @@ function dispatchAccessRecognizers(root, recognizers, isStop) {
2435
2436
  continue;
2436
2437
  }
2437
2438
  for (const eff of emitted) {
2439
+ const key = `${line}:${JSON.stringify(eff)}`;
2440
+ if (seenEffects.has(key)) {
2441
+ continue;
2442
+ }
2443
+ seenEffects.add(key);
2438
2444
  out.push({ effect: eff, line });
2439
2445
  }
2440
2446
  }
@@ -4576,6 +4582,7 @@ function tryMatchThrowExpression(node, pattern, match) {
4576
4582
  body,
4577
4583
  exceptionType,
4578
4584
  message,
4585
+ ...pattern.producesResponse === true ? { producesResponse: true } : {},
4579
4586
  component: null,
4580
4587
  delegateTarget: null,
4581
4588
  emitEvent: null,
package/dist/index.js CHANGED
@@ -2375,12 +2375,13 @@ function dispatchAccessRecognizers(root, recognizers, isStop) {
2375
2375
  }
2376
2376
  const out = [];
2377
2377
  const sourceFile = root.getSourceFile();
2378
+ const seenEffects = /* @__PURE__ */ new Set();
2378
2379
  root.forEachDescendant((node, traversal) => {
2379
2380
  if (isStop(node)) {
2380
2381
  traversal.skip();
2381
2382
  return;
2382
2383
  }
2383
- if (!Node11.isPropertyAccessExpression(node)) {
2384
+ if (!Node11.isPropertyAccessExpression(node) && !Node11.isCallExpression(node)) {
2384
2385
  return;
2385
2386
  }
2386
2387
  const ctx = {
@@ -2405,6 +2406,11 @@ function dispatchAccessRecognizers(root, recognizers, isStop) {
2405
2406
  continue;
2406
2407
  }
2407
2408
  for (const eff of emitted) {
2409
+ const key = `${line}:${JSON.stringify(eff)}`;
2410
+ if (seenEffects.has(key)) {
2411
+ continue;
2412
+ }
2413
+ seenEffects.add(key);
2408
2414
  out.push({ effect: eff, line });
2409
2415
  }
2410
2416
  }
@@ -4553,6 +4559,7 @@ function tryMatchThrowExpression(node, pattern, match) {
4553
4559
  body,
4554
4560
  exceptionType,
4555
4561
  message,
4562
+ ...pattern.producesResponse === true ? { producesResponse: true } : {},
4556
4563
  component: null,
4557
4564
  delegateTarget: null,
4558
4565
  emitEvent: null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suss/adapter-typescript",
3
- "version": "0.5.6",
3
+ "version": "0.5.8",
4
4
  "type": "module",
5
5
  "description": "TypeScript adapter for suss — walks source files with ts-morph and emits raw extractions for the suss pipeline.",
6
6
  "keywords": [
@@ -46,10 +46,10 @@
46
46
  "typecheck": "tsc --noEmit"
47
47
  },
48
48
  "dependencies": {
49
- "@suss/behavioral-ir": "0.5.6",
50
- "@suss/datalog": "0.5.6",
51
- "@suss/extractor": "0.5.6",
52
- "@suss/resolution": "0.5.6",
49
+ "@suss/behavioral-ir": "0.5.8",
50
+ "@suss/datalog": "0.5.8",
51
+ "@suss/extractor": "0.5.8",
52
+ "@suss/resolution": "0.5.8",
53
53
  "graphql": "^16.8.0",
54
54
  "picomatch": "^4.0.4",
55
55
  "ts-morph": "^23.0.0"