@staff0rd/assist 0.694.0 → 0.694.2

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
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.694.0",
9
+ version: "0.694.2",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -30782,10 +30782,18 @@ function matchNamedImports(importDecl, neededNames) {
30782
30782
  if (!neededNames.has(name)) continue;
30783
30783
  const original = specifier.getName();
30784
30784
  const alias = specifier.getAliasNode()?.getText();
30785
- matched.push(alias ? `${original} as ${alias}` : original);
30785
+ matched.push({
30786
+ text: alias ? `${original} as ${alias}` : original,
30787
+ isTypeOnly: specifier.isTypeOnly()
30788
+ });
30786
30789
  }
30787
30790
  return matched;
30788
30791
  }
30792
+ function formatNamedImports(matched, collapseToTypeOnly) {
30793
+ return matched.map(
30794
+ ({ text: text18, isTypeOnly }) => isTypeOnly && !collapseToTypeOnly ? `type ${text18}` : text18
30795
+ );
30796
+ }
30789
30797
  function matchOptionalImport(node, neededNames) {
30790
30798
  return node && neededNames.has(node.getText()) ? node.getText() : void 0;
30791
30799
  }
@@ -30802,12 +30810,13 @@ function matchImport(importDecl, neededNames) {
30802
30810
  if (namedImports.length === 0 && !defaultImport && !namespaceImport) {
30803
30811
  return void 0;
30804
30812
  }
30813
+ const allNamedTypeOnly = !defaultImport && !namespaceImport && namedImports.every((named) => named.isTypeOnly);
30805
30814
  return {
30806
30815
  moduleSpecifier: importDecl.getModuleSpecifierValue(),
30807
- namedImports,
30816
+ namedImports: formatNamedImports(namedImports, allNamedTypeOnly),
30808
30817
  defaultImport,
30809
30818
  namespaceImport,
30810
- isTypeOnly: importDecl.isTypeOnly()
30819
+ isTypeOnly: importDecl.isTypeOnly() || allNamedTypeOnly
30811
30820
  };
30812
30821
  }
30813
30822
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.694.0",
3
+ "version": "0.694.2",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {