Skip to content

Commit 3195e15

Browse files
authored
Merge pull request #17 from Igorbek/feature/remove-ts-is-kind
Remove `ts-is-kind` dependency and update TS peer dependency
2 parents 9adce11 + a207594 commit 3195e15

File tree

4 files changed

+54
-9
lines changed

4 files changed

+54
-9
lines changed

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@
1919
"runner": "ts-node ./src/runner.ts"
2020
},
2121
"typings": "dist/index.d.ts",
22-
"dependencies": {
23-
"ts-is-kind": "^1.0.0"
24-
},
2522
"peerDependencies": {
26-
"typescript": "^2.5.2"
23+
"typescript": "^2.5.2 || ^3.0"
2724
},
2825
"devDependencies": {
2926
"@types/jest": "^19.2.4",

src/createTransformer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
isVariableDeclaration,
77
isExportAssignment,
88
isTaggedTemplateExpression,
9-
} from 'ts-is-kind';
9+
} from './ts-is-kind';
1010

1111
import {Options} from './models/Options';
1212

src/ts-is-kind.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// The source code is kindly borrowed from `ts-is-kind` npm module.
2+
// Original repo: https://github.com/mohsen1/ts-is-kind by @mohsen1
3+
4+
import * as ts from 'typescript';
5+
6+
/**
7+
* Return true if node is `PropertyAccessExpression`
8+
* @param node A TypeScript node
9+
*/
10+
export function isPropertyAccessExpression(node: ts.Node): node is ts.PropertyAccessExpression {
11+
return node.kind === ts.SyntaxKind.PropertyAccessExpression;
12+
}
13+
14+
/**
15+
* Return true if node is `CallExpression`
16+
* @param node A TypeScript node
17+
*/
18+
export function isCallExpression(node: ts.Node): node is ts.CallExpression {
19+
return node.kind === ts.SyntaxKind.CallExpression;
20+
}
21+
22+
/**
23+
* Return true if node is `Identifier`
24+
* @param node A TypeScript node
25+
*/
26+
export function isIdentifier(node: ts.Node): node is ts.Identifier {
27+
return node.kind === ts.SyntaxKind.Identifier;
28+
}
29+
30+
/**
31+
* Return true if node is `VariableDeclaration`
32+
* @param node A TypeScript node
33+
*/
34+
export function isVariableDeclaration(node: ts.Node): node is ts.VariableDeclaration {
35+
return node.kind === ts.SyntaxKind.VariableDeclaration;
36+
}
37+
38+
/**
39+
* Return true if node is `ExportAssignment`
40+
* @param node A TypeScript node
41+
*/
42+
export function isExportAssignment(node: ts.Node): node is ts.ExportAssignment {
43+
return node.kind === ts.SyntaxKind.ExportAssignment;
44+
}
45+
46+
/**
47+
* Return true if node is `TaggedTemplateExpression`
48+
* @param node A TypeScript node
49+
*/
50+
export function isTaggedTemplateExpression(node: ts.Node): node is ts.TaggedTemplateExpression {
51+
return node.kind === ts.SyntaxKind.TaggedTemplateExpression;
52+
}

yarn.lock

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2209,10 +2209,6 @@ trim-right@^1.0.1:
22092209
version "1.0.1"
22102210
resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
22112211

2212-
ts-is-kind@^1.0.0:
2213-
version "1.0.0"
2214-
resolved "https://registry.yarnpkg.com/ts-is-kind/-/ts-is-kind-1.0.0.tgz#f9ca9c1af07ddb82d7a06744d8928952d4bd2426"
2215-
22162212
ts-jest@20:
22172213
version "20.0.6"
22182214
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-20.0.6.tgz#39c2810c05d6f6908dac15929dae206b494b73f4"

0 commit comments

Comments
 (0)