-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from Igorbek/feature/remove-ts-is-kind
Remove `ts-is-kind` dependency and update TS peer dependency
- Loading branch information
Showing
4 changed files
with
54 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// The source code is kindly borrowed from `ts-is-kind` npm module. | ||
// Original repo: https://github.com/mohsen1/ts-is-kind by @mohsen1 | ||
|
||
import * as ts from 'typescript'; | ||
|
||
/** | ||
* Return true if node is `PropertyAccessExpression` | ||
* @param node A TypeScript node | ||
*/ | ||
export function isPropertyAccessExpression(node: ts.Node): node is ts.PropertyAccessExpression { | ||
return node.kind === ts.SyntaxKind.PropertyAccessExpression; | ||
} | ||
|
||
/** | ||
* Return true if node is `CallExpression` | ||
* @param node A TypeScript node | ||
*/ | ||
export function isCallExpression(node: ts.Node): node is ts.CallExpression { | ||
return node.kind === ts.SyntaxKind.CallExpression; | ||
} | ||
|
||
/** | ||
* Return true if node is `Identifier` | ||
* @param node A TypeScript node | ||
*/ | ||
export function isIdentifier(node: ts.Node): node is ts.Identifier { | ||
return node.kind === ts.SyntaxKind.Identifier; | ||
} | ||
|
||
/** | ||
* Return true if node is `VariableDeclaration` | ||
* @param node A TypeScript node | ||
*/ | ||
export function isVariableDeclaration(node: ts.Node): node is ts.VariableDeclaration { | ||
return node.kind === ts.SyntaxKind.VariableDeclaration; | ||
} | ||
|
||
/** | ||
* Return true if node is `ExportAssignment` | ||
* @param node A TypeScript node | ||
*/ | ||
export function isExportAssignment(node: ts.Node): node is ts.ExportAssignment { | ||
return node.kind === ts.SyntaxKind.ExportAssignment; | ||
} | ||
|
||
/** | ||
* Return true if node is `TaggedTemplateExpression` | ||
* @param node A TypeScript node | ||
*/ | ||
export function isTaggedTemplateExpression(node: ts.Node): node is ts.TaggedTemplateExpression { | ||
return node.kind === ts.SyntaxKind.TaggedTemplateExpression; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters