File tree Expand file tree Collapse file tree 1 file changed +36
-37
lines changed
Expand file tree Collapse file tree 1 file changed +36
-37
lines changed Original file line number Diff line number Diff line change @@ -96,62 +96,61 @@ snippet cl
9696 console.log(${1} );
9797# return
9898snippet ret
99- return ${1: result }
99+ return ${1: result }
100100# for (property in object ) { ... }
101101snippet fori
102- for (var ${1: prop } in ${2: Things } ) {
103- ${3: $2 [$1 ] }
104- };
102+ for (var ${1: prop } in ${2: Things } ) {
103+ ${3: $2 [$1 ] }
104+ };
105105# hasOwnProperty
106106snippet has
107- hasOwnProperty(${1} )
107+ hasOwnProperty(${1} )
108108# docstring
109109snippet /**
110- /**
111- * ${1: description }
112- *
113- */
110+ /**
111+ * ${1: description }
112+ *
113+ */
114114snippet @par
115- @param {${1: type } } ${2: name } ${3: description }
115+ @param {${1: type } } ${2: name } ${3: description }
116116snippet @ret
117- @return {${1: type } } ${2: description }
118-
117+ @return {${1: type } } ${2: description }
119118# JSON.parse
120119snippet jsonp
121- JSON.parse(${1: jstr } );
120+ JSON.parse(${1: jstr } );
122121# JSON.stringify
123122snippet jsons
124- JSON.stringify(${1: object } );
123+ JSON.stringify(${1: object } );
125124# self-defining function
126125snippet sdf
127- var ${1: function_name } = function (${2: argument } ) {
128- ${3: // initial code ... }
126+ var ${1: function_name } = function (${2: argument } ) {
127+ ${3: // initial code ... }
129128
130- $1 = function ($2 ) {
131- ${4: // main code }
132- };
133- }
129+ $1 = function ($2 ) {
130+ ${4: // main code }
131+ };
132+ }
134133# singleton
135134snippet sing
136- function ${1: Singleton } (${2: argument } ) {
137- // the cached instance
138- var instance;
135+ function ${1: Singleton } (${2: argument } ) {
136+ // the cached instance
137+ var instance;
139138
140- // rewrite the constructor
141- $1 = function $1 ($2 ) {
142- return instance;
143- };
144-
145- // carry over the prototype properties
146- $1 .prototype = this;
139+ // rewrite the constructor
140+ $1 = function $1 ($2 ) {
141+ return instance;
142+ };
143+
144+ // carry over the prototype properties
145+ $1 .prototype = this;
147146
148- // the instance
149- instance = new $1 ();
147+ // the instance
148+ instance = new $1 ();
150149
151- // reset the constructor pointer
152- instance.constructor = $1 ;
150+ // reset the constructor pointer
151+ instance.constructor = $1 ;
153152
154- ${3: // code ... }
153+ ${3: // code ... }
155154
156- return instance;
157- }
155+ return instance;
156+ }
You can’t perform that action at this time.
0 commit comments