Skip to content

Commit

Permalink
Remove ts param from utils
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Nov 26, 2022
1 parent cc94824 commit 61e01e9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/transformers/typescript-types/src/collect.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ export function collect(
currentModule.addExport('default', node.expression.text);
}

if (isDeclaration(ts, node)) {
if (isDeclaration(node)) {
if (node.name) {
currentModule.addLocal(node.name.text, node);
}

let name = getExportedName(ts, node);
let name = getExportedName(node);
if (name) {
currentModule.addLocal(name, node);
currentModule.addExport(name, name);
Expand Down
4 changes: 2 additions & 2 deletions packages/transformers/typescript-types/src/shake.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ export function shake(
}
}

if (isDeclaration(ts, node)) {
let name = getExportedName(ts, node) || node.name.text;
if (isDeclaration(node)) {
let name = getExportedName(node) || node.name.text;

// Remove unused declarations
if (!currentModule.used.has(name)) {
Expand Down
6 changes: 3 additions & 3 deletions packages/transformers/typescript-types/src/utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow
import typeof TypeScriptModule from 'typescript'; // eslint-disable-line import/no-extraneous-dependencies
import ts from 'typescript';

export function getExportedName(ts: TypeScriptModule, node: any): ?string {
export function getExportedName(node: any): ?string {
if (!node.modifiers) {
return null;
}
Expand All @@ -17,7 +17,7 @@ export function getExportedName(ts: TypeScriptModule, node: any): ?string {
return node.name.text;
}

export function isDeclaration(ts: TypeScriptModule, node: any): boolean {
export function isDeclaration(node: any): boolean {
return (
ts.isFunctionDeclaration(node) ||
ts.isClassDeclaration(node) ||
Expand Down

0 comments on commit 61e01e9

Please sign in to comment.