@@ -32,136 +32,136 @@ Install from VSCode Extension Marketplace [Hyper JavaScript Snippets](https://ma
32
32
### Declarations
33
33
| Prefix | Desc | Body |
34
34
| -----: | --------------------------------------- | ----------------------- |
35
- | ` va ` | var assignment | ` var ${1} = ${0} ` |
36
- | ` la ` | let assignment (ES2015) | ` let ${1} = ${0} ` |
37
- | ` ca ` | const assignment (ES2015) | ` const ${1} = ${0} ` |
38
- | ` vad ` | var destructuring assignment (ES2015) | ` var ${2} = ${1}${0} ` |
39
- | ` lad ` | let destructuring assignment (ES2015) | ` let ${2} = ${1}${0} ` |
40
- | ` cad ` | const destructuring assignment (ES2015) | ` const ${2} = ${1}${0} ` |
35
+ | ` va ` | var assignment | ` var ${1} = ${0} ` |
36
+ | ` la ` | let assignment (ES2015) | ` let ${1} = ${0} ` |
37
+ | ` ca ` | const assignment (ES2015) | ` const ${1} = ${0} ` |
38
+ | ` vad ` | var destructuring assignment (ES2015) | ` var ${2} = ${1}${0} ` |
39
+ | ` lad ` | let destructuring assignment (ES2015) | ` let ${2} = ${1}${0} ` |
40
+ | ` cad ` | const destructuring assignment (ES2015) | ` const ${2} = ${1}${0} ` |
41
41
42
42
### Conditional
43
- | Prefix | Desc | Body |
43
+ | Prefix | Desc | Body |
44
44
| -------: | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
45
- | ` if ` | if statement | ` if (${1}) {${0}} ` |
46
- | ` else ` | else statement | ` else {${0}} ` |
47
- | ` ifel ` | if/else statement | ` if (${1}) {${2}} else {${0}} ` |
48
- | ` elif ` | else if statement | ` else if (${1}) {${0}} ` |
49
- | ` ter ` | ternary operator | ` ${1} ? ${2} : ${0} ` |
45
+ | ` if ` | if statement | ` if (${1}) {${0}} ` |
46
+ | ` else ` | else statement | ` else {${0}} ` |
47
+ | ` ifel ` | if/else statement | ` if (${1}) {${2}} else {${0}} ` |
48
+ | ` elif ` | else if statement | ` else if (${1}) {${0}} ` |
49
+ | ` ter ` | ternary operator | ` ${1} ? ${2} : ${0} ` |
50
50
| ` switch ` | switch case | <code >switch (${1}) {<br >  ;  ; case ${2} :<br >  ;  ;  ;  ; $0<br >  ;  ; default:<br >  ;  ;  ;  ; break;<br >}</code > |
51
- | ` case ` | switch's case | <code >case ${1} :<br >  ;  ; ${0}</code > |
51
+ | ` case ` | switch's case | <code >case ${1} :<br >  ;  ; ${0}</code > |
52
52
53
53
### Iteration
54
- | Prefix | Desc | Body |
55
- | ------- : | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
56
- | ` for ` | for loop | <code >for (${1} ; ${2} ; ${3}) {<br >  ;  ; ${0}<br >}</code > |
57
- | ` forin ` | for in loop | <code >for (const ${1} in ${2}) {<br >  ;  ; if (${2}.hasOwnProperty(${1})) {<br >  ;  ;  ;  ; ${0}<br >  ;  ; }<br >}</code > |
58
- | ` forof ` | for of loop (ES2015) | <code >for (const ${1} of ${2}) {<br >  ;  ; ${0}<br >}</code > |
59
- | ` while ` | while loop | ` while (${1}) {${0}} ` |
60
- | ` tc ` | try/catch | ` try {${0}} catch (error) {${1}} ` |
61
- | ` tryfin ` | try/finally | ` try {${0}} finally {${1}} ` |
62
- | ` tcf ` | try/catch/finally | ` try {${0}} catch (error) {${1}} finally {${2}} ` |
54
+ | Prefix | Desc | Body |
55
+ | ------: | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
56
+ | ` for ` | for loop | <code >for (${1} ; ${2} ; ${3}) {<br >  ;  ; ${0}<br >}</code > |
57
+ | ` forin ` | for in loop | <code >for (const ${1} in ${2}) {<br >  ;  ; if (${2}.hasOwnProperty(${1})) {<br >  ;  ;  ;  ; ${0}<br >  ;  ; }<br >}</code > |
58
+ | ` forof ` | for of loop (ES2015) | <code >for (const ${1} of ${2}) {<br >  ;  ; ${0}<br >}</code > |
59
+ | ` while ` | while loop | ` while (${1}) {${0}} ` |
60
+ | ` tc ` | try/catch | ` try {${0}} catch (error) {${1}} ` |
61
+ | ` tf ` | try/finally | ` try {${0}} finally {${1}} ` |
62
+ | ` tcf ` | try/catch/finally | ` try {${0}} catch (error) {${1}} finally {${2}} ` |
63
63
64
64
### Functions
65
- | Prefix | Desc | Body |
66
- | -----: | ---------------------------------------------- | -------------------------------------- |
67
- | ` f ` | anonymous function | ` function(${1}) {${0}} ` |
68
- | ` fn ` | named function | ` function ${1}(${2}) {${0}} ` |
69
- | ` fa ` | async anonymous function | ` async function (${1}) {${0}} ` |
70
- | ` fna ` | async named function | ` async function ${1}(${2}) {${0}} ` |
71
- | ` af ` | arrow function (ES2015) | ` (${1}) => ${0} ` |
72
- | ` afa ` | async arrow function (ES2015) | ` async (${1}) => ${0} ` |
73
- | ` iife ` | immediately-invoked function expression (IIFE) | ` (${2})(${1})${0} ` |
74
- | ` gf ` | anonymous generator function (ES2015) | ` function* (${1}) {${0}} ` |
75
- | ` gfa ` | async generator function (ES2018) | ` async function* (${1}) {${0}} ` |
76
- | ` gfn ` | named generator function (ES2015) | ` function* ${1}(${2}) {${0}} ` |
77
- | ` gfna ` | async named generator function (ES2018) | ` async function* ${1}(${2}) {${0}} ` |
65
+ | Prefix | Desc | Body |
66
+ | -----: | ---------------------------------------------- | ----------------------------------- |
67
+ | ` f ` | anonymous function | ` function(${1}) {${0}} ` |
68
+ | ` fn ` | named function | ` function ${1}(${2}) {${0}} ` |
69
+ | ` fa ` | async anonymous function | ` async function (${1}) {${0}} ` |
70
+ | ` fna ` | async named function | ` async function ${1}(${2}) {${0}} ` |
71
+ | ` af ` | arrow function (ES2015) | ` (${1}) => ${0} ` |
72
+ | ` afa ` | async arrow function (ES2015) | ` async (${1}) => ${0} ` |
73
+ | ` iife ` | immediately-invoked function expression (IIFE) | ` (${2})(${1})${0} ` |
74
+ | ` gf ` | anonymous generator function (ES2015) | ` function* (${1}) {${0}} ` |
75
+ | ` gfa ` | async generator function (ES2018) | ` async function* (${1}) {${0}} ` |
76
+ | ` gfn ` | named generator function (ES2015) | ` function* ${1}(${2}) {${0}} ` |
77
+ | ` gfna ` | async named generator function (ES2018) | ` async function* ${1}(${2}) {${0}} ` |
78
78
79
79
### Iterables
80
80
| Prefix | Desc | Body |
81
81
| -----: | ---------------- | ------------------------------------ |
82
- | ` seq ` | sequence of 0..n | ` [...Array(${1:length}).keys()]${0} ` |
82
+ | ` seq ` | sequence of 0..n | ` [...Array(${1:length}).keys()]${0} ` |
83
83
84
84
### Objects
85
- | Prefix | Desc | Body |
86
- | -----: | -------------- | ----------------- |
87
- | ` ol ` | object literal | ` { ${1}: ${0} } ` |
85
+ | Prefix | Desc | Body |
86
+ | -----: | -------------- | ---------------- |
87
+ | ` ol ` | object literal | ` { ${1}: ${0} } ` |
88
88
89
89
### Classes
90
90
| Prefix | Desc | Body |
91
91
| -----: | -------------------------- | ------------------------------------------------------------------------------- |
92
- | ` cs ` | class (ES2015) | <code >class ${1: name } {<br >  ;  ; ${0}<br >}</code > |
93
- | ` cse ` | class extends (ES2015) | <code >class ${1: name } extends ${2: base } {<br >  ;  ; ${0}<br >}</code > |
92
+ | ` cs ` | class (ES2015) | <code >class ${1: name } {<br >  ;  ; ${0}<br >}</code > |
93
+ | ` cse ` | class extends (ES2015) | <code >class ${1: name } extends ${2: base } {<br >  ;  ; ${0}<br >}</code > |
94
94
| ` ctor ` | class constructor (ES2015) | ` constructor(${1}) {${0}} ` |
95
- | ` csm ` | method (ES2015) | ` ${1:name}(${2}) {${0}} ` |
95
+ | ` csm ` | method (ES2015) | ` ${1:name}(${2}) {${0}} ` |
96
96
| ` csma ` | async method (ES2015) | ` async ${1:name}(${2}) {${0}} ` |
97
97
| ` gter ` | getter (ES2015) | ` get ${1:property}() {${0}} ` |
98
98
| ` ster ` | setter (ES2015) | ` set ${1:property}(${2:value}) {${0}} ` |
99
- | ` gs ` | getter and setter (ES2015) | <code >get ${1: property }() {${0}}<br ><br >set ${1: property }(${2: value }) {}</code > |
99
+ | ` gs ` | getter and setter (ES2015) | <code >get ${1: property }() {${0}}<br ><br >set ${1: property }(${2: value }) {}</code > |
100
100
101
101
### Types
102
102
| Prefix | Desc | Body |
103
103
| -----: | ---------- | ------------------------------------ |
104
- | ` tof ` | typeof | ` typeof ${1:source} === '${0:type}' ` |
105
- | ` iof ` | instanceof | ` ${1:source} instanceof ${0:Class} ` |
104
+ | ` tof ` | typeof | ` typeof ${1:source} === '${0:type}' ` |
105
+ | ` iof ` | instanceof | ` ${1:source} instanceof ${0:Class} ` |
106
106
107
107
### Promises
108
108
| Prefix | Desc | Body |
109
109
| -----: | ------------------------ | --------------------------- |
110
- | ` pr ` | Promise (ES2015) | ` new Promise(${0}) ` |
111
- | ` prs ` | Promise resolve (ES2015) | ` Promise.resolve(${1})${0} ` |
112
- | ` prj ` | Promise reject (ES2015) | ` Promise.reject(${1})${0} ` |
113
- | ` pra ` | Promise all (ES2015) | ` Promise.all(${1})${0} ` |
110
+ | ` pr ` | Promise (ES2015) | ` new Promise(${0}) ` |
111
+ | ` prs ` | Promise resolve (ES2015) | ` Promise.resolve(${1})${0} ` |
112
+ | ` prj ` | Promise reject (ES2015) | ` Promise.reject(${1})${0} ` |
113
+ | ` pra ` | Promise all (ES2015) | ` Promise.all(${1})${0} ` |
114
114
115
115
### ES2015 Modules
116
- | Prefix | Desc | Body |
116
+ | Prefix | Desc | Body |
117
117
| ------: | ------------------------- | --------------------------------------------- |
118
- | ` exp ` | export (ES2015) | ` export ${0} ` |
119
- | ` expd ` | export default (ES2015) | ` export default ${0} ` |
118
+ | ` exp ` | export (ES2015) | ` export ${0} ` |
119
+ | ` expd ` | export default (ES2015) | ` export default ${0} ` |
120
120
| ` expas ` | export as (ES2015) | ` export { ${1} as ${2} };${0} ` |
121
- | ` expf ` | export from (ES2015) | ` export ${2:name} from '${1}';${0} ` |
122
- | ` imp ` | import module (ES2015) | ` import ${2:name} from '${1}';${0} ` |
123
- | ` impf ` | import file (ES2015) | ` import '${1}';${0} ` |
121
+ | ` expf ` | export from (ES2015) | ` export ${2:name} from '${1}';${0} ` |
122
+ | ` imp ` | import module (ES2015) | ` import ${2:name} from '${1}';${0} ` |
123
+ | ` impf ` | import file (ES2015) | ` import '${1}';${0} ` |
124
124
| ` impas ` | import module as (ES2015) | ` import ${2:*} as ${3:name} from '${1}';${0} ` |
125
125
126
126
### Node.js
127
- | Prefix | Desc | Body |
127
+ | Prefix | Desc | Body |
128
128
| --------: | ---------------------- | ---------------------------------------- |
129
- | ` cb ` | Node.js style callback | ` (err, ${1:response}) => {${0}} ` |
129
+ | ` cb ` | Node.js style callback | ` (err, ${1:response}) => {${0}} ` |
130
130
| ` require ` | require | ` require(${1:path})${0} ` |
131
- | ` req ` | require assignment | ` const ${2:name} = require('${1}');${0} ` |
132
- | ` em ` | exports.member | ` exports.${1} = ${2};${0} ` |
133
- | ` me ` | module.exports | ` module.exports = ${1}${0} ` |
134
- | ` on ` | event handler | ` on('${1:event}', ${2:callback});${0} ` |
131
+ | ` req ` | require assignment | ` const ${2:name} = require('${1}');${0} ` |
132
+ | ` em ` | exports.member | ` exports.${1} = ${2};${0} ` |
133
+ | ` me ` | module.exports | ` module.exports = ${1}${0} ` |
134
+ | ` on ` | event handler | ` on('${1:event}', ${2:callback});${0} ` |
135
135
136
136
### Console
137
137
| Prefix | Desc | Body |
138
138
| -----: | --------------------- | --------------------------------- |
139
- | ` cl ` | console.log | ` console.log(${1})${0} ` |
140
- | ` ce ` | console.error | ` console.error(${1})${0} ` |
141
- | ` cw ` | console.warn | ` console.warn(${1})${0} ` |
142
- | ` cll ` | console.log labeled | ` console.log('${1}', ${1})${0} ` |
143
- | ` cel ` | console.error labeled | ` console.error('${1}', ${1})${0} ` |
144
- | ` cwl ` | console.warn labeled | ` console.warn('${1}', ${1})${0} ` |
139
+ | ` cl ` | console.log | ` console.log(${1})${0} ` |
140
+ | ` ce ` | console.error | ` console.error(${1})${0} ` |
141
+ | ` cw ` | console.warn | ` console.warn(${1})${0} ` |
142
+ | ` cll ` | console.log labeled | ` console.log('${1}', ${1})${0} ` |
143
+ | ` cel ` | console.error labeled | ` console.error('${1}', ${1})${0} ` |
144
+ | ` cwl ` | console.warn labeled | ` console.warn('${1}', ${1})${0} ` |
145
145
146
146
### Timers
147
- | Prefix | Desc | Body |
148
- | --------- : | -------------------------- | -------------------------------------------- |
149
- | ` sett ` | setTimeout | ` setTimeout(${2:callback}, ${1:delay})${0} ` |
150
- | ` setin ` | setInterval | ` setInterval(${2:callback}, ${1:delay})${0} ` |
151
- | ` setim ` | setImmediate (node.js) | ` setImmediate(${1:callback}${2})${0} ` |
152
- | ` nexttick ` | process nextTick (node.js) | ` process.nextTick(${1});${0} ` |
147
+ | Prefix | Desc | Body |
148
+ | ------: | -------------------------- | -------------------------------------------- |
149
+ | ` sett ` | setTimeout | ` setTimeout(${2:callback}, ${1:delay})${0} ` |
150
+ | ` setin ` | setInterval | ` setInterval(${2:callback}, ${1:delay})${0} ` |
151
+ | ` setim ` | setImmediate (node.js) | ` setImmediate(${1:callback}${2})${0} ` |
152
+ | ` nt ` | process nextTick (node.js) | ` process.nextTick(${1});${0} ` |
153
153
154
154
### Miscellaneous
155
155
| Prefix | Desc | Body |
156
156
| -----: | ----------------------------- | --------------- |
157
- | ` us ` | insert 'use strict' statement | ` 'use strict'; ` |
157
+ | ` us ` | insert 'use strict' statement | ` 'use strict'; ` |
158
158
159
159
### TypeScript
160
160
| Prefix | Desc | Body |
161
161
| -----: | ---------------------------------------------- | -------------------------------- |
162
- | ` typ ` | type (TypeScript) | ` type ${1:name} = ${0} ` |
163
- | ` int ` | interface (TypeScript) | ` interface ${1:name} {${2}}${0} ` |
162
+ | ` typ ` | type (TypeScript) | ` type ${1:name} = ${0} ` |
163
+ | ` int ` | interface (TypeScript) | ` interface ${1:name} {${2}}${0} ` |
164
164
| ` enum ` | enum (TypeScript) | ` enum ${1:name} {${2}}${0} ` |
165
- | ` mod ` | module (TypeScript) | ` module ${1:name} {${2}}${0} ` |
166
- | ` nam ` | namespace (TypeScript) | ` namespace ${1:name} {${2}}${0} ` |
167
- | ` pd ` | parameter destructuring with type (TypeScript) | ` ${2} : ${1:type}$0 ` |
165
+ | ` mod ` | module (TypeScript) | ` module ${1:name} {${2}}${0} ` |
166
+ | ` nam ` | namespace (TypeScript) | ` namespace ${1:name} {${2}}${0} ` |
167
+ | ` pd ` | parameter destructuring with type (TypeScript) | ` ${2} : ${1:type}$0 ` |
0 commit comments