Skip to content

Commit 65cfe4f

Browse files
author
Daniel Del Core
committed
Updates types for is decendantoftype
1 parent 85d1413 commit 65cfe4f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/gorgeous-cycles-hide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@codeshift/utils': patch
3+
---
4+
5+
Minor type update to isDecendantOfNode

packages/utils/src/nodes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export const isNodeOfType = <Expected extends ASTNode>(
2424
* const isDecendantOfImportSpecifier = isDecendantOfType(node, j.ImportSpecifier);
2525
* ```
2626
*/
27-
export const isDecendantOfType = (
27+
export const isDecendantOfType = <Node extends ASTNode>(
2828
j: core.JSCodeshift,
29-
source: ASTPath<any>,
29+
source: ASTPath<Node>,
3030
type: any,
3131
): boolean => {
3232
const closestNodes = j(source).closest(type);

0 commit comments

Comments
 (0)