@suss/adapter-typescript 0.22.4 → 0.23.0

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.js CHANGED
@@ -10280,6 +10280,7 @@ import {
10280
10280
 
10281
10281
  // src/shapes/typeShapes.ts
10282
10282
  import { createHash } from "crypto";
10283
+ import { TypeFormatFlags } from "ts-morph";
10283
10284
 
10284
10285
  // src/shapes/definitions.ts
10285
10286
  var current = null;
@@ -10441,7 +10442,7 @@ function typeToShape(type, ctx) {
10441
10442
  if (type.isEnum() || type.isEnumLiteral()) {
10442
10443
  return enumToShape(type, ctx);
10443
10444
  }
10444
- const text = type.getText(ctx.enclosing);
10445
+ const text = printedTypeName(type, ctx);
10445
10446
  if (text && text.length > 0 && text !== "__type") {
10446
10447
  return { type: "ref", name: text };
10447
10448
  }
@@ -10489,8 +10490,7 @@ function intersectionToShape(type, ctx) {
10489
10490
  if (nonRecords.length === 1 && records.length === 0) {
10490
10491
  return nonRecords[0];
10491
10492
  }
10492
- const text = type.getText(ctx.enclosing);
10493
- return { type: "ref", name: text };
10493
+ return { type: "ref", name: printedTypeName(type, ctx) };
10494
10494
  }
10495
10495
  function objectToShape(type, ctx) {
10496
10496
  const key = typeKey(type, ctx.enclosing);
@@ -10550,7 +10550,7 @@ function opaqueNamedRef(type, ctx) {
10550
10550
  if (!OPAQUE_NAMED_TYPES.has(name)) {
10551
10551
  return null;
10552
10552
  }
10553
- const text = type.getText(ctx.enclosing);
10553
+ const text = printedTypeName(type, ctx);
10554
10554
  return { type: "ref", name: text && text.length > 0 ? text : name };
10555
10555
  }
10556
10556
  function outsideProjectRef(type, ctx) {
@@ -10631,6 +10631,12 @@ function refFromType(type, ctx) {
10631
10631
  }
10632
10632
  return { type: "ref", name: withoutImportQualifiers(type.getText()) };
10633
10633
  }
10634
+ var PRINTED_NAME_FLAGS = TypeFormatFlags.UseAliasDefinedOutsideCurrentScope | TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.NoTruncation | TypeFormatFlags.WriteTypeArgumentsOfSignature;
10635
+ function printedTypeName(type, ctx) {
10636
+ return withoutImportQualifiers(
10637
+ type.getText(ctx.enclosing, PRINTED_NAME_FLAGS)
10638
+ );
10639
+ }
10634
10640
  var IMPORT_QUALIFIER = /import\("[^"]*"\)\./g;
10635
10641
  var withoutImportQualifiers = (text) => text.replace(IMPORT_QUALIFIER, "");
10636
10642
  function declaringFileOf(symbol) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suss/adapter-typescript",
3
- "version": "0.22.4",
3
+ "version": "0.23.0",
4
4
  "type": "module",
5
5
  "description": "Read a TypeScript or JavaScript codebase with suss and check what each handler returns against every caller, spec and template it can see.",
6
6
  "keywords": [
@@ -48,11 +48,11 @@
48
48
  "typecheck": "tsc --noEmit"
49
49
  },
50
50
  "dependencies": {
51
- "@suss/behavioral-ir": "0.22.4",
52
- "@suss/datalog": "0.22.4",
53
- "@suss/extractor": "0.22.4",
54
- "@suss/resolution": "0.22.4",
55
- "@suss/values": "0.22.4",
51
+ "@suss/behavioral-ir": "0.23.0",
52
+ "@suss/datalog": "0.23.0",
53
+ "@suss/extractor": "0.23.0",
54
+ "@suss/resolution": "0.23.0",
55
+ "@suss/values": "0.23.0",
56
56
  "graphql": "^16.8.0",
57
57
  "picomatch": "^4.0.4",
58
58
  "ts-morph": "^23.0.0",