Skip to content

Commit 93d6a47

Browse files
committed
feature: @putout/operator-keyword: class, extends, declare, mode, type
1 parent ea84c24 commit 93d6a47

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

packages/operator-keyword/lib/keyword.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ const typescript = [
1818
'readonly',
1919
'static',
2020
'implements',
21+
'declare',
22+
'module',
23+
'type',
2124
];
2225

2326
const expressions = [
@@ -43,6 +46,8 @@ const statements = [
4346
'throw',
4447
'of',
4548
'while',
49+
'class',
50+
'extends',
4651
];
4752

4853
const keywords = [

packages/operator-keyword/lib/keyword.spec.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,38 @@ test('putout: operator: isTSKeyword: implements', (t) => {
114114
t.ok(result);
115115
t.end();
116116
});
117+
118+
test('putout: operator: isTSKeyword: declare', (t) => {
119+
const result = isTSKeyword('declare');
120+
121+
t.ok(result);
122+
t.end();
123+
});
124+
125+
test('putout: operator: isTSKeyword: module', (t) => {
126+
const result = isTSKeyword('module');
127+
128+
t.ok(result);
129+
t.end();
130+
});
131+
132+
test('putout: operator: isTSKeyword: type', (t) => {
133+
const result = isTSKeyword('type');
134+
135+
t.ok(result);
136+
t.end();
137+
});
138+
139+
test('putout: operator: isTSKeyword: class', (t) => {
140+
const result = isKeyword('class');
141+
142+
t.ok(result);
143+
t.end();
144+
});
145+
146+
test('putout: operator: isTSKeyword: extends', (t) => {
147+
const result = isKeyword('extends');
148+
149+
t.ok(result);
150+
t.end();
151+
});

0 commit comments

Comments
 (0)