You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.1 KiB
Plaintext
68 lines
1.1 KiB
Plaintext
snippet f "function" !
|
|
function ${1:function_name} (${2:argument}) {
|
|
${VISUAL}$0
|
|
}
|
|
endsnippet
|
|
|
|
snippet scf "self calling function" !
|
|
(function (${1:argument}) {
|
|
${VISUAL}$0
|
|
}(${2:$1}))
|
|
endsnippet
|
|
|
|
snippet log "console.log"
|
|
// eslint-disable-next-line no-console
|
|
console.log(${1:'${2:value}'})
|
|
endsnippet
|
|
|
|
snippet strict "use strict"
|
|
'use strict'
|
|
endsnippet
|
|
|
|
snippet timeout "setTimeout" !
|
|
setTimeout(function () {
|
|
${1://code}
|
|
}, 0)
|
|
endsnippet
|
|
|
|
snippet it "it test case" !
|
|
it('→ $1', () => {
|
|
})
|
|
endsnippet
|
|
|
|
snippet desc "describe test case" !
|
|
describe('→ $1', () => {
|
|
})
|
|
endsnippet
|
|
|
|
snippet exp "expect" b
|
|
expect($1).toBe($2)
|
|
endsnippet
|
|
|
|
snippet umd "Universal Module Definition" b
|
|
(function (root, factory) {
|
|
if (typeof define === "function" && define.amd) {
|
|
define(["${1:dependency}"], factory)
|
|
} else if (typeof exports === "object") {
|
|
module.exports = factory(require("$1"))
|
|
} else {
|
|
root.${2:Export} = factory(root.$1)
|
|
}
|
|
}(this, function ($1) {
|
|
function $2($3) {
|
|
}
|
|
|
|
return $2
|
|
}))
|
|
endsnippet
|
|
|
|
|
|
snippet debug "debugger" !
|
|
// eslint-disable-next-line no-debugger
|
|
debugger$1
|
|
endsnippet
|
|
|
|
snippet flow "flow"
|
|
/* @flow */$1
|
|
endsnippet
|