Skip to content

Commit

Permalink
fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedBaset committed Aug 5, 2024
1 parent c9372c6 commit 3abb3bd
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/utils/ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,26 +238,3 @@ function is<T extends TSESTree.AST_NODE_TYPES>(
): exp is Extract<TSESTree.Expression, { type: T }> {
return exp.type === type;
}

function callOrValue<T extends string>(func: T | (() => T)): T;
function callOrValue<T extends string, P>(
func: T | ((arg: P) => T),
param: P
): T;
function callOrValue<T extends string, P>(
func: T | ((arg: P) => T),
param?: P
): T {
return typeof func === "function" ? func(param!) : func;
}

function T(type: `${TSESTree.AST_NODE_TYPES}`) {
return type as TSESTree.AST_NODE_TYPES;
}

function is<T extends TSESTree.AST_NODE_TYPES>(
exp: TSESTree.Expression,
type: `${T}`
): exp is Extract<TSESTree.Expression, { type: T }> {
return exp.type === type;
}

0 comments on commit 3abb3bd

Please sign in to comment.