id
stringlengths
34
124
type
stringclasses
4 values
prompt
stringlengths
0
4.95k
response
stringlengths
21
4.89k
source_lang
stringclasses
3 values
target_lang
stringclasses
2 values
repo
stringclasses
75 values
path
stringlengths
10
88
license
stringclasses
1 value
commit
stringlengths
40
40
stars
int64
431
18.7k
source_url
stringlengths
86
176
line_start
int64
1
214
line_end
int64
3
253
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:2:completion
completion
exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage._location, path.resolve('./scratch')) localStorage.setItem('/', 'something') test.equal(localStorage.getItem('/'), 'something') o = {a:1, b:'some string', c:{x: 1, y: 2}} ...
test.equal(localStorage.key(0), '/') localStorage.clear() test.equal(localStorage.length, 0) localStorage._deleteLocation() test.done() testQuota: (test) -> n10 = '01234567890' n100 = repeat('0123456789', 10) n1000 = repeat(n100, 10) n10000 = repeat(n1000, 10) ls = new LocalStor...
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
b45249ecdc97374f1f20f0d260c2a4f7c6e701f5
460
https://github.com/lmaccherone/node-localstorage/blob/b45249ecdc97374f1f20f0d260c2a4f7c6e701f5/test/LocalStorageTest.coffee
10
59
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:3:raw_corpus
raw_corpus
ls.removeItem(3) ls.setItem(7, n100) f2 = () -> ls.setitem(8, n1000) test.throws(f2, Error) ls._deleteLocation() test.done() testNoNewKeyword: (test) -> local = LocalStorage('./scratch3') local.setItem('Hello', ' world!') test.equals(local.getItem('Hello'), ' world!') local...
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
b45249ecdc97374f1f20f0d260c2a4f7c6e701f5
460
https://github.com/lmaccherone/node-localstorage/blob/b45249ecdc97374f1f20f0d260c2a4f7c6e701f5/test/LocalStorageTest.coffee
60
109
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:3:completion
completion
ls.removeItem(3) ls.setItem(7, n100) f2 = () -> ls.setitem(8, n1000) test.throws(f2, Error) ls._deleteLocation() test.done() testNoNewKeyword: (test) -> local = LocalStorage('./scratch3') local.setItem('Hello', ' world!') test.equals(local.getItem('Hello'), ' world!') local...
localStorage.setItem('a', 'hello') localStorage.setItem('b', 'hello') localStorage.setItem('c', 'hello') localStorage.setItem('d', 'hello') test.deepEqual(localStorage._keys, ['a', 'b', 'c', 'd']) localStorage.removeItem('c') test.deepEqual(localStorage._keys, ['a', 'b', 'd']) localStorage....
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
b45249ecdc97374f1f20f0d260c2a4f7c6e701f5
460
https://github.com/lmaccherone/node-localstorage/blob/b45249ecdc97374f1f20f0d260c2a4f7c6e701f5/test/LocalStorageTest.coffee
60
109
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:4:raw_corpus
raw_corpus
key = evnt.key oldVal = evnt.oldValue newVal = evnt.newValue url = evnt.url localStorage.on('storage', handleEvent) localStorage.setItem('a', 'something') test.equal(localStorage.getItem('a'), 'something') test.equal(key, 'a') test.equal(oldVal, null) test.equal(newVal, 'some...
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
b45249ecdc97374f1f20f0d260c2a4f7c6e701f5
460
https://github.com/lmaccherone/node-localstorage/blob/b45249ecdc97374f1f20f0d260c2a4f7c6e701f5/test/LocalStorageTest.coffee
110
159
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:4:completion
completion
key = evnt.key oldVal = evnt.oldValue newVal = evnt.newValue url = evnt.url localStorage.on('storage', handleEvent) localStorage.setItem('a', 'something') test.equal(localStorage.getItem('a'), 'something') test.equal(key, 'a') test.equal(oldVal, null) test.equal(newVal, 'some...
test.equal(key, 'a') test.equal(oldVal, 'somethingnew') test.equal(newVal, null) test.equal(url, expectedUrl) key = null; oldVal = null; newVal = null; url = null localStorage.clear(); test.equal(localStorage.getItem('a'), null) test.equal(key, null) test.equal(oldVal, null) test.eq...
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
b45249ecdc97374f1f20f0d260c2a4f7c6e701f5
460
https://github.com/lmaccherone/node-localstorage/blob/b45249ecdc97374f1f20f0d260c2a4f7c6e701f5/test/LocalStorageTest.coffee
110
159
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:5:raw_corpus
raw_corpus
localStorage._deleteLocation() test.done() testEmptyString: (test) -> localStorage = new LocalStorage('./scratch8') localStorage.setItem('', 'something') test.equal(localStorage.getItem(''), 'something') localStorage._deleteLocation() test.done()
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
b45249ecdc97374f1f20f0d260c2a4f7c6e701f5
460
https://github.com/lmaccherone/node-localstorage/blob/b45249ecdc97374f1f20f0d260c2a4f7c6e701f5/test/LocalStorageTest.coffee
160
171
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:5:completion
completion
localStorage._deleteLocation() test.done() testEmptyString: (test) -> localStorage = new LocalStorage('./scratch8')
localStorage.setItem('', 'something') test.equal(localStorage.getItem(''), 'something') localStorage._deleteLocation() test.done()
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
b45249ecdc97374f1f20f0d260c2a4f7c6e701f5
460
https://github.com/lmaccherone/node-localstorage/blob/b45249ecdc97374f1f20f0d260c2a4f7c6e701f5/test/LocalStorageTest.coffee
160
171
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:2:raw_corpus
raw_corpus
exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage._location, './scratch') localStorage.setItem('/', 'something') test.equal(localStorage.getItem('/'), 'something') o = {a:1, b:'some string', c:{x: 1, y: 2}} localStor...
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
6a2bbc63ab19c432ba8e2e677abb7f77de527724
460
https://github.com/lmaccherone/node-localstorage/blob/6a2bbc63ab19c432ba8e2e677abb7f77de527724/test/LocalStorageTest.coffee
9
58
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage._location, './scratch') localStorage.setItem('/', 'something') test.equal(localStorage.getItem('/'), 'something') ...
exports.LocalStorageTest = { testLocalStorage: function(test) { var a, localStorage, o; localStorage = new LocalStorage('./scratch'); test.equal(localStorage._location, './scratch'); localStorage.setItem('/', 'something'); test.equal(localStorage.getItem('/'), 'something'); o = { a: 1, ...
CoffeeScript
JavaScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
6a2bbc63ab19c432ba8e2e677abb7f77de527724
460
https://github.com/lmaccherone/node-localstorage/blob/6a2bbc63ab19c432ba8e2e677abb7f77de527724/test/LocalStorageTest.coffee
9
58
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.LocalStorageTest = { testLocalStorage: function(test) { var a, localStorage, o; localStorage = new LocalStorage('./scratch'); test.equal(localStorage._location, './scratch'); localStorage.setItem('/', 'something'); test.equal(localStor...
exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage._location, './scratch') localStorage.setItem('/', 'something') test.equal(localStorage.getItem('/'), 'something') o = {a:1, b:'some string', c:{x: 1, y: 2}} localStor...
JavaScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
6a2bbc63ab19c432ba8e2e677abb7f77de527724
460
https://github.com/lmaccherone/node-localstorage/blob/6a2bbc63ab19c432ba8e2e677abb7f77de527724/test/LocalStorageTest.coffee
9
58
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:2:completion
completion
exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage._location, './scratch') localStorage.setItem('/', 'something') test.equal(localStorage.getItem('/'), 'something') o = {a:1, b:'some string', c:{x: 1, y: 2}} localStor...
test.equal(localStorage.length, 1) test.equal(localStorage.key(0), '/') localStorage.clear() test.equal(localStorage.length, 0) localStorage._deleteLocation() test.done() testQuota: (test) -> n10 = '01234567890' n100 = repeat('0123456789', 10) n1000 = repeat(n100, 10) n10000 = r...
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
6a2bbc63ab19c432ba8e2e677abb7f77de527724
460
https://github.com/lmaccherone/node-localstorage/blob/6a2bbc63ab19c432ba8e2e677abb7f77de527724/test/LocalStorageTest.coffee
9
58
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:3:raw_corpus
raw_corpus
ls.setItem(2, n1000) # Should not throw because it replaces one of equal size ls.removeItem(3) ls.setItem(7, n100) f2 = () -> ls.setitem(8, n1000) test.throws(f2, Error) ls._deleteLocation() test.done() testNoNewKeyword: (test) -> local = LocalStorage('./scratch3') local.setI...
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
6a2bbc63ab19c432ba8e2e677abb7f77de527724
460
https://github.com/lmaccherone/node-localstorage/blob/6a2bbc63ab19c432ba8e2e677abb7f77de527724/test/LocalStorageTest.coffee
59
108
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:3:completion
completion
ls.setItem(2, n1000) # Should not throw because it replaces one of equal size ls.removeItem(3) ls.setItem(7, n100) f2 = () -> ls.setitem(8, n1000) test.throws(f2, Error) ls._deleteLocation() test.done() testNoNewKeyword: (test) -> local = LocalStorage('./scratch3') local.setI...
localStorage = new LocalStorage('./scratch6'); localStorage.setItem('a', 'hello') localStorage.setItem('b', 'hello') localStorage.setItem('c', 'hello') localStorage.setItem('d', 'hello') test.deepEqual(localStorage._keys, ['a', 'b', 'c', 'd']) localStorage.removeItem('c') test.deepEqual(lo...
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
6a2bbc63ab19c432ba8e2e677abb7f77de527724
460
https://github.com/lmaccherone/node-localstorage/blob/6a2bbc63ab19c432ba8e2e677abb7f77de527724/test/LocalStorageTest.coffee
59
108
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:4:raw_corpus
raw_corpus
handleEvent = (evnt) -> key = evnt.key oldVal = evnt.oldValue newVal = evnt.newValue url = evnt.url localStorage.on('storage', handleEvent) localStorage.setItem('a', 'something') test.equal(localStorage.getItem('a'), 'something') test.equal(key, 'a') test.equal(oldVal, null...
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
6a2bbc63ab19c432ba8e2e677abb7f77de527724
460
https://github.com/lmaccherone/node-localstorage/blob/6a2bbc63ab19c432ba8e2e677abb7f77de527724/test/LocalStorageTest.coffee
109
158
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:4:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript handleEvent = (evnt) -> key = evnt.key oldVal = evnt.oldValue newVal = evnt.newValue url = evnt.url localStorage.on('storage', handleEvent) localStorage.setItem('a', 'something') test.equal(localStorage.getItem('a'), 'somethi...
var handleEvent, key, newVal, oldVal, url; handleEvent = function(evnt) { var key, newVal, oldVal, url; key = evnt.key; oldVal = evnt.oldValue; newVal = evnt.newValue; return url = evnt.url; }; localStorage.on('storage', handleEvent); localStorage.setItem('a', 'something'); test.equal(localStorage.getItem...
CoffeeScript
JavaScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
6a2bbc63ab19c432ba8e2e677abb7f77de527724
460
https://github.com/lmaccherone/node-localstorage/blob/6a2bbc63ab19c432ba8e2e677abb7f77de527724/test/LocalStorageTest.coffee
109
158
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:4:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var handleEvent, key, newVal, oldVal, url; handleEvent = function(evnt) { var key, newVal, oldVal, url; key = evnt.key; oldVal = evnt.oldValue; newVal = evnt.newValue; return url = evnt.url; }; localStorage.on('storage', handleEvent); localStorage.setI...
handleEvent = (evnt) -> key = evnt.key oldVal = evnt.oldValue newVal = evnt.newValue url = evnt.url localStorage.on('storage', handleEvent) localStorage.setItem('a', 'something') test.equal(localStorage.getItem('a'), 'something') test.equal(key, 'a') test.equal(oldVal, null...
JavaScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
6a2bbc63ab19c432ba8e2e677abb7f77de527724
460
https://github.com/lmaccherone/node-localstorage/blob/6a2bbc63ab19c432ba8e2e677abb7f77de527724/test/LocalStorageTest.coffee
109
158
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:4:completion
completion
handleEvent = (evnt) -> key = evnt.key oldVal = evnt.oldValue newVal = evnt.newValue url = evnt.url localStorage.on('storage', handleEvent) localStorage.setItem('a', 'something') test.equal(localStorage.getItem('a'), 'something') test.equal(key, 'a') test.equal(oldVal, null...
test.equal(localStorage.getItem('a'), null) test.equal(key, 'a') test.equal(oldVal, 'somethingnew') test.equal(newVal, null) test.equal(url, expectedUrl) key = null; oldVal = null; newVal = null; url = null localStorage.clear(); test.equal(localStorage.getItem('a'), null) test.equal(key...
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
6a2bbc63ab19c432ba8e2e677abb7f77de527724
460
https://github.com/lmaccherone/node-localstorage/blob/6a2bbc63ab19c432ba8e2e677abb7f77de527724/test/LocalStorageTest.coffee
109
158
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:5:raw_corpus
raw_corpus
test.equal(localStorage._getStat('not there'), null) localStorage._deleteLocation() test.done() testEmptyString: (test) -> localStorage = new LocalStorage('./scratch8') localStorage.setItem('', 'something') test.equal(localStorage.getItem(''), 'something') localStorage._deleteLocation() ...
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
6a2bbc63ab19c432ba8e2e677abb7f77de527724
460
https://github.com/lmaccherone/node-localstorage/blob/6a2bbc63ab19c432ba8e2e677abb7f77de527724/test/LocalStorageTest.coffee
159
171
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:5:completion
completion
test.equal(localStorage._getStat('not there'), null) localStorage._deleteLocation() test.done() testEmptyString: (test) ->
localStorage = new LocalStorage('./scratch8') localStorage.setItem('', 'something') test.equal(localStorage.getItem(''), 'something') localStorage._deleteLocation() test.done()
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
6a2bbc63ab19c432ba8e2e677abb7f77de527724
460
https://github.com/lmaccherone/node-localstorage/blob/6a2bbc63ab19c432ba8e2e677abb7f77de527724/test/LocalStorageTest.coffee
159
171
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:2:raw_corpus
raw_corpus
exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage.location, './scratch') localStorage.setItem('/', 'something') test.equal(localStorage.getItem('/'), 'something') o = {a:1, b:'some string', c:{x: 1, y: 2}} localStora...
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
7912ded3376077f89633aaf0c6c1cc9d00470566
460
https://github.com/lmaccherone/node-localstorage/blob/7912ded3376077f89633aaf0c6c1cc9d00470566/test/LocalStorageTest.coffee
9
58
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage.location, './scratch') localStorage.setItem('/', 'something') test.equal(localStorage.getItem('/'), 'something') ...
exports.LocalStorageTest = { testLocalStorage: function(test) { var a, localStorage, o; localStorage = new LocalStorage('./scratch'); test.equal(localStorage.location, './scratch'); localStorage.setItem('/', 'something'); test.equal(localStorage.getItem('/'), 'something'); o = { a: 1, ...
CoffeeScript
JavaScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
7912ded3376077f89633aaf0c6c1cc9d00470566
460
https://github.com/lmaccherone/node-localstorage/blob/7912ded3376077f89633aaf0c6c1cc9d00470566/test/LocalStorageTest.coffee
9
58
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.LocalStorageTest = { testLocalStorage: function(test) { var a, localStorage, o; localStorage = new LocalStorage('./scratch'); test.equal(localStorage.location, './scratch'); localStorage.setItem('/', 'something'); test.equal(localStora...
exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage.location, './scratch') localStorage.setItem('/', 'something') test.equal(localStorage.getItem('/'), 'something') o = {a:1, b:'some string', c:{x: 1, y: 2}} localStora...
JavaScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
7912ded3376077f89633aaf0c6c1cc9d00470566
460
https://github.com/lmaccherone/node-localstorage/blob/7912ded3376077f89633aaf0c6c1cc9d00470566/test/LocalStorageTest.coffee
9
58
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:2:completion
completion
exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage.location, './scratch') localStorage.setItem('/', 'something') test.equal(localStorage.getItem('/'), 'something') o = {a:1, b:'some string', c:{x: 1, y: 2}} localStora...
test.equal(localStorage.length, 1) test.equal(localStorage.key(0), '/') localStorage.clear() test.equal(localStorage.length, 0) localStorage._deleteLocation() test.done() testQuota: (test) -> n10 = '01234567890' n100 = repeat('0123456789', 10) n1000 = repeat(n100, 10) n10000 = r...
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
7912ded3376077f89633aaf0c6c1cc9d00470566
460
https://github.com/lmaccherone/node-localstorage/blob/7912ded3376077f89633aaf0c6c1cc9d00470566/test/LocalStorageTest.coffee
9
58
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:3:raw_corpus
raw_corpus
ls.setItem(2, n1000) # Should not throw because it replaces one of equal size ls.removeItem(3) ls.setItem(7, n100) f2 = () -> ls.setitem(8, n1000) test.throws(f2, Error) ls._deleteLocation() test.done() testNoNewKeyword: (test) -> local = LocalStorage('./scratch3') local.setI...
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
7912ded3376077f89633aaf0c6c1cc9d00470566
460
https://github.com/lmaccherone/node-localstorage/blob/7912ded3376077f89633aaf0c6c1cc9d00470566/test/LocalStorageTest.coffee
59
108
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:3:completion
completion
ls.setItem(2, n1000) # Should not throw because it replaces one of equal size ls.removeItem(3) ls.setItem(7, n100) f2 = () -> ls.setitem(8, n1000) test.throws(f2, Error) ls._deleteLocation() test.done() testNoNewKeyword: (test) -> local = LocalStorage('./scratch3') local.setI...
localStorage = new LocalStorage('./scratch6'); localStorage.setItem('a', 'hello') localStorage.setItem('b', 'hello') localStorage.setItem('c', 'hello') localStorage.setItem('d', 'hello') test.deepEqual(localStorage.keys, ['a', 'b', 'c', 'd']) localStorage.removeItem('c') test.deepEqual(loc...
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
7912ded3376077f89633aaf0c6c1cc9d00470566
460
https://github.com/lmaccherone/node-localstorage/blob/7912ded3376077f89633aaf0c6c1cc9d00470566/test/LocalStorageTest.coffee
59
108
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:4:raw_corpus
raw_corpus
oldVal = evnt.oldValue newVal = evnt.newValue url = evnt.url localStorage.on('storage', handleEvent) localStorage.setItem('a', 'something') test.equal(localStorage.getItem('a'), 'something') test.equal(key, 'a') test.equal(oldVal, null) test.equal(newVal, 'something') test.equa...
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
7912ded3376077f89633aaf0c6c1cc9d00470566
460
https://github.com/lmaccherone/node-localstorage/blob/7912ded3376077f89633aaf0c6c1cc9d00470566/test/LocalStorageTest.coffee
109
158
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:4:completion
completion
oldVal = evnt.oldValue newVal = evnt.newValue url = evnt.url localStorage.on('storage', handleEvent) localStorage.setItem('a', 'something') test.equal(localStorage.getItem('a'), 'something') test.equal(key, 'a') test.equal(oldVal, null) test.equal(newVal, 'something') test.equa...
test.equal(key, 'a') test.equal(oldVal, 'somethingnew') test.equal(newVal, null) test.equal(url, expectedUrl) key = null; oldVal = null; newVal = null; url = null localStorage.clear(); test.equal(localStorage.getItem('a'), null) test.equal(key, null) test.equal(oldVal, null) test.eq...
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
7912ded3376077f89633aaf0c6c1cc9d00470566
460
https://github.com/lmaccherone/node-localstorage/blob/7912ded3376077f89633aaf0c6c1cc9d00470566/test/LocalStorageTest.coffee
109
158
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:3:raw_corpus
raw_corpus
ls.setItem(2, n1000) # Should not throw because it replaces one of equal size ls.removeItem(3) ls.setItem(7, n100) f2 = () -> ls.setitem(8, n1000) test.throws(f2, Error) ls._deleteLocation() test.done() testNoNewKeyword: (test) -> local = LocalStorage('./scratch3') local.setI...
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
0b72cffdb00ff303fe46d2616c875051c4930713
460
https://github.com/lmaccherone/node-localstorage/blob/0b72cffdb00ff303fe46d2616c875051c4930713/test/LocalStorageTest.coffee
59
108
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:3:completion
completion
ls.setItem(2, n1000) # Should not throw because it replaces one of equal size ls.removeItem(3) ls.setItem(7, n100) f2 = () -> ls.setitem(8, n1000) test.throws(f2, Error) ls._deleteLocation() test.done() testNoNewKeyword: (test) -> local = LocalStorage('./scratch3') local.setI...
localStorage = new LocalStorage('./scratch5') expectedUrl = "pid:" + process.pid key = null; oldVal = null; newVal = null; url = null handleEvent = (evnt) -> key = evnt.key oldVal = evnt.oldValue newVal = evnt.newValue url = evnt.url localStorage.on('storage', handleEvent) ...
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
0b72cffdb00ff303fe46d2616c875051c4930713
460
https://github.com/lmaccherone/node-localstorage/blob/0b72cffdb00ff303fe46d2616c875051c4930713/test/LocalStorageTest.coffee
59
108
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:3:raw_corpus
raw_corpus
ls.setItem(2, n1000) # Should not throw because it replaces one of equal size ls.removeItem(3) ls.setItem(7, n100) f2 = () -> ls.setitem(8, n1000) test.throws(f2, Error) ls._deleteLocation() test.done() testNoNewKeyword: (test) -> local = LocalStorage('./scratch3') local.setI...
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
2aff35665f6c1599a12623c40fc14216a5876531
460
https://github.com/lmaccherone/node-localstorage/blob/2aff35665f6c1599a12623c40fc14216a5876531/test/LocalStorageTest.coffee
59
108
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:3:completion
completion
ls.setItem(2, n1000) # Should not throw because it replaces one of equal size ls.removeItem(3) ls.setItem(7, n100) f2 = () -> ls.setitem(8, n1000) test.throws(f2, Error) ls._deleteLocation() test.done() testNoNewKeyword: (test) -> local = LocalStorage('./scratch3') local.setI...
testEvents: (test) -> localStorage = new LocalStorage('./scratch5') key = null; oldVal = null; newVal = null; url = null handleEvent = (evnt) -> key = evnt.key oldVal = evnt.oldValue newVal = evnt.newValue url = evnt.url localStorage.on('storage', handleEvent) localStorage....
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
2aff35665f6c1599a12623c40fc14216a5876531
460
https://github.com/lmaccherone/node-localstorage/blob/2aff35665f6c1599a12623c40fc14216a5876531/test/LocalStorageTest.coffee
59
108
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:3:raw_corpus
raw_corpus
ls.setItem(2, n1000) # Should not throw because it replaces one of equal size ls.removeItem(3) ls.setItem(7, n100) f2 = () -> ls.setitem(8, n1000) test.throws(f2, Error) ls._deleteLocation() test.done() testNoNewKeyword: (test) -> local = LocalStorage('./scratch3') local.setI...
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
a2f00fc1e207c477910dd6636c7d9e678bc1d6d7
460
https://github.com/lmaccherone/node-localstorage/blob/a2f00fc1e207c477910dd6636c7d9e678bc1d6d7/test/LocalStorageTest.coffee
59
81
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:3:completion
completion
ls.setItem(2, n1000) # Should not throw because it replaces one of equal size ls.removeItem(3) ls.setItem(7, n100) f2 = () -> ls.setitem(8, n1000) test.throws(f2, Error) ls._deleteLocation() test.done()
testNoNewKeyword: (test) -> local = LocalStorage('./scratch3') local.setItem('Hello', ' world!') test.equals(local.getItem('Hello'), ' world!') local._deleteLocation() test.done() testNull: (test) -> local = LocalStorage('./scratch4') test.equals(local.getItem('junk'), null) local._de...
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
a2f00fc1e207c477910dd6636c7d9e678bc1d6d7
460
https://github.com/lmaccherone/node-localstorage/blob/a2f00fc1e207c477910dd6636c7d9e678bc1d6d7/test/LocalStorageTest.coffee
59
81
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:1:raw_corpus
raw_corpus
{LocalStorage} = require('../') repeat = (string, count) -> a = [] while count-- a.push(string) return a.join('') exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage.location, './scratch') localStorage.setItem('/', 'so...
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
64933b79423134ae9fb3e325cbdd204771cec222
460
https://github.com/lmaccherone/node-localstorage/blob/64933b79423134ae9fb3e325cbdd204771cec222/test/LocalStorageTest.coffee
1
50
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript {LocalStorage} = require('../') repeat = (string, count) -> a = [] while count-- a.push(string) return a.join('') exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage.l...
var LocalStorage, repeat; ({LocalStorage} = require('../')); repeat = function(string, count) { var a; a = []; while (count--) { a.push(string); } return a.join(''); }; exports.LocalStorageTest = { testLocalStorage: function(test) { var a, localStorage, o; localStorage = new LocalStorage('./s...
CoffeeScript
JavaScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
64933b79423134ae9fb3e325cbdd204771cec222
460
https://github.com/lmaccherone/node-localstorage/blob/64933b79423134ae9fb3e325cbdd204771cec222/test/LocalStorageTest.coffee
1
50
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var LocalStorage, repeat; ({LocalStorage} = require('../')); repeat = function(string, count) { var a; a = []; while (count--) { a.push(string); } return a.join(''); }; exports.LocalStorageTest = { testLocalStorage: function(test) { var a, lo...
{LocalStorage} = require('../') repeat = (string, count) -> a = [] while count-- a.push(string) return a.join('') exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage.location, './scratch') localStorage.setItem('/', 'so...
JavaScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
64933b79423134ae9fb3e325cbdd204771cec222
460
https://github.com/lmaccherone/node-localstorage/blob/64933b79423134ae9fb3e325cbdd204771cec222/test/LocalStorageTest.coffee
1
50
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:1:completion
completion
{LocalStorage} = require('../') repeat = (string, count) -> a = [] while count-- a.push(string) return a.join('') exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage.location, './scratch') localStorage.setItem('/', 'so...
test.deepEqual(localStorage.keys, ['/', '2']) test.equal(localStorage.length, 2) localStorage.removeItem('2') test.equal(localStorage.getItem('2'), null) test.deepEqual(localStorage.keys, ['/']) test.equal(localStorage.length, 1) test.equal(localStorage.key(0), '/') localStorage.clear() ...
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
64933b79423134ae9fb3e325cbdd204771cec222
460
https://github.com/lmaccherone/node-localstorage/blob/64933b79423134ae9fb3e325cbdd204771cec222/test/LocalStorageTest.coffee
1
50
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:2:raw_corpus
raw_corpus
ls.setItem(2, n1000) ls.setItem(3, n1000) test.equal(ls.getBytesInUse(), 3000) f = () -> ls.setItem(6, n10) test.throws(f, Error) ls.setItem(2, n1000) # Should not throw because it replaces one of equal size ls.removeItem(3) ls.setItem(7, n100) f2 = () -> ls.setitem(8, n1...
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
64933b79423134ae9fb3e325cbdd204771cec222
460
https://github.com/lmaccherone/node-localstorage/blob/64933b79423134ae9fb3e325cbdd204771cec222/test/LocalStorageTest.coffee
51
75
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:2:completion
completion
ls.setItem(2, n1000) ls.setItem(3, n1000) test.equal(ls.getBytesInUse(), 3000) f = () -> ls.setItem(6, n10) test.throws(f, Error) ls.setItem(2, n1000) # Should not throw because it replaces one of equal size ls.removeItem(3) ls.setItem(7, n100)
f2 = () -> ls.setitem(8, n1000) test.throws(f2, Error) ls._deleteLocation() test.done() testNoNewKeyword: (test) -> local = LocalStorage('./scratch3') local.setItem('Hello', ' world!') test.equals(local.getItem('Hello'), ' world!') local._deleteLocation() test.done()
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
64933b79423134ae9fb3e325cbdd204771cec222
460
https://github.com/lmaccherone/node-localstorage/blob/64933b79423134ae9fb3e325cbdd204771cec222/test/LocalStorageTest.coffee
51
75
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:2:raw_corpus
raw_corpus
ls.setItem(2, n1000) ls.setItem(3, n1000) test.equal(ls.getBytesInUse(), 3000) f = () -> ls.setItem(6, n10) test.throws(f, Error) ls.setItem(2, n1000) # Should not throw because it replaces one of equal size ls.removeItem(3) ls.setItem(7, n100) f2 = () -> ls.setitem(8, n1...
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
e7c2987706045ecf8be28474bfdbd7e821bc81dc
460
https://github.com/lmaccherone/node-localstorage/blob/e7c2987706045ecf8be28474bfdbd7e821bc81dc/test/LocalStorageTest.coffee
51
73
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:2:completion
completion
ls.setItem(2, n1000) ls.setItem(3, n1000) test.equal(ls.getBytesInUse(), 3000) f = () -> ls.setItem(6, n10) test.throws(f, Error) ls.setItem(2, n1000) # Should not throw because it replaces one of equal size ls.removeItem(3)
ls.setItem(7, n100) f2 = () -> ls.setitem(8, n1000) test.throws(f2, Error) ls._deleteLocation() test.done() testNoNewKeyword: (test) -> local = LocalStorage('./scratch3') local._deleteLocation() test.done()
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
e7c2987706045ecf8be28474bfdbd7e821bc81dc
460
https://github.com/lmaccherone/node-localstorage/blob/e7c2987706045ecf8be28474bfdbd7e821bc81dc/test/LocalStorageTest.coffee
51
73
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:2:raw_corpus
raw_corpus
ls.setItem(2, n1000) ls.setItem(3, n1000) test.equal(ls.getBytesInUse(), 3000) f = () -> ls.setItem(6, n10) test.throws(f, Error) ls.setItem(2, n1000) # Should not throw because it replaces one of equal size ls.removeItem(3) ls.setItem(7, n100) f2 = () -> ls.setitem(8, n1...
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
74d767313058f5a3de86e644fef892788213930d
460
https://github.com/lmaccherone/node-localstorage/blob/74d767313058f5a3de86e644fef892788213930d/test/LocalStorageTest.coffee
51
68
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:2:completion
completion
ls.setItem(2, n1000) ls.setItem(3, n1000) test.equal(ls.getBytesInUse(), 3000) f = () -> ls.setItem(6, n10) test.throws(f, Error) ls.setItem(2, n1000) # Should not throw because it replaces one of equal size
ls.removeItem(3) ls.setItem(7, n100) f2 = () -> ls.setitem(8, n1000) test.throws(f2, Error) ls._deleteLocation() test.done()
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
74d767313058f5a3de86e644fef892788213930d
460
https://github.com/lmaccherone/node-localstorage/blob/74d767313058f5a3de86e644fef892788213930d/test/LocalStorageTest.coffee
51
68
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:1:raw_corpus
raw_corpus
{LocalStorage} = require('../') repeat = (string, count) -> a = [] while count-- a.push(string) return a.join('') exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage.location, './scratch') localStorage.setItem('1', 'som...
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
b7878a0433eaa8dfc6b1dcdf0599d1ca8fa41f2f
460
https://github.com/lmaccherone/node-localstorage/blob/b7878a0433eaa8dfc6b1dcdf0599d1ca8fa41f2f/test/LocalStorageTest.coffee
1
50
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript {LocalStorage} = require('../') repeat = (string, count) -> a = [] while count-- a.push(string) return a.join('') exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage.l...
var LocalStorage, repeat; ({LocalStorage} = require('../')); repeat = function(string, count) { var a; a = []; while (count--) { a.push(string); } return a.join(''); }; exports.LocalStorageTest = { testLocalStorage: function(test) { var a, localStorage, o; localStorage = new LocalStorage('./s...
CoffeeScript
JavaScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
b7878a0433eaa8dfc6b1dcdf0599d1ca8fa41f2f
460
https://github.com/lmaccherone/node-localstorage/blob/b7878a0433eaa8dfc6b1dcdf0599d1ca8fa41f2f/test/LocalStorageTest.coffee
1
50
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var LocalStorage, repeat; ({LocalStorage} = require('../')); repeat = function(string, count) { var a; a = []; while (count--) { a.push(string); } return a.join(''); }; exports.LocalStorageTest = { testLocalStorage: function(test) { var a, lo...
{LocalStorage} = require('../') repeat = (string, count) -> a = [] while count-- a.push(string) return a.join('') exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage.location, './scratch') localStorage.setItem('1', 'som...
JavaScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
b7878a0433eaa8dfc6b1dcdf0599d1ca8fa41f2f
460
https://github.com/lmaccherone/node-localstorage/blob/b7878a0433eaa8dfc6b1dcdf0599d1ca8fa41f2f/test/LocalStorageTest.coffee
1
50
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:1:completion
completion
{LocalStorage} = require('../') repeat = (string, count) -> a = [] while count-- a.push(string) return a.join('') exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage.location, './scratch') localStorage.setItem('1', 'som...
test.deepEqual(localStorage.keys, ['1', '2']) test.equal(localStorage.length, 2) localStorage.removeItem('2') test.equal(localStorage.getItem('2'), null) test.deepEqual(localStorage.keys, ['1']) test.equal(localStorage.length, 1) test.equal(localStorage.key(0), '1') localStorage.clear() ...
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
b7878a0433eaa8dfc6b1dcdf0599d1ca8fa41f2f
460
https://github.com/lmaccherone/node-localstorage/blob/b7878a0433eaa8dfc6b1dcdf0599d1ca8fa41f2f/test/LocalStorageTest.coffee
1
50
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:1:raw_corpus
raw_corpus
{LocalStorage} = require('../') exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage.location, './scratch') localStorage.setItem('1', 'something') test.equal(localStorage.getItem('1'), 'something') o = {a:1, b:'some string...
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
1091f489f623e333d3d70b2a12a93a680a6b22b7
460
https://github.com/lmaccherone/node-localstorage/blob/1091f489f623e333d3d70b2a12a93a680a6b22b7/test/LocalStorageTest.coffee
1
35
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript {LocalStorage} = require('../') exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage.location, './scratch') localStorage.setItem('1', 'something') test.equal(localStorage...
var LocalStorage; ({LocalStorage} = require('../')); exports.LocalStorageTest = { testLocalStorage: function(test) { var a, localStorage, o; localStorage = new LocalStorage('./scratch'); test.equal(localStorage.location, './scratch'); localStorage.setItem('1', 'something'); test.equal(localStora...
CoffeeScript
JavaScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
1091f489f623e333d3d70b2a12a93a680a6b22b7
460
https://github.com/lmaccherone/node-localstorage/blob/1091f489f623e333d3d70b2a12a93a680a6b22b7/test/LocalStorageTest.coffee
1
35
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var LocalStorage; ({LocalStorage} = require('../')); exports.LocalStorageTest = { testLocalStorage: function(test) { var a, localStorage, o; localStorage = new LocalStorage('./scratch'); test.equal(localStorage.location, './scratch'); localStora...
{LocalStorage} = require('../') exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage.location, './scratch') localStorage.setItem('1', 'something') test.equal(localStorage.getItem('1'), 'something') o = {a:1, b:'some string...
JavaScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
1091f489f623e333d3d70b2a12a93a680a6b22b7
460
https://github.com/lmaccherone/node-localstorage/blob/1091f489f623e333d3d70b2a12a93a680a6b22b7/test/LocalStorageTest.coffee
1
35
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:1:completion
completion
{LocalStorage} = require('../') exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage.location, './scratch') localStorage.setItem('1', 'something') test.equal(localStorage.getItem('1'), 'something') o = {a:1, b:'some string...
localStorage.setItem('2', a) test.deepEqual(localStorage.getItem('2'), a.toString()) test.deepEqual(localStorage.keys, ['1', '2']) test.equal(localStorage.length, 2) localStorage.removeItem('2') test.equal(localStorage.getItem('2'), null) test.deepEqual(localStorage.keys, ['1']) test.equa...
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
1091f489f623e333d3d70b2a12a93a680a6b22b7
460
https://github.com/lmaccherone/node-localstorage/blob/1091f489f623e333d3d70b2a12a93a680a6b22b7/test/LocalStorageTest.coffee
1
35
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:1:raw_corpus
raw_corpus
{LocalStorage} = require('../') exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage.location, './scratch') localStorage.setItem('1', 'something') test.equal(localStorage.getItem('1'), 'something') o = {a:1, b:'some string...
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
8aef258d128af2b4f4eb5d4e0cf639745fef238f
460
https://github.com/lmaccherone/node-localstorage/blob/8aef258d128af2b4f4eb5d4e0cf639745fef238f/test/LocalStorageTest.coffee
1
35
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript {LocalStorage} = require('../') exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage.location, './scratch') localStorage.setItem('1', 'something') test.equal(localStorage...
var LocalStorage; ({LocalStorage} = require('../')); exports.LocalStorageTest = { testLocalStorage: function(test) { var a, localStorage, o; localStorage = new LocalStorage('./scratch'); test.equal(localStorage.location, './scratch'); localStorage.setItem('1', 'something'); test.equal(localStora...
CoffeeScript
JavaScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
8aef258d128af2b4f4eb5d4e0cf639745fef238f
460
https://github.com/lmaccherone/node-localstorage/blob/8aef258d128af2b4f4eb5d4e0cf639745fef238f/test/LocalStorageTest.coffee
1
35
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var LocalStorage; ({LocalStorage} = require('../')); exports.LocalStorageTest = { testLocalStorage: function(test) { var a, localStorage, o; localStorage = new LocalStorage('./scratch'); test.equal(localStorage.location, './scratch'); localStora...
{LocalStorage} = require('../') exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage.location, './scratch') localStorage.setItem('1', 'something') test.equal(localStorage.getItem('1'), 'something') o = {a:1, b:'some string...
JavaScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
8aef258d128af2b4f4eb5d4e0cf639745fef238f
460
https://github.com/lmaccherone/node-localstorage/blob/8aef258d128af2b4f4eb5d4e0cf639745fef238f/test/LocalStorageTest.coffee
1
35
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:1:completion
completion
{LocalStorage} = require('../') exports.LocalStorageTest = testLocalStorage: (test) -> localStorage = new LocalStorage('./scratch') test.equal(localStorage.location, './scratch') localStorage.setItem('1', 'something') test.equal(localStorage.getItem('1'), 'something') o = {a:1, b:'some string...
localStorage.setItem('2', a) test.deepEqual(localStorage.getItem('2'), a.toString()) test.deepEqual(localStorage.keys, ['1', '2']) test.equal(localStorage.length, 2) localStorage.removeItem('2') test.equal(localStorage.getItem('2'), null) test.deepEqual(localStorage.keys, ['1']) test.equa...
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
8aef258d128af2b4f4eb5d4e0cf639745fef238f
460
https://github.com/lmaccherone/node-localstorage/blob/8aef258d128af2b4f4eb5d4e0cf639745fef238f/test/LocalStorageTest.coffee
1
35
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:1:raw_corpus
raw_corpus
{LocalStorage} = require("../") exports.LocalStorageTest = testConstruction: (test) -> temp = new LocalStorage('./scratch') test.equal(temp.location, './scratch') test.done()
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
b41bbbe96caef6e32b6ed5dcb328f737dc2dfd32
460
https://github.com/lmaccherone/node-localstorage/blob/b41bbbe96caef6e32b6ed5dcb328f737dc2dfd32/test/LocalStorageTest.coffee
1
7
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript {LocalStorage} = require("../") exports.LocalStorageTest = testConstruction: (test) -> temp = new LocalStorage('./scratch') test.equal(temp.location, './scratch') test.done() ```
var LocalStorage; ({LocalStorage} = require("../")); exports.LocalStorageTest = { testConstruction: function(test) { var temp; temp = new LocalStorage('./scratch'); test.equal(temp.location, './scratch'); return test.done(); } };
CoffeeScript
JavaScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
b41bbbe96caef6e32b6ed5dcb328f737dc2dfd32
460
https://github.com/lmaccherone/node-localstorage/blob/b41bbbe96caef6e32b6ed5dcb328f737dc2dfd32/test/LocalStorageTest.coffee
1
7
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var LocalStorage; ({LocalStorage} = require("../")); exports.LocalStorageTest = { testConstruction: function(test) { var temp; temp = new LocalStorage('./scratch'); test.equal(temp.location, './scratch'); return test.done(); } }; ```
{LocalStorage} = require("../") exports.LocalStorageTest = testConstruction: (test) -> temp = new LocalStorage('./scratch') test.equal(temp.location, './scratch') test.done()
JavaScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
b41bbbe96caef6e32b6ed5dcb328f737dc2dfd32
460
https://github.com/lmaccherone/node-localstorage/blob/b41bbbe96caef6e32b6ed5dcb328f737dc2dfd32/test/LocalStorageTest.coffee
1
7
lmaccherone/node-localstorage:test/LocalStorageTest.coffee:1:completion
completion
{LocalStorage} = require("../") exports.LocalStorageTest =
testConstruction: (test) -> temp = new LocalStorage('./scratch') test.equal(temp.location, './scratch') test.done()
CoffeeScript
CoffeeScript
lmaccherone/node-localstorage
test/LocalStorageTest.coffee
MIT
b41bbbe96caef6e32b6ed5dcb328f737dc2dfd32
460
https://github.com/lmaccherone/node-localstorage/blob/b41bbbe96caef6e32b6ed5dcb328f737dc2dfd32/test/LocalStorageTest.coffee
1
7
xhan/qqbot:plugins/help.coffee:1:raw_corpus
raw_corpus
### 插件支持两个方法调用 init(robot) received(content,send,robot,message) stop(robot) 1.直接使用 module.exports = func 为快捷隐式调用 received 方法 2.或 module.exports = { init: init_func # 初始化调用 received: received_func # 接受消息 stop: init_func # 停止插件(比如端口占用) } ### HELP_INFO = """ version/about...
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0
1,435
https://github.com/xhan/qqbot/blob/f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0/plugins/help.coffee
1
50
xhan/qqbot:plugins/help.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript ### 插件支持两个方法调用 init(robot) received(content,send,robot,message) stop(robot) 1.直接使用 module.exports = func 为快捷隐式调用 received 方法 2.或 module.exports = { init: init_func # 初始化调用 received: received_func # 接受消息 stop: init_func #...
/* 插件支持两个方法调用 init(robot) received(content,send,robot,message) stop(robot) 1.直接使用 module.exports = func 为快捷隐式调用 received 方法 2.或 module.exports = { init: init_func # 初始化调用 received: received_func # 接受消息 stop: init_func # 停止插件(比如端口占用) } */ var HELP_INFO, Path, VERSION_INFO, bu...
CoffeeScript
JavaScript
xhan/qqbot
plugins/help.coffee
MIT
f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0
1,435
https://github.com/xhan/qqbot/blob/f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0/plugins/help.coffee
1
50
xhan/qqbot:plugins/help.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript /* 插件支持两个方法调用 init(robot) received(content,send,robot,message) stop(robot) 1.直接使用 module.exports = func 为快捷隐式调用 received 方法 2.或 module.exports = { init: init_func # 初始化调用 received: received_func # 接受消息 stop: init_func # 停止...
### 插件支持两个方法调用 init(robot) received(content,send,robot,message) stop(robot) 1.直接使用 module.exports = func 为快捷隐式调用 received 方法 2.或 module.exports = { init: init_func # 初始化调用 received: received_func # 接受消息 stop: init_func # 停止插件(比如端口占用) } ### HELP_INFO = """ version/about...
JavaScript
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0
1,435
https://github.com/xhan/qqbot/blob/f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0/plugins/help.coffee
1
50
xhan/qqbot:plugins/help.coffee:1:completion
completion
### 插件支持两个方法调用 init(robot) received(content,send,robot,message) stop(robot) 1.直接使用 module.exports = func 为快捷隐式调用 received 方法 2.或 module.exports = { init: init_func # 初始化调用 received: received_func # 接受消息 stop: init_func # 停止插件(比如端口占用) } ### HELP_INFO = """ version/about...
help #本内容 uptime #服务运行时间 roll #返回1-100随机值 """ fs = require 'fs' Path = require 'path' file_path = Path.join __dirname, "..", "package.json" bundle = JSON.parse( fs.readFileSync file_path ) VERSION_INFO = """ v#{bundle.version} qqbot http://github.com/xhan/qqbot 本工具还由...
CoffeeScript
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0
1,435
https://github.com/xhan/qqbot/blob/f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0/plugins/help.coffee
1
50
xhan/qqbot:plugins/help.coffee:2:raw_corpus
raw_corpus
if content.match /^help$/i send HELP_INFO if content.match /^VERSION|ABOUT$/i send VERSION_INFO if content.match /^plugins$/i send "插件列表:\n" + robot.dispatcher.plugins.join('\r\n') if content.match /^time$/i send "冥王星引力精准校时:" + new Date() if ret = content.match /^echo (.*)/i send ret[1] ...
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0
1,435
https://github.com/xhan/qqbot/blob/f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0/plugins/help.coffee
51
76
xhan/qqbot:plugins/help.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript if content.match /^help$/i send HELP_INFO if content.match /^VERSION|ABOUT$/i send VERSION_INFO if content.match /^plugins$/i send "插件列表:\n" + robot.dispatcher.plugins.join('\r\n') if content.match /^time$/i send "冥王星引力精准校时:" + new Date()...
var aday, ahour, day, hour, memory, minute, ret, second, secs, t; if (content.match(/^help$/i)) { send(HELP_INFO); } if (content.match(/^VERSION|ABOUT$/i)) { send(VERSION_INFO); } if (content.match(/^plugins$/i)) { send("插件列表:\n" + robot.dispatcher.plugins.join('\r\n')); } if (content.match(/^time$/i)) { se...
CoffeeScript
JavaScript
xhan/qqbot
plugins/help.coffee
MIT
f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0
1,435
https://github.com/xhan/qqbot/blob/f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0/plugins/help.coffee
51
76
xhan/qqbot:plugins/help.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var aday, ahour, day, hour, memory, minute, ret, second, secs, t; if (content.match(/^help$/i)) { send(HELP_INFO); } if (content.match(/^VERSION|ABOUT$/i)) { send(VERSION_INFO); } if (content.match(/^plugins$/i)) { send("插件列表:\n" + robot.dispatcher.plugins...
if content.match /^help$/i send HELP_INFO if content.match /^VERSION|ABOUT$/i send VERSION_INFO if content.match /^plugins$/i send "插件列表:\n" + robot.dispatcher.plugins.join('\r\n') if content.match /^time$/i send "冥王星引力精准校时:" + new Date() if ret = content.match /^echo (.*)/i send ret[1] ...
JavaScript
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0
1,435
https://github.com/xhan/qqbot/blob/f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0/plugins/help.coffee
51
76
xhan/qqbot:plugins/help.coffee:2:completion
completion
if content.match /^help$/i send HELP_INFO if content.match /^VERSION|ABOUT$/i send VERSION_INFO if content.match /^plugins$/i send "插件列表:\n" + robot.dispatcher.plugins.join('\r\n') if content.match /^time$/i send "冥王星引力精准校时:" + new Date() if ret = content.match /^echo (.*)/i
send ret[1] if content.match /^uptime$/i secs = process.uptime() [aday,ahour] = [86400 ,3600] [day,hour,minute,second] = [secs/ aday,secs%aday/ ahour,secs%ahour/ 60,secs%60].map (i)-> parseInt(i) t = (i)-> "0#{i}"[-2..] # 让时间更漂亮 memory = process.memoryUsage().rss / 1024 / 1024 send "up #{da...
CoffeeScript
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0
1,435
https://github.com/xhan/qqbot/blob/f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0/plugins/help.coffee
51
76
xhan/qqbot:plugins/help.coffee:2:raw_corpus
raw_corpus
if content.match /^help$/i send HELP_INFO if content.match /^VERSION|ABOUT$/i send VERSION_INFO if content.match /^plugins$/i send "插件列表:\n" + robot.dispatcher.plugins.join('\r\n') if content.match /^time$/i send "冥王星引力精准校时:" + new Date() ret = content.match /^echo (.*)/i if ret send "...
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
778493a91538100afe2c2a07af05382ded3dfa06
1,435
https://github.com/xhan/qqbot/blob/778493a91538100afe2c2a07af05382ded3dfa06/plugins/help.coffee
51
77
xhan/qqbot:plugins/help.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript if content.match /^help$/i send HELP_INFO if content.match /^VERSION|ABOUT$/i send VERSION_INFO if content.match /^plugins$/i send "插件列表:\n" + robot.dispatcher.plugins.join('\r\n') if content.match /^time$/i send "冥王星引力精准校时:" + new Date()...
var aday, ahour, day, hour, memory, minute, ret, second, secs, t; if (content.match(/^help$/i)) { send(HELP_INFO); } if (content.match(/^VERSION|ABOUT$/i)) { send(VERSION_INFO); } if (content.match(/^plugins$/i)) { send("插件列表:\n" + robot.dispatcher.plugins.join('\r\n')); } if (content.match(/^time$/i)) { se...
CoffeeScript
JavaScript
xhan/qqbot
plugins/help.coffee
MIT
778493a91538100afe2c2a07af05382ded3dfa06
1,435
https://github.com/xhan/qqbot/blob/778493a91538100afe2c2a07af05382ded3dfa06/plugins/help.coffee
51
77
xhan/qqbot:plugins/help.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var aday, ahour, day, hour, memory, minute, ret, second, secs, t; if (content.match(/^help$/i)) { send(HELP_INFO); } if (content.match(/^VERSION|ABOUT$/i)) { send(VERSION_INFO); } if (content.match(/^plugins$/i)) { send("插件列表:\n" + robot.dispatcher.plugins...
if content.match /^help$/i send HELP_INFO if content.match /^VERSION|ABOUT$/i send VERSION_INFO if content.match /^plugins$/i send "插件列表:\n" + robot.dispatcher.plugins.join('\r\n') if content.match /^time$/i send "冥王星引力精准校时:" + new Date() ret = content.match /^echo (.*)/i if ret send "...
JavaScript
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
778493a91538100afe2c2a07af05382ded3dfa06
1,435
https://github.com/xhan/qqbot/blob/778493a91538100afe2c2a07af05382ded3dfa06/plugins/help.coffee
51
77
xhan/qqbot:plugins/help.coffee:2:completion
completion
if content.match /^help$/i send HELP_INFO if content.match /^VERSION|ABOUT$/i send VERSION_INFO if content.match /^plugins$/i send "插件列表:\n" + robot.dispatcher.plugins.join('\r\n') if content.match /^time$/i send "冥王星引力精准校时:" + new Date() ret = content.match /^echo (.*)/i
if ret send "哈哈," + ret[1] if content.match /^uptime$/i secs = process.uptime() [aday,ahour] = [86400 ,3600] [day,hour,minute,second] = [secs/ aday,secs%aday/ ahour,secs%ahour/ 60,secs%60].map (i)-> parseInt(i) t = (i)-> "0#{i}"[-2..] # 让时间更漂亮 memory = process.memoryUsage().rss / 1024 / 102...
CoffeeScript
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
778493a91538100afe2c2a07af05382ded3dfa06
1,435
https://github.com/xhan/qqbot/blob/778493a91538100afe2c2a07af05382ded3dfa06/plugins/help.coffee
51
77
xhan/qqbot:plugins/help.coffee:1:raw_corpus
raw_corpus
### 插件支持两个方法调用 init(robot) received(content,send,robot,message) stop(robot) 1.直接使用 module.exports = func 为快捷隐式调用 received 方法 2.或 module.exports = { init: init_func # 初始化调用 received: received_func # 接受消息 stop: init_func # 停止插件(比如端口占用) } ### HELP_INFO = """ version/about...
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
6e3b13406fa75d37d27f8d8f633da808c6ded5d4
1,435
https://github.com/xhan/qqbot/blob/6e3b13406fa75d37d27f8d8f633da808c6ded5d4/plugins/help.coffee
1
50
xhan/qqbot:plugins/help.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript ### 插件支持两个方法调用 init(robot) received(content,send,robot,message) stop(robot) 1.直接使用 module.exports = func 为快捷隐式调用 received 方法 2.或 module.exports = { init: init_func # 初始化调用 received: received_func # 接受消息 stop: init_func #...
/* 插件支持两个方法调用 init(robot) received(content,send,robot,message) stop(robot) 1.直接使用 module.exports = func 为快捷隐式调用 received 方法 2.或 module.exports = { init: init_func # 初始化调用 received: received_func # 接受消息 stop: init_func # 停止插件(比如端口占用) } */ var HELP_INFO, Path, VERSION_INFO, bu...
CoffeeScript
JavaScript
xhan/qqbot
plugins/help.coffee
MIT
6e3b13406fa75d37d27f8d8f633da808c6ded5d4
1,435
https://github.com/xhan/qqbot/blob/6e3b13406fa75d37d27f8d8f633da808c6ded5d4/plugins/help.coffee
1
50
xhan/qqbot:plugins/help.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript /* 插件支持两个方法调用 init(robot) received(content,send,robot,message) stop(robot) 1.直接使用 module.exports = func 为快捷隐式调用 received 方法 2.或 module.exports = { init: init_func # 初始化调用 received: received_func # 接受消息 stop: init_func # 停止...
### 插件支持两个方法调用 init(robot) received(content,send,robot,message) stop(robot) 1.直接使用 module.exports = func 为快捷隐式调用 received 方法 2.或 module.exports = { init: init_func # 初始化调用 received: received_func # 接受消息 stop: init_func # 停止插件(比如端口占用) } ### HELP_INFO = """ version/about...
JavaScript
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
6e3b13406fa75d37d27f8d8f633da808c6ded5d4
1,435
https://github.com/xhan/qqbot/blob/6e3b13406fa75d37d27f8d8f633da808c6ded5d4/plugins/help.coffee
1
50
xhan/qqbot:plugins/help.coffee:1:completion
completion
### 插件支持两个方法调用 init(robot) received(content,send,robot,message) stop(robot) 1.直接使用 module.exports = func 为快捷隐式调用 received 方法 2.或 module.exports = { init: init_func # 初始化调用 received: received_func # 接受消息 stop: init_func # 停止插件(比如端口占用) } ### HELP_INFO = """ version/about...
uptime #服务运行时间 roll #返回1-100随机值 """ fs = require 'fs' Path = require 'path' file_path = Path.join __dirname, "..", "package.json" bundle = JSON.parse( fs.readFileSync file_path ) VERSION_INFO = """ v#{bundle.version} qqbot http://github.com/xhan/qqbot 本工具还由 糗事百科 热血赞助! """ # 毫秒亲 st...
CoffeeScript
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
6e3b13406fa75d37d27f8d8f633da808c6ded5d4
1,435
https://github.com/xhan/qqbot/blob/6e3b13406fa75d37d27f8d8f633da808c6ded5d4/plugins/help.coffee
1
50
xhan/qqbot:plugins/help.coffee:2:raw_corpus
raw_corpus
module.exports = (content ,send, robot, message)-> if content.match /^help$/i send HELP_INFO if content.match /^VERSION|ABOUT$/i send VERSION_INFO if content.match /^plugins$/i send "插件列表:\n" + robot.dispatcher.plugins.join('\r\n') if content.match /^time$/i send "冥王星引力精准校时:" + new Date() ...
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
6e3b13406fa75d37d27f8d8f633da808c6ded5d4
1,435
https://github.com/xhan/qqbot/blob/6e3b13406fa75d37d27f8d8f633da808c6ded5d4/plugins/help.coffee
51
78
xhan/qqbot:plugins/help.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript module.exports = (content ,send, robot, message)-> if content.match /^help$/i send HELP_INFO if content.match /^VERSION|ABOUT$/i send VERSION_INFO if content.match /^plugins$/i send "插件列表:\n" + robot.dispatcher.plugins.join('\r\n') if cont...
module.exports = function(content, send, robot, message) { var aday, ahour, day, hour, minute, ret, second, secs; if (content.match(/^help$/i)) { send(HELP_INFO); } if (content.match(/^VERSION|ABOUT$/i)) { send(VERSION_INFO); } if (content.match(/^plugins$/i)) { send("插件列表:\n" + robot.dispatcher...
CoffeeScript
JavaScript
xhan/qqbot
plugins/help.coffee
MIT
6e3b13406fa75d37d27f8d8f633da808c6ded5d4
1,435
https://github.com/xhan/qqbot/blob/6e3b13406fa75d37d27f8d8f633da808c6ded5d4/plugins/help.coffee
51
78
xhan/qqbot:plugins/help.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript module.exports = function(content, send, robot, message) { var aday, ahour, day, hour, minute, ret, second, secs; if (content.match(/^help$/i)) { send(HELP_INFO); } if (content.match(/^VERSION|ABOUT$/i)) { send(VERSION_INFO); } if (content.match...
module.exports = (content ,send, robot, message)-> if content.match /^help$/i send HELP_INFO if content.match /^VERSION|ABOUT$/i send VERSION_INFO if content.match /^plugins$/i send "插件列表:\n" + robot.dispatcher.plugins.join('\r\n') if content.match /^time$/i send "冥王星引力精准校时:" + new Date() ...
JavaScript
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
6e3b13406fa75d37d27f8d8f633da808c6ded5d4
1,435
https://github.com/xhan/qqbot/blob/6e3b13406fa75d37d27f8d8f633da808c6ded5d4/plugins/help.coffee
51
78
xhan/qqbot:plugins/help.coffee:2:completion
completion
module.exports = (content ,send, robot, message)-> if content.match /^help$/i send HELP_INFO if content.match /^VERSION|ABOUT$/i send VERSION_INFO if content.match /^plugins$/i send "插件列表:\n" + robot.dispatcher.plugins.join('\r\n') if content.match /^time$/i send "冥王星引力精准校时:" + new Date()
ret = content.match /^echo (.*)/i if ret send "哈哈," + ret[1] if content.match /^uptime$/i secs = (new Date().getTime() - start_at) / 1000 aday = 86400 ahour = 3600 [day,hour,minute,second] = [secs/ aday,secs%aday/ ahour,secs%ahour/ 60,secs%60].map (i)-> parseInt(i) send "up #{day} days, #{...
CoffeeScript
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
6e3b13406fa75d37d27f8d8f633da808c6ded5d4
1,435
https://github.com/xhan/qqbot/blob/6e3b13406fa75d37d27f8d8f633da808c6ded5d4/plugins/help.coffee
51
78
xhan/qqbot:plugins/help.coffee:1:raw_corpus
raw_corpus
### 插件支持两个方法调用 init(robot) received(content,send,robot,message) 1.直接使用 module.exports = func 为快捷隐式调用 received 方法 2.或 module.exports = { init: init_func received: received_func } 3.或 exports.init = func exports.received = func ### HELP_INFO = """ version/about #版本信息和关于 plugins ...
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
c7369241f204f07177201d042ee30ba4e882f4a6
1,435
https://github.com/xhan/qqbot/blob/c7369241f204f07177201d042ee30ba4e882f4a6/plugins/help.coffee
1
50
xhan/qqbot:plugins/help.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript ### 插件支持两个方法调用 init(robot) received(content,send,robot,message) 1.直接使用 module.exports = func 为快捷隐式调用 received 方法 2.或 module.exports = { init: init_func received: received_func } 3.或 exports.init = func exports.received = func ### HELP_I...
/* 插件支持两个方法调用 init(robot) received(content,send,robot,message) 1.直接使用 module.exports = func 为快捷隐式调用 received 方法 2.或 module.exports = { init: init_func received: received_func } 3.或 exports.init = func exports.received = func */ var HELP_INFO, Path, VERSION_INFO, bundle, file_path, fs, start_at;...
CoffeeScript
JavaScript
xhan/qqbot
plugins/help.coffee
MIT
c7369241f204f07177201d042ee30ba4e882f4a6
1,435
https://github.com/xhan/qqbot/blob/c7369241f204f07177201d042ee30ba4e882f4a6/plugins/help.coffee
1
50
xhan/qqbot:plugins/help.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript /* 插件支持两个方法调用 init(robot) received(content,send,robot,message) 1.直接使用 module.exports = func 为快捷隐式调用 received 方法 2.或 module.exports = { init: init_func received: received_func } 3.或 exports.init = func exports.received = func */ var HELP_INF...
### 插件支持两个方法调用 init(robot) received(content,send,robot,message) 1.直接使用 module.exports = func 为快捷隐式调用 received 方法 2.或 module.exports = { init: init_func received: received_func } 3.或 exports.init = func exports.received = func ### HELP_INFO = """ version/about #版本信息和关于 plugins ...
JavaScript
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
c7369241f204f07177201d042ee30ba4e882f4a6
1,435
https://github.com/xhan/qqbot/blob/c7369241f204f07177201d042ee30ba4e882f4a6/plugins/help.coffee
1
50
xhan/qqbot:plugins/help.coffee:1:completion
completion
### 插件支持两个方法调用 init(robot) received(content,send,robot,message) 1.直接使用 module.exports = func 为快捷隐式调用 received 方法 2.或 module.exports = { init: init_func received: received_func } 3.或 exports.init = func exports.received = func ### HELP_INFO = """ version/about #版本信息和关于 plugins ...
echo 爱你 #重复后面的话 help #本内容 uptime #服务运行时间 roll #返回1-100随机值 """ fs = require 'fs' Path = require 'path' file_path = Path.join __dirname, "..", "package.json" bundle = JSON.parse( fs.readFileSync file_path ) VERSION_INFO = """ v#{bundle.version} qqbot http://gith...
CoffeeScript
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
c7369241f204f07177201d042ee30ba4e882f4a6
1,435
https://github.com/xhan/qqbot/blob/c7369241f204f07177201d042ee30ba4e882f4a6/plugins/help.coffee
1
50
xhan/qqbot:plugins/help.coffee:2:raw_corpus
raw_corpus
# IMPROVE: 方式不优雅,应该是一个模式识别成功,别的就不应调用到 module.exports = (content ,send, robot, message)-> if content.match /^help$/i send HELP_INFO if content.match /^VERSION|ABOUT$/i send VERSION_INFO if content.match /^plugins$/i send "插件列表:\n" + robot.dispatcher.plugins.join('\r\n') if content.match /^time$/i...
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
c7369241f204f07177201d042ee30ba4e882f4a6
1,435
https://github.com/xhan/qqbot/blob/c7369241f204f07177201d042ee30ba4e882f4a6/plugins/help.coffee
51
79
xhan/qqbot:plugins/help.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript # IMPROVE: 方式不优雅,应该是一个模式识别成功,别的就不应调用到 module.exports = (content ,send, robot, message)-> if content.match /^help$/i send HELP_INFO if content.match /^VERSION|ABOUT$/i send VERSION_INFO if content.match /^plugins$/i send "插件列表:\n" + robot.disp...
// IMPROVE: 方式不优雅,应该是一个模式识别成功,别的就不应调用到 module.exports = function(content, send, robot, message) { var aday, ahour, day, hour, minute, ret, second, secs; if (content.match(/^help$/i)) { send(HELP_INFO); } if (content.match(/^VERSION|ABOUT$/i)) { send(VERSION_INFO); } if (content.match(/^plugins$/i)) ...
CoffeeScript
JavaScript
xhan/qqbot
plugins/help.coffee
MIT
c7369241f204f07177201d042ee30ba4e882f4a6
1,435
https://github.com/xhan/qqbot/blob/c7369241f204f07177201d042ee30ba4e882f4a6/plugins/help.coffee
51
79
xhan/qqbot:plugins/help.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript // IMPROVE: 方式不优雅,应该是一个模式识别成功,别的就不应调用到 module.exports = function(content, send, robot, message) { var aday, ahour, day, hour, minute, ret, second, secs; if (content.match(/^help$/i)) { send(HELP_INFO); } if (content.match(/^VERSION|ABOUT$/i)) { send...
# IMPROVE: 方式不优雅,应该是一个模式识别成功,别的就不应调用到 module.exports = (content ,send, robot, message)-> if content.match /^help$/i send HELP_INFO if content.match /^VERSION|ABOUT$/i send VERSION_INFO if content.match /^plugins$/i send "插件列表:\n" + robot.dispatcher.plugins.join('\r\n') if content.match /^time$/i...
JavaScript
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
c7369241f204f07177201d042ee30ba4e882f4a6
1,435
https://github.com/xhan/qqbot/blob/c7369241f204f07177201d042ee30ba4e882f4a6/plugins/help.coffee
51
79
xhan/qqbot:plugins/help.coffee:2:completion
completion
# IMPROVE: 方式不优雅,应该是一个模式识别成功,别的就不应调用到 module.exports = (content ,send, robot, message)-> if content.match /^help$/i send HELP_INFO if content.match /^VERSION|ABOUT$/i send VERSION_INFO if content.match /^plugins$/i send "插件列表:\n" + robot.dispatcher.plugins.join('\r\n') if content.match /^time$/i...
ret = content.match /^echo (.*)/i if ret send "哈哈," + ret[1] if content.match /^uptime$/i secs = (new Date().getTime() - start_at) / 1000 aday = 86400 ahour = 3600 [day,hour,minute,second] = [secs/ aday,secs%aday/ ahour,secs%ahour/ 60,secs%60].map (i)-> parseInt(i) send "up #{day} days, #{...
CoffeeScript
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
c7369241f204f07177201d042ee30ba4e882f4a6
1,435
https://github.com/xhan/qqbot/blob/c7369241f204f07177201d042ee30ba4e882f4a6/plugins/help.coffee
51
79
xhan/qqbot:plugins/help.coffee:1:raw_corpus
raw_corpus
HELP_INFO = """ version/about #版本信息和关于 plugins #查看载入的插件 time #显示时间 echo 爱你 #重复后面的话 help #本内容 uptime #服务运行时间 roll #返回1-100随机值 """ fs = require 'fs' Path = require 'path' file_path = Path.join __dirname, "..", "package.json" bundle = ...
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
23faf53772809523abe8df7f796dd6ab1cae5f91
1,435
https://github.com/xhan/qqbot/blob/23faf53772809523abe8df7f796dd6ab1cae5f91/plugins/help.coffee
1
50
xhan/qqbot:plugins/help.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript HELP_INFO = """ version/about #版本信息和关于 plugins #查看载入的插件 time #显示时间 echo 爱你 #重复后面的话 help #本内容 uptime #服务运行时间 roll #返回1-100随机值 """ fs = require 'fs' Path = require 'path' file_p...
var HELP_INFO, Path, VERSION_INFO, bundle, file_path, fs, start_at; HELP_INFO = `version/about #版本信息和关于 plugins #查看载入的插件 time #显示时间 echo 爱你 #重复后面的话 help #本内容 uptime #服务运行时间 roll #返回1-100随机值`; fs = require('fs'); Path = require('path'); file_path = Path.join...
CoffeeScript
JavaScript
xhan/qqbot
plugins/help.coffee
MIT
23faf53772809523abe8df7f796dd6ab1cae5f91
1,435
https://github.com/xhan/qqbot/blob/23faf53772809523abe8df7f796dd6ab1cae5f91/plugins/help.coffee
1
50
xhan/qqbot:plugins/help.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var HELP_INFO, Path, VERSION_INFO, bundle, file_path, fs, start_at; HELP_INFO = `version/about #版本信息和关于 plugins #查看载入的插件 time #显示时间 echo 爱你 #重复后面的话 help #本内容 uptime #服务运行时间 roll #返回1-100随机值`; fs = require...
HELP_INFO = """ version/about #版本信息和关于 plugins #查看载入的插件 time #显示时间 echo 爱你 #重复后面的话 help #本内容 uptime #服务运行时间 roll #返回1-100随机值 """ fs = require 'fs' Path = require 'path' file_path = Path.join __dirname, "..", "package.json" bundle = ...
JavaScript
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
23faf53772809523abe8df7f796dd6ab1cae5f91
1,435
https://github.com/xhan/qqbot/blob/23faf53772809523abe8df7f796dd6ab1cae5f91/plugins/help.coffee
1
50
xhan/qqbot:plugins/help.coffee:1:completion
completion
HELP_INFO = """ version/about #版本信息和关于 plugins #查看载入的插件 time #显示时间 echo 爱你 #重复后面的话 help #本内容 uptime #服务运行时间 roll #返回1-100随机值 """ fs = require 'fs' Path = require 'path' file_path = Path.join __dirname, "..", "package.json" bundle = ...
@param send(content) 回复消息 @param robot qqbot instance @param message 原消息对象 ### # 问题:方式不优雅,应该是一个模式识别成功,别的就不应调用到 module.exports = (content ,send, robot, message)-> if content.match /^help$/i send HELP_INFO if content.match /^VERSION|ABOUT$/i send VERSION_INFO if content.match /^plugins$/...
CoffeeScript
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
23faf53772809523abe8df7f796dd6ab1cae5f91
1,435
https://github.com/xhan/qqbot/blob/23faf53772809523abe8df7f796dd6ab1cae5f91/plugins/help.coffee
1
50
xhan/qqbot:plugins/help.coffee:2:raw_corpus
raw_corpus
if ret send "哈哈," + ret[1] if content.match /^uptime$/i secs = (new Date().getTime() - start_at) / 1000 aday = 86400 ahour = 3600 [day,hour,minute,second] = [secs/ aday,secs%aday/ ahour,secs%ahour/ 60,secs%60].map (i)-> parseInt(i) send "up #{day} days, #{hour}:#{minute}:#{se...
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
23faf53772809523abe8df7f796dd6ab1cae5f91
1,435
https://github.com/xhan/qqbot/blob/23faf53772809523abe8df7f796dd6ab1cae5f91/plugins/help.coffee
51
63
xhan/qqbot:plugins/help.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript if ret send "哈哈," + ret[1] if content.match /^uptime$/i secs = (new Date().getTime() - start_at) / 1000 aday = 86400 ahour = 3600 [day,hour,minute,second] = [secs/ aday,secs%aday/ ahour,secs%ahour/ 60,secs%60].map (i)-> parse...
var aday, ahour, day, hour, minute, second, secs; if (ret) { send("哈哈," + ret[1]); } if (content.match(/^uptime$/i)) { secs = (new Date().getTime() - start_at) / 1000; aday = 86400; ahour = 3600; [day, hour, minute, second] = [secs / aday, secs % aday / ahour, secs % ahour / 60, secs % 60].map(function(i) {...
CoffeeScript
JavaScript
xhan/qqbot
plugins/help.coffee
MIT
23faf53772809523abe8df7f796dd6ab1cae5f91
1,435
https://github.com/xhan/qqbot/blob/23faf53772809523abe8df7f796dd6ab1cae5f91/plugins/help.coffee
51
63
xhan/qqbot:plugins/help.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var aday, ahour, day, hour, minute, second, secs; if (ret) { send("哈哈," + ret[1]); } if (content.match(/^uptime$/i)) { secs = (new Date().getTime() - start_at) / 1000; aday = 86400; ahour = 3600; [day, hour, minute, second] = [secs / aday, secs % aday /...
if ret send "哈哈," + ret[1] if content.match /^uptime$/i secs = (new Date().getTime() - start_at) / 1000 aday = 86400 ahour = 3600 [day,hour,minute,second] = [secs/ aday,secs%aday/ ahour,secs%ahour/ 60,secs%60].map (i)-> parseInt(i) send "up #{day} days, #{hour}:#{minute}:#{se...
JavaScript
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
23faf53772809523abe8df7f796dd6ab1cae5f91
1,435
https://github.com/xhan/qqbot/blob/23faf53772809523abe8df7f796dd6ab1cae5f91/plugins/help.coffee
51
63
xhan/qqbot:plugins/help.coffee:2:completion
completion
if ret send "哈哈," + ret[1] if content.match /^uptime$/i secs = (new Date().getTime() - start_at) / 1000 aday = 86400
ahour = 3600 [day,hour,minute,second] = [secs/ aday,secs%aday/ ahour,secs%ahour/ 60,secs%60].map (i)-> parseInt(i) send "up #{day} days, #{hour}:#{minute}:#{second}" if content.match /^roll$/i # TODO:who? , need a reply method send Math.round( Math.random() * 100)
CoffeeScript
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
23faf53772809523abe8df7f796dd6ab1cae5f91
1,435
https://github.com/xhan/qqbot/blob/23faf53772809523abe8df7f796dd6ab1cae5f91/plugins/help.coffee
51
63
xhan/qqbot:plugins/help.coffee:1:raw_corpus
raw_corpus
HELP_INFO = """ version/about #版本信息和关于 plugins #查看载入的插件 time #显示时间 echo 爱你 #重复后面的话 help #本内容 uptime #服务运行时间 """ fs = require 'fs' Path = require 'path' file_path = Path.join __dirname, "..", "package.json" bundle = JSON.parse( fs.readFileSync file...
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
6297be6e8fcbd529ef55a9533ea6e659e6b684f4
1,435
https://github.com/xhan/qqbot/blob/6297be6e8fcbd529ef55a9533ea6e659e6b684f4/plugins/help.coffee
1
50
xhan/qqbot:plugins/help.coffee:1:completion
completion
HELP_INFO = """ version/about #版本信息和关于 plugins #查看载入的插件 time #显示时间 echo 爱你 #重复后面的话 help #本内容 uptime #服务运行时间 """ fs = require 'fs' Path = require 'path' file_path = Path.join __dirname, "..", "package.json" bundle = JSON.parse( fs.readFileSync file...
@param robot qqbot instance @param message 原消息对象 ### # 问题:方式不优雅,应该是一个模式识别成功,别的就不应调用到 module.exports = (content ,send, robot, message)-> if content.match /^help$/i send HELP_INFO if content.match /^VERSION|ABOUT$/i send VERSION_INFO if content.match /^plugins$/i send "插件列表:\n" + r...
CoffeeScript
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
6297be6e8fcbd529ef55a9533ea6e659e6b684f4
1,435
https://github.com/xhan/qqbot/blob/6297be6e8fcbd529ef55a9533ea6e659e6b684f4/plugins/help.coffee
1
50
xhan/qqbot:plugins/help.coffee:2:raw_corpus
raw_corpus
send "哈哈," + ret[1] if content.match /^uptime$/i secs = (new Date().getTime() - start_at) / 1000 aday = 86400 ahour = 3600 [day,hour,minute,second] = [secs/ aday,secs%aday/ ahour,secs%ahour/ 60,secs%60].map (i)-> parseInt(i) send "up #{day} days, #{hour}:#{minute}:#{second}"
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
6297be6e8fcbd529ef55a9533ea6e659e6b684f4
1,435
https://github.com/xhan/qqbot/blob/6297be6e8fcbd529ef55a9533ea6e659e6b684f4/plugins/help.coffee
51
58
xhan/qqbot:plugins/help.coffee:2:completion
completion
send "哈哈," + ret[1] if content.match /^uptime$/i secs = (new Date().getTime() - start_at) / 1000
aday = 86400 ahour = 3600 [day,hour,minute,second] = [secs/ aday,secs%aday/ ahour,secs%ahour/ 60,secs%60].map (i)-> parseInt(i) send "up #{day} days, #{hour}:#{minute}:#{second}"
CoffeeScript
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
6297be6e8fcbd529ef55a9533ea6e659e6b684f4
1,435
https://github.com/xhan/qqbot/blob/6297be6e8fcbd529ef55a9533ea6e659e6b684f4/plugins/help.coffee
51
58
xhan/qqbot:plugins/help.coffee:2:raw_corpus
raw_corpus
send "哈哈," + ret[1] if content.match /^uptime$/i secs = (new Date().getTime() - start_at) / 1000 aday = 86400 ahour = 3600 [day,hour,minute,second] = [secs/ aday,secs%aday/ ahour,secs%ahour/ 60,sec%60].map (i)-> parseInt(i) send "up #{day} days, #{hour}:#{minute}:#{second}"
CoffeeScript
xhan/qqbot
plugins/help.coffee
MIT
44be5ffe9e72a7275465e53a52d76d7037dadbe5
1,435
https://github.com/xhan/qqbot/blob/44be5ffe9e72a7275465e53a52d76d7037dadbe5/plugins/help.coffee
51
58