Skip to content

Commit 90e2bb7

Browse files
committed
feat: add typeof snippet
1 parent bde0af6 commit 90e2bb7

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

snippets/javascript.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,14 @@
181181
"description": "JSON.parse",
182182
"scope": "javascript,javascriptreact"
183183
},
184+
"🟨 typeOf": {
185+
"prefix": "typeof.$typeof",
186+
"body": [
187+
"typeof ${1:data} ${3|===,!==,==,!=|} '${2|undefined,number,string,boolean,object,function,symbol,bigint|}'"
188+
],
189+
"description": "typeof X === ?",
190+
"scope": "javascript,javascriptreact"
191+
},
184192
"🟨 reactFnComp": {
185193
"prefix": "rFC.$rFC",
186194
"body": [

snippets/typescript.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,14 @@
181181
"description": "JSON.parse",
182182
"scope": "javascript,typescript,javascriptreact,typescriptreact"
183183
},
184+
"🟨 typeOf": {
185+
"prefix": "typeof.$typeof",
186+
"body": [
187+
"typeof ${1:data} ${3|===,!==,==,!=|} '${2|undefined,number,string,boolean,object,function,symbol,bigint|}'"
188+
],
189+
"description": "typeof X === ?",
190+
"scope": "javascript,typescript,javascriptreact,typescriptreact"
191+
},
184192
"🟨 reactFnComp": {
185193
"prefix": "rFC.$rFC",
186194
"body": [

src/snippets/vanilla.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,11 @@ export const jsonParse: Snippet = {
125125
body: ['JSON.parse(${1:data})'],
126126
description: 'JSON.parse',
127127
};
128+
129+
export const typeOf: Snippet = {
130+
prefix: 'typeof',
131+
body: [
132+
"typeof ${1:data} ${3|===,!==,==,!=|} '${2|undefined,number,string,boolean,object,function,symbol,bigint|}'",
133+
],
134+
description: 'typeof X === ?',
135+
};

0 commit comments

Comments
 (0)