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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
kelp404/angular-form-builder:test/karma-ng1.2.config.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = (config) ->
config.set
# base path, that will be used to resolve files and exclude
basePath: '../'
frameworks: ['jasmine']
# list of files / patterns to load in the browser
files: [
'test/... | module.exports = function(config) {
return config.set({
// base path, that will be used to resolve files and exclude
basePath: '../',
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: ['test/lib/angularjs/angular.1.2.1.min.js', 'test/lib/angularjs/angular-mocks.1.2... | CoffeeScript | JavaScript | kelp404/angular-form-builder | test/karma-ng1.2.config.coffee | MIT | 3a1dd7a01867e4514894aa6c4a0ad8f1c72426d6 | 600 | https://github.com/kelp404/angular-form-builder/blob/3a1dd7a01867e4514894aa6c4a0ad8f1c72426d6/test/karma-ng1.2.config.coffee | 1 | 50 |
kelp404/angular-form-builder:test/karma-ng1.2.config.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function(config) {
return config.set({
// base path, that will be used to resolve files and exclude
basePath: '../',
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: ['test/lib/angularjs/angul... | module.exports = (config) ->
config.set
# base path, that will be used to resolve files and exclude
basePath: '../'
frameworks: ['jasmine']
# list of files / patterns to load in the browser
files: [
'test/lib/angularjs/angular.1.2.1.min.js'
'test/lib... | JavaScript | CoffeeScript | kelp404/angular-form-builder | test/karma-ng1.2.config.coffee | MIT | 3a1dd7a01867e4514894aa6c4a0ad8f1c72426d6 | 600 | https://github.com/kelp404/angular-form-builder/blob/3a1dd7a01867e4514894aa6c4a0ad8f1c72426d6/test/karma-ng1.2.config.coffee | 1 | 50 |
kelp404/angular-form-builder:test/karma-ng1.2.config.coffee:1:raw_corpus | raw_corpus | module.exports = (config) ->
config.set
# base path, that will be used to resolve files and exclude
basePath: '../'
frameworks: ['jasmine']
# list of files / patterns to load in the browser
files: [
'test/lib/angularjs/angular.1.2.1.min.js'
'test/lib... | CoffeeScript | kelp404/angular-form-builder | test/karma-ng1.2.config.coffee | MIT | d058a40a260aee650e370ef7b96059f72ac9455e | 600 | https://github.com/kelp404/angular-form-builder/blob/d058a40a260aee650e370ef7b96059f72ac9455e/test/karma-ng1.2.config.coffee | 1 | 50 | ||
kelp404/angular-form-builder:test/karma-ng1.2.config.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = (config) ->
config.set
# base path, that will be used to resolve files and exclude
basePath: '../'
frameworks: ['jasmine']
# list of files / patterns to load in the browser
files: [
'test/... | module.exports = function(config) {
return config.set({
// base path, that will be used to resolve files and exclude
basePath: '../',
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: ['test/lib/angularjs/angular.1.2.1.min.js', 'test/lib/angularjs/angular-mocks.1.2... | CoffeeScript | JavaScript | kelp404/angular-form-builder | test/karma-ng1.2.config.coffee | MIT | d058a40a260aee650e370ef7b96059f72ac9455e | 600 | https://github.com/kelp404/angular-form-builder/blob/d058a40a260aee650e370ef7b96059f72ac9455e/test/karma-ng1.2.config.coffee | 1 | 50 |
kelp404/angular-form-builder:test/karma-ng1.2.config.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function(config) {
return config.set({
// base path, that will be used to resolve files and exclude
basePath: '../',
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: ['test/lib/angularjs/angul... | module.exports = (config) ->
config.set
# base path, that will be used to resolve files and exclude
basePath: '../'
frameworks: ['jasmine']
# list of files / patterns to load in the browser
files: [
'test/lib/angularjs/angular.1.2.1.min.js'
'test/lib... | JavaScript | CoffeeScript | kelp404/angular-form-builder | test/karma-ng1.2.config.coffee | MIT | d058a40a260aee650e370ef7b96059f72ac9455e | 600 | https://github.com/kelp404/angular-form-builder/blob/d058a40a260aee650e370ef7b96059f72ac9455e/test/karma-ng1.2.config.coffee | 1 | 50 |
kelp404/angular-form-builder:test/karma-ng1.2.config.coffee:2:raw_corpus | raw_corpus | browsers: ['PhantomJS']
# If browser does not capture in given timeout [ms], kill it
# CLI --capture-timeout 5000
captureTimeout: 20000
# Auto run tests on start (when browsers are captured) and exit
# CLI --single-run --no-single-run
singleRun: yes
# report wh... | CoffeeScript | kelp404/angular-form-builder | test/karma-ng1.2.config.coffee | MIT | d058a40a260aee650e370ef7b96059f72ac9455e | 600 | https://github.com/kelp404/angular-form-builder/blob/d058a40a260aee650e370ef7b96059f72ac9455e/test/karma-ng1.2.config.coffee | 51 | 63 | ||
kelp404/angular-form-builder:test/karma-ng1.2.config.coffee:1:raw_corpus | raw_corpus | module.exports = (config) ->
config.set
# base path, that will be used to resolve files and exclude
basePath: '../'
frameworks: ['jasmine']
# list of files / patterns to load in the browser
files: [
'test/lib/angularjs/angular.1.2.0.min.js'
'test/lib... | CoffeeScript | kelp404/angular-form-builder | test/karma-ng1.2.config.coffee | MIT | f502c6fb8aa88574b23710afcc4b9dbdc9d51a52 | 600 | https://github.com/kelp404/angular-form-builder/blob/f502c6fb8aa88574b23710afcc4b9dbdc9d51a52/test/karma-ng1.2.config.coffee | 1 | 50 | ||
kelp404/angular-form-builder:test/karma-ng1.2.config.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = (config) ->
config.set
# base path, that will be used to resolve files and exclude
basePath: '../'
frameworks: ['jasmine']
# list of files / patterns to load in the browser
files: [
'test/... | module.exports = function(config) {
return config.set({
// base path, that will be used to resolve files and exclude
basePath: '../',
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: ['test/lib/angularjs/angular.1.2.0.min.js', 'test/lib/angularjs/angular-mocks.1.2... | CoffeeScript | JavaScript | kelp404/angular-form-builder | test/karma-ng1.2.config.coffee | MIT | f502c6fb8aa88574b23710afcc4b9dbdc9d51a52 | 600 | https://github.com/kelp404/angular-form-builder/blob/f502c6fb8aa88574b23710afcc4b9dbdc9d51a52/test/karma-ng1.2.config.coffee | 1 | 50 |
kelp404/angular-form-builder:test/karma-ng1.2.config.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function(config) {
return config.set({
// base path, that will be used to resolve files and exclude
basePath: '../',
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: ['test/lib/angularjs/angul... | module.exports = (config) ->
config.set
# base path, that will be used to resolve files and exclude
basePath: '../'
frameworks: ['jasmine']
# list of files / patterns to load in the browser
files: [
'test/lib/angularjs/angular.1.2.0.min.js'
'test/lib... | JavaScript | CoffeeScript | kelp404/angular-form-builder | test/karma-ng1.2.config.coffee | MIT | f502c6fb8aa88574b23710afcc4b9dbdc9d51a52 | 600 | https://github.com/kelp404/angular-form-builder/blob/f502c6fb8aa88574b23710afcc4b9dbdc9d51a52/test/karma-ng1.2.config.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee:2:raw_corpus | raw_corpus | url.search queryParams
# Format: https://github.com/mikeal/request#requestoptions-callback
proxyBody =
url: url.toString()
method: options.method || 'GET'
json: true
if options.options?
compiledOptions = _.compile(options.options, {})
... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | 42 | 80 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee:2:completion | completion | url.search queryParams
# Format: https://github.com/mikeal/request#requestoptions-callback
proxyBody =
url: url.toString()
method: options.method || 'GET'
json: true
if options.options?
compiledOptions = _.compile(options.options, {})
... | runner = (options) ->
q = $q.defer()
# Runner Failure
errorCallback = (error, status) ->
if error == '' && status == 0
# CORS error
error = 'Cross-Origin Resource Sharing error with the server.'
q.reject error
# Successful Resul... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | 42 | 80 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee:3:raw_corpus | raw_corpus | # Generate proxy URLs
proxyUri = new URI(_.jsExec(options.proxy) || configService.restServiceUrl)
.protocol '' # Remove protocol to work with either HTTP/HTTPS
.segment 'proxy' # Append /proxy endpoint
.toString()
# Do the request, wiring up success/failure handl... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | 82 | 97 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee:3:completion | completion | # Generate proxy URLs
proxyUri = new URI(_.jsExec(options.proxy) || configService.restServiceUrl)
.protocol '' # Remove protocol to work with either HTTP/HTTPS
.segment 'proxy' # Append /proxy endpoint
.toString()
# Do the request, wiring up success/failure handl... | # Add callback handlers to promise
req.success successCallback
req.error errorCallback
return q.promise
dataSourceFactory.create 'JSON', runner | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | 82 | 97 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee:2:raw_corpus | raw_corpus | url.search queryParams
# Format: https://github.com/mikeal/request#requestoptions-callback
proxyBody =
url: url.toString()
method: options.method || 'GET'
json: true
if options.options?
compiledOptions = _.compile(options.options, {})
... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | 42 | 80 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee:2:completion | completion | url.search queryParams
# Format: https://github.com/mikeal/request#requestoptions-callback
proxyBody =
url: url.toString()
method: options.method || 'GET'
json: true
if options.options?
compiledOptions = _.compile(options.options, {})
... | errorCallback = (error, status) ->
if error == '' && status == 0
# CORS error
error = 'Cross-Origin Resource Sharing error with the server.'
q.reject error
# Successful Result
successCallback = (result) ->
q.resolve
'... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | 42 | 80 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee:3:raw_corpus | raw_corpus | req = $http.post proxyUri, getProxyRequest(options)
# Add callback handlers to promise
req.success successCallback
req.error errorCallback
return q.promise
dataSourceFactory.create 'JSON', runner | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | 82 | 90 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee:3:completion | completion | req = $http.post proxyUri, getProxyRequest(options)
# Add callback handlers to promise
req.success successCallback | req.error errorCallback
return q.promise
dataSourceFactory.create 'JSON', runner | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | 82 | 90 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee:2:raw_corpus | raw_corpus | url.search queryParams
# Format: https://github.com/mikeal/request#requestoptions-callback
proxyBody =
url: url.toString()
method: options.method || 'GET'
json: true
if options.options?
compiledOptions = _.compile(options.options, {})
... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | MIT | e6c2d6b6ba251383102913db30400f783b64f049 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/e6c2d6b6ba251383102913db30400f783b64f049/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | 42 | 83 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee:2:completion | completion | url.search queryParams
# Format: https://github.com/mikeal/request#requestoptions-callback
proxyBody =
url: url.toString()
method: options.method || 'GET'
json: true
if options.options?
compiledOptions = _.compile(options.options, {})
... | # CORS error
error = 'Cross-Origin Resource Sharing error with the server.'
q.reject error
# Successful Result
successCallback = (result) ->
q.resolve
'0':
data: result.body
columns: null
# Do the... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | MIT | e6c2d6b6ba251383102913db30400f783b64f049 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/e6c2d6b6ba251383102913db30400f783b64f049/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | 42 | 83 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee:2:raw_corpus | raw_corpus | url.search queryParams
# Format: https://github.com/mikeal/request#requestoptions-callback
body =
url: url.toString()
method: options.method || 'GET'
json: true
if options.options?
compiledOptions = _.compile(options.options, {})
_.as... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | 42 | 83 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee:2:completion | completion | url.search queryParams
# Format: https://github.com/mikeal/request#requestoptions-callback
body =
url: url.toString()
method: options.method || 'GET'
json: true
if options.options?
compiledOptions = _.compile(options.options, {})
_.as... | # CORS error
error = 'Cross-Origin Resource Sharing error with the server.'
q.reject error
# Successful Result
successCallback = (result) ->
q.resolve
'0':
data: result.body
columns: null
# Do the... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.json.coffee | 42 | 83 |
rs/pushd:tests/device.coffee:1:raw_corpus | raw_corpus | createDevice = (proto, regid, cb) ->
info = {proto: proto, regid: regid}
redisClient = redis.createClient()
try
device.createDevice redisClient, info, cb
catch e
redisClient.quit()
throw e | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 5 | 12 | ||
rs/pushd:tests/device.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
createDevice = (proto, regid, cb) ->
info = {proto: proto, regid: regid}
redisClient = redis.createClient()
try
device.createDevice redisClient, info, cb
catch e
redisClient.quit()
throw e
``` | var createDevice;
createDevice = function(proto, regid, cb) {
var e, info, redisClient;
info = {
proto: proto,
regid: regid
};
redisClient = redis.createClient();
try {
return device.createDevice(redisClient, info, cb);
} catch (error) {
e = error;
redisClient.quit();
throw e;
}
}... | CoffeeScript | JavaScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 5 | 12 |
rs/pushd:tests/device.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var createDevice;
createDevice = function(proto, regid, cb) {
var e, info, redisClient;
info = {
proto: proto,
regid: regid
};
redisClient = redis.createClient();
try {
return device.createDevice(redisClient, info, cb);
} catch (error) {
... | createDevice = (proto, regid, cb) ->
info = {proto: proto, regid: regid}
redisClient = redis.createClient()
try
device.createDevice redisClient, info, cb
catch e
redisClient.quit()
throw e | JavaScript | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 5 | 12 |
rs/pushd:tests/device.coffee:1:completion | completion | createDevice = (proto, regid, cb) ->
info = {proto: proto, regid: regid}
redisClient = redis.createClient()
try | device.createDevice redisClient, info, cb
catch e
redisClient.quit()
throw e | CoffeeScript | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 5 | 12 |
rs/pushd:tests/device.coffee:2:raw_corpus | raw_corpus | exports.testCreateDevice = (test) ->
test.expect(2)
createDevice 'apns', 'FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660', (newDevice) =>
test.ok newDevice isnt null, 'Device created'
test.ok newDevice.id isnt null, 'Device has id'
newDevice.delete =>
newDev... | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 15 | 22 | ||
rs/pushd:tests/device.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.testCreateDevice = (test) ->
test.expect(2)
createDevice 'apns', 'FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660', (newDevice) =>
test.ok newDevice isnt null, 'Device created'
test.ok newDevice.id isnt null, 'Devi... | exports.testCreateDevice = function(test) {
test.expect(2);
return createDevice('apns', 'FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660', (newDevice) => {
test.ok(newDevice !== null, 'Device created');
test.ok(newDevice.id !== null, 'Device has id');
return newDevice.delete(() => {
... | CoffeeScript | JavaScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 15 | 22 |
rs/pushd:tests/device.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.testCreateDevice = function(test) {
test.expect(2);
return createDevice('apns', 'FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660', (newDevice) => {
test.ok(newDevice !== null, 'Device created');
test.ok(newDevice.id !== null, 'D... | exports.testCreateDevice = (test) ->
test.expect(2)
createDevice 'apns', 'FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660', (newDevice) =>
test.ok newDevice isnt null, 'Device created'
test.ok newDevice.id isnt null, 'Device has id'
newDevice.delete =>
newDev... | JavaScript | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 15 | 22 |
rs/pushd:tests/device.coffee:2:completion | completion | exports.testCreateDevice = (test) ->
test.expect(2)
createDevice 'apns', 'FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660', (newDevice) =>
test.ok newDevice isnt null, 'Device created' | test.ok newDevice.id isnt null, 'Device has id'
newDevice.delete =>
newDevice.redis.quit()
test.done() | CoffeeScript | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 15 | 22 |
rs/pushd:tests/device.coffee:3:raw_corpus | raw_corpus | exports.testCreateDeviceWithInvalidRegid = (test) ->
test.expect(2)
regids =
[
'FE66489F304DC75B8D6E8200DFF8A4 56E8DAEACEC428B427E9518741C92C6660'
'invalid$'
]
for regid in regids
test.throws =>
createDevice 'apns', regid, =>
, Error, "Cannot create device... | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 24 | 35 | ||
rs/pushd:tests/device.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.testCreateDeviceWithInvalidRegid = (test) ->
test.expect(2)
regids =
[
'FE66489F304DC75B8D6E8200DFF8A4 56E8DAEACEC428B427E9518741C92C6660'
'invalid$'
]
for regid in regids
test.throws =>
createDevice... | exports.testCreateDeviceWithInvalidRegid = function(test) {
var i, len, regid, regids;
test.expect(2);
regids = ['FE66489F304DC75B8D6E8200DFF8A4 56E8DAEACEC428B427E9518741C92C6660', 'invalid$'];
for (i = 0, len = regids.length; i < len; i++) {
regid = regids[i];
test.throws(() => {
return createDe... | CoffeeScript | JavaScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 24 | 35 |
rs/pushd:tests/device.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.testCreateDeviceWithInvalidRegid = function(test) {
var i, len, regid, regids;
test.expect(2);
regids = ['FE66489F304DC75B8D6E8200DFF8A4 56E8DAEACEC428B427E9518741C92C6660', 'invalid$'];
for (i = 0, len = regids.length; i < len; i++) {
regid = r... | exports.testCreateDeviceWithInvalidRegid = (test) ->
test.expect(2)
regids =
[
'FE66489F304DC75B8D6E8200DFF8A4 56E8DAEACEC428B427E9518741C92C6660'
'invalid$'
]
for regid in regids
test.throws =>
createDevice 'apns', regid, =>
, Error, "Cannot create device... | JavaScript | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 24 | 35 |
rs/pushd:tests/device.coffee:3:completion | completion | exports.testCreateDeviceWithInvalidRegid = (test) ->
test.expect(2)
regids =
[
'FE66489F304DC75B8D6E8200DFF8A4 56E8DAEACEC428B427E9518741C92C6660'
'invalid$' | ]
for regid in regids
test.throws =>
createDevice 'apns', regid, =>
, Error, "Cannot create device with invalid regid: #{regid}"
test.done() | CoffeeScript | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 24 | 35 |
rs/pushd:tests/device.coffee:4:raw_corpus | raw_corpus | exports.device =
setUp: (cb) ->
createDevice 'apns', 'FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660', (@device, @created, @tentatives) =>
cb()
tearDown: (cb) ->
@device.delete =>
@device.redis.quit()
cb()
testReregister: (test) ->
... | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 38 | 87 | ||
rs/pushd:tests/device.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.device =
setUp: (cb) ->
createDevice 'apns', 'FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660', (@device, @created, @tentatives) =>
cb()
tearDown: (cb) ->
@device.delete =>
@device.redis.qu... | exports.device = {
setUp: function(cb) {
return createDevice('apns', 'FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660', (device1, created1, tentatives1) => {
this.device = device1;
this.created = created1;
this.tentatives = tentatives1;
return cb();
});
},
tearDown... | CoffeeScript | JavaScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 38 | 87 |
rs/pushd:tests/device.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.device = {
setUp: function(cb) {
return createDevice('apns', 'FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660', (device1, created1, tentatives1) => {
this.device = device1;
this.created = created1;
this.tentatives = ... | exports.device =
setUp: (cb) ->
createDevice 'apns', 'FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660', (@device, @created, @tentatives) =>
cb()
tearDown: (cb) ->
@device.delete =>
@device.redis.quit()
cb()
testReregister: (test) ->
... | JavaScript | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 38 | 87 |
rs/pushd:tests/device.coffee:4:completion | completion | exports.device =
setUp: (cb) ->
createDevice 'apns', 'FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660', (@device, @created, @tentatives) =>
cb()
tearDown: (cb) ->
@device.delete =>
@device.redis.quit()
cb()
testReregister: (test) ->
... | test.equal @tentatives, 0, 'Device created with not retry'
device.getDeviceFromRegId @device.redis, 'apns', 'FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660', (dev) =>
test.equal dev.id, @device.id, 'Get instance from getid get the same device'
device.getDeviceFromRegId ... | CoffeeScript | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 38 | 87 |
rs/pushd:tests/device.coffee:5:raw_corpus | raw_corpus | device.getDevice(@device.redis, 'invalidid').incr 'badge', (value) =>
test.ok value is null, 'Cannot increment field of an unexisting device'
@device.incr 'badge', (value) =>
test.equal value, 1, 'Increment unexisting field starts at 1'
@device.incr 'badge', (valu... | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 88 | 137 | ||
rs/pushd:tests/device.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
device.getDevice(@device.redis, 'invalidid').incr 'badge', (value) =>
test.ok value is null, 'Cannot increment field of an unexisting device'
@device.incr 'badge', (value) =>
test.equal value, 1, 'Increment unexisting field... | device.getDevice(this.device.redis, 'invalidid').incr('badge', (value) => {
test.ok(value === null, 'Cannot increment field of an unexisting device');
return this.device.incr('badge', (value) => {
test.equal(value, 1, 'Increment unexisting field starts at 1');
return this.device.incr('badge', (value) => {
... | CoffeeScript | JavaScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 88 | 137 |
rs/pushd:tests/device.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
device.getDevice(this.device.redis, 'invalidid').incr('badge', (value) => {
test.ok(value === null, 'Cannot increment field of an unexisting device');
return this.device.incr('badge', (value) => {
test.equal(value, 1, 'Increment unexisting field starts at 1... | device.getDevice(@device.redis, 'invalidid').incr 'badge', (value) =>
test.ok value is null, 'Cannot increment field of an unexisting device'
@device.incr 'badge', (value) =>
test.equal value, 1, 'Increment unexisting field starts at 1'
@device.incr 'badge', (valu... | JavaScript | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 88 | 137 |
rs/pushd:tests/device.coffee:5:completion | completion | device.getDevice(@device.redis, 'invalidid').incr 'badge', (value) =>
test.ok value is null, 'Cannot increment field of an unexisting device'
@device.incr 'badge', (value) =>
test.equal value, 1, 'Increment unexisting field starts at 1'
@device.incr 'badge', (valu... | @device.delete (deleted) =>
test.ok deleted is false, 'Already deleted'
@device.get (fields) =>
test.equal fields, null, 'No longer exists'
test.done()
testGetSubscription: (test) ->
test.expect(9)
testEvent = event.getEvent(@d... | CoffeeScript | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 88 | 137 |
rs/pushd:tests/device.coffee:6:raw_corpus | raw_corpus | test.done()
testAddSubscription: (test) ->
test.expect(4)
testEvent = event.getEvent(@redis, null, 'unit-test' + Math.round(Math.random() * 100000))
test.equal @tentatives, 0, 'Device created with not retry'
device.getDevice(@device.redis, 'invalidid').addSubscription testEvent, 0,... | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 138 | 166 | ||
rs/pushd:tests/device.coffee:6:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test.done()
testAddSubscription: (test) ->
test.expect(4)
testEvent = event.getEvent(@redis, null, 'unit-test' + Math.round(Math.random() * 100000))
test.equal @tentatives, 0, 'Device created with not retry'
device.getDevice(... | test.done()({
testAddSubscription: function(test) {
var testEvent;
test.expect(4);
testEvent = event.getEvent(this.redis, null, 'unit-test' + Math.round(Math.random() * 100000));
test.equal(this.tentatives, 0, 'Device created with not retry');
return device.getDevice(this.device.redis, 'invalidid'... | CoffeeScript | JavaScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 138 | 166 |
rs/pushd:tests/device.coffee:6:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
test.done()({
testAddSubscription: function(test) {
var testEvent;
test.expect(4);
testEvent = event.getEvent(this.redis, null, 'unit-test' + Math.round(Math.random() * 100000));
test.equal(this.tentatives, 0, 'Device created with not retry');
... | test.done()
testAddSubscription: (test) ->
test.expect(4)
testEvent = event.getEvent(@redis, null, 'unit-test' + Math.round(Math.random() * 100000))
test.equal @tentatives, 0, 'Device created with not retry'
device.getDevice(@device.redis, 'invalidid').addSubscription testEvent, 0,... | JavaScript | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 138 | 166 |
rs/pushd:tests/device.coffee:6:completion | completion | test.done()
testAddSubscription: (test) ->
test.expect(4)
testEvent = event.getEvent(@redis, null, 'unit-test' + Math.round(Math.random() * 100000))
test.equal @tentatives, 0, 'Device created with not retry'
device.getDevice(@device.redis, 'invalidid').addSubscription testEvent, 0,... | testRemoveSubscription: (test) ->
test.expect(6)
testEvent = event.getEvent(@device.redis, null, 'unit-test' + Math.round(Math.random() * 100000))
test.equal @tentatives, 0, 'Device created with not retry'
device.getDevice(@device.redis, 'invalidid').removeSubscription testEvent, (remov... | CoffeeScript | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 9bca2082e55e362b913e84d71cde10bbd31f3a5a | 1,157 | https://github.com/rs/pushd/blob/9bca2082e55e362b913e84d71cde10bbd31f3a5a/tests/device.coffee | 138 | 166 |
rs/pushd:tests/device.coffee:4:raw_corpus | raw_corpus | exports.device =
setUp: (cb) ->
createDevice 'apns', 'FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660', (@device, @created, @tentatives) =>
cb()
tearDown: (cb) ->
@device.delete =>
@device.redis.quit()
cb()
testReregister: (test) ->
... | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d | 1,157 | https://github.com/rs/pushd/blob/528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d/tests/device.coffee | 38 | 87 | ||
rs/pushd:tests/device.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.device =
setUp: (cb) ->
createDevice 'apns', 'FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660', (@device, @created, @tentatives) =>
cb()
tearDown: (cb) ->
@device.delete =>
@device.redis.qu... | exports.device = {
setUp: function(cb) {
return createDevice('apns', 'FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660', (device1, created1, tentatives1) => {
this.device = device1;
this.created = created1;
this.tentatives = tentatives1;
return cb();
});
},
tearDown... | CoffeeScript | JavaScript | rs/pushd | tests/device.coffee | MIT | 528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d | 1,157 | https://github.com/rs/pushd/blob/528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d/tests/device.coffee | 38 | 87 |
rs/pushd:tests/device.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.device = {
setUp: function(cb) {
return createDevice('apns', 'FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660', (device1, created1, tentatives1) => {
this.device = device1;
this.created = created1;
this.tentatives = ... | exports.device =
setUp: (cb) ->
createDevice 'apns', 'FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660', (@device, @created, @tentatives) =>
cb()
tearDown: (cb) ->
@device.delete =>
@device.redis.quit()
cb()
testReregister: (test) ->
... | JavaScript | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d | 1,157 | https://github.com/rs/pushd/blob/528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d/tests/device.coffee | 38 | 87 |
rs/pushd:tests/device.coffee:4:completion | completion | exports.device =
setUp: (cb) ->
createDevice 'apns', 'FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660', (@device, @created, @tentatives) =>
cb()
tearDown: (cb) ->
@device.delete =>
@device.redis.quit()
cb()
testReregister: (test) ->
... | @device.get (fields) =>
test.notEqual fields, null, 'Returned fields are not null'
test.ok fields?.proto?, 'The proto field is present'
test.ok fields?.regid?, 'The regid field is present'
test.ok fields?.created?, 'The created field is present'
test.ok fields... | CoffeeScript | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d | 1,157 | https://github.com/rs/pushd/blob/528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d/tests/device.coffee | 38 | 87 |
rs/pushd:tests/device.coffee:5:raw_corpus | raw_corpus | @device.set {lang: 'us', badge: 5}, (edited) =>
test.ok edited, 'Edit return true'
@device.get (fields) =>
test.equal fields?.lang, 'us', 'Lang edited correctly'
test.equal fields?.badge, 5, 'Badge edited correctly'
test.done()
... | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d | 1,157 | https://github.com/rs/pushd/blob/528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d/tests/device.coffee | 88 | 137 | ||
rs/pushd:tests/device.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
@device.set {lang: 'us', badge: 5}, (edited) =>
test.ok edited, 'Edit return true'
@device.get (fields) =>
test.equal fields?.lang, 'us', 'Lang edited correctly'
test.equal fields?.badge, 5, ... | this.device.set({
lang: 'us',
badge: 5
}, (edited) => {
test.ok(edited, 'Edit return true');
return this.device.get((fields) => {
test.equal(fields != null ? fields.lang : void 0, 'us', 'Lang edited correctly');
test.equal(fields != null ? fields.badge : void 0, 5, 'Badge edited correctly');
return ... | CoffeeScript | JavaScript | rs/pushd | tests/device.coffee | MIT | 528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d | 1,157 | https://github.com/rs/pushd/blob/528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d/tests/device.coffee | 88 | 137 |
rs/pushd:tests/device.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.device.set({
lang: 'us',
badge: 5
}, (edited) => {
test.ok(edited, 'Edit return true');
return this.device.get((fields) => {
test.equal(fields != null ? fields.lang : void 0, 'us', 'Lang edited correctly');
test.equal(fields != null ? fields.ba... | @device.set {lang: 'us', badge: 5}, (edited) =>
test.ok edited, 'Edit return true'
@device.get (fields) =>
test.equal fields?.lang, 'us', 'Lang edited correctly'
test.equal fields?.badge, 5, 'Badge edited correctly'
test.done()
... | JavaScript | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d | 1,157 | https://github.com/rs/pushd/blob/528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d/tests/device.coffee | 88 | 137 |
rs/pushd:tests/device.coffee:5:completion | completion | @device.set {lang: 'us', badge: 5}, (edited) =>
test.ok edited, 'Edit return true'
@device.get (fields) =>
test.equal fields?.lang, 'us', 'Lang edited correctly'
test.equal fields?.badge, 5, 'Badge edited correctly'
test.done()
... | @device.getSubscriptions (subs) =>
test.equal subs.length, 0, 'Initially no subscriptions'
@device.addSubscription testEvent, 0, (added) =>
test.ok added is true, '1 subscription added'
@device.getSubscriptions (subs) =>
tes... | CoffeeScript | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d | 1,157 | https://github.com/rs/pushd/blob/528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d/tests/device.coffee | 88 | 137 |
rs/pushd:tests/device.coffee:6:raw_corpus | raw_corpus | testRemoveSubscription: (test) ->
test.expect(6)
testEvent = event.getEvent(@device.redis, null, 'unit-test' + Math.round(Math.random() * 100000))
test.equal @tentatives, 0, 'Device created with not retry'
device.getDevice(@device.redis, 'invalidid').removeSubscription testEvent, (remov... | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d | 1,157 | https://github.com/rs/pushd/blob/528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d/tests/device.coffee | 138 | 153 | ||
rs/pushd:tests/device.coffee:6:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
testRemoveSubscription: (test) ->
test.expect(6)
testEvent = event.getEvent(@device.redis, null, 'unit-test' + Math.round(Math.random() * 100000))
test.equal @tentatives, 0, 'Device created with not retry'
device.getDevice(@device... | ({
testRemoveSubscription: function(test) {
var testEvent;
test.expect(6);
testEvent = event.getEvent(this.device.redis, null, 'unit-test' + Math.round(Math.random() * 100000));
test.equal(this.tentatives, 0, 'Device created with not retry');
return device.getDevice(this.device.redis, 'invalidid')... | CoffeeScript | JavaScript | rs/pushd | tests/device.coffee | MIT | 528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d | 1,157 | https://github.com/rs/pushd/blob/528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d/tests/device.coffee | 138 | 153 |
rs/pushd:tests/device.coffee:6:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
testRemoveSubscription: function(test) {
var testEvent;
test.expect(6);
testEvent = event.getEvent(this.device.redis, null, 'unit-test' + Math.round(Math.random() * 100000));
test.equal(this.tentatives, 0, 'Device created with not retry');
... | testRemoveSubscription: (test) ->
test.expect(6)
testEvent = event.getEvent(@device.redis, null, 'unit-test' + Math.round(Math.random() * 100000))
test.equal @tentatives, 0, 'Device created with not retry'
device.getDevice(@device.redis, 'invalidid').removeSubscription testEvent, (remov... | JavaScript | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d | 1,157 | https://github.com/rs/pushd/blob/528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d/tests/device.coffee | 138 | 153 |
rs/pushd:tests/device.coffee:6:completion | completion | testRemoveSubscription: (test) ->
test.expect(6)
testEvent = event.getEvent(@device.redis, null, 'unit-test' + Math.round(Math.random() * 100000))
test.equal @tentatives, 0, 'Device created with not retry'
device.getDevice(@device.redis, 'invalidid').removeSubscription testEvent, (remov... | test.ok removed is false, 'Remove unexisting subscription'
@device.addSubscription testEvent, 0, (added) =>
test.ok added is true, 'Subscription added'
@device.removeSubscription testEvent, (removed) =>
test.ok removed is true, 'Subscriptio... | CoffeeScript | CoffeeScript | rs/pushd | tests/device.coffee | MIT | 528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d | 1,157 | https://github.com/rs/pushd/blob/528b1b2a332b9ac8ca2c1a2554944c5eaa35e40d/tests/device.coffee | 138 | 153 |
oozcitak/xmlbuilder-js:test/basic/instructions.coffee:1:raw_corpus | raw_corpus | suite 'Processing Instructions:', ->
test 'Simple', ->
eq(
xml('test17', { headless: true }).ins('pi', 'mypi').end()
'<test17><?pi mypi?></test17>'
)
test 'From object', ->
eq(
xml('test17', { headless: true }).ins({'pi': 'mypi', 'pi2': 'mypi2', 'pi3': null}).end()
'<test17><?pi... | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/instructions.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/instructions.coffee | 1 | 34 | ||
oozcitak/xmlbuilder-js:test/basic/instructions.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
suite 'Processing Instructions:', ->
test 'Simple', ->
eq(
xml('test17', { headless: true }).ins('pi', 'mypi').end()
'<test17><?pi mypi?></test17>'
)
test 'From object', ->
eq(
xml('test17', { headless: true }).ins({'pi': 'mypi'... | suite('Processing Instructions:', function() {
test('Simple', function() {
return eq(xml('test17', {
headless: true
}).ins('pi', 'mypi').end(), '<test17><?pi mypi?></test17>');
});
test('From object', function() {
return eq(xml('test17', {
headless: true
}).ins({
'pi': 'mypi',
... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | test/basic/instructions.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/instructions.coffee | 1 | 34 |
oozcitak/xmlbuilder-js:test/basic/instructions.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
suite('Processing Instructions:', function() {
test('Simple', function() {
return eq(xml('test17', {
headless: true
}).ins('pi', 'mypi').end(), '<test17><?pi mypi?></test17>');
});
test('From object', function() {
return eq(xml('test17', {
... | suite 'Processing Instructions:', ->
test 'Simple', ->
eq(
xml('test17', { headless: true }).ins('pi', 'mypi').end()
'<test17><?pi mypi?></test17>'
)
test 'From object', ->
eq(
xml('test17', { headless: true }).ins({'pi': 'mypi', 'pi2': 'mypi2', 'pi3': null}).end()
'<test17><?pi... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/instructions.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/instructions.coffee | 1 | 34 |
oozcitak/xmlbuilder-js:test/basic/instructions.coffee:1:completion | completion | suite 'Processing Instructions:', ->
test 'Simple', ->
eq(
xml('test17', { headless: true }).ins('pi', 'mypi').end()
'<test17><?pi mypi?></test17>'
)
test 'From object', ->
eq(
xml('test17', { headless: true }).ins({'pi': 'mypi', 'pi2': 'mypi2', 'pi3': null}).end()
'<test17><?pi... | )
test 'Complex', ->
eq(
xml('test18', { headless: true })
.ins('renderCache.subset', '"Verdana" 0 0 ISO-8859-1 4 268 67 "#(),-./')
.ins('pitarget', () -> 'pivalue')
.end()
'<test18><?renderCache.subset "Verdana" 0 0 ISO-8859-1 4 268 67 "#(),-./?><?pitarget pivalue?></test18>'... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/instructions.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/instructions.coffee | 1 | 34 |
linemanjs/lineman:lib/pretty-prints-value.coffee:1:raw_corpus | raw_corpus | _ = require("lodash")
replacer = (key, value) ->
if _.isFunction(value) then "[Function]" else value
module.exports =
prettyPrint: (value) ->
return value if _.isString(value)
try
JSON.stringify(value, replacer, indentation = 2)
catch e
value | CoffeeScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/pretty-prints-value.coffee | 1 | 12 | ||
linemanjs/lineman:lib/pretty-prints-value.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require("lodash")
replacer = (key, value) ->
if _.isFunction(value) then "[Function]" else value
module.exports =
prettyPrint: (value) ->
return value if _.isString(value)
try
JSON.stringify(value, replacer, indentation = 2)
catch e
... | var _, replacer;
_ = require("lodash");
replacer = function(key, value) {
if (_.isFunction(value)) {
return "[Function]";
} else {
return value;
}
};
module.exports = {
prettyPrint: function(value) {
var e, indentation;
if (_.isString(value)) {
return value;
}
try {
return... | CoffeeScript | JavaScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/pretty-prints-value.coffee | 1 | 12 |
linemanjs/lineman:lib/pretty-prints-value.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, replacer;
_ = require("lodash");
replacer = function(key, value) {
if (_.isFunction(value)) {
return "[Function]";
} else {
return value;
}
};
module.exports = {
prettyPrint: function(value) {
var e, indentation;
if (_.isString(val... | _ = require("lodash")
replacer = (key, value) ->
if _.isFunction(value) then "[Function]" else value
module.exports =
prettyPrint: (value) ->
return value if _.isString(value)
try
JSON.stringify(value, replacer, indentation = 2)
catch e
value | JavaScript | CoffeeScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/pretty-prints-value.coffee | 1 | 12 |
linemanjs/lineman:lib/pretty-prints-value.coffee:1:completion | completion | _ = require("lodash")
replacer = (key, value) ->
if _.isFunction(value) then "[Function]" else value
module.exports = | prettyPrint: (value) ->
return value if _.isString(value)
try
JSON.stringify(value, replacer, indentation = 2)
catch e
value | CoffeeScript | CoffeeScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | 61d681532d9621e578d319c279006bbb728ece4b | 1,168 | https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/lib/pretty-prints-value.coffee | 1 | 12 |
linemanjs/lineman:lib/pretty-prints-value.coffee:1:raw_corpus | raw_corpus | _ = require("lodash")
replacer = (key, value) ->
if _(value).isFunction() then "[Function]" else value
module.exports =
prettyPrint: (value) ->
return value if _(value).isString()
try
JSON.stringify(value, replacer, indentation = 2)
catch e
value | CoffeeScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | be78e1b054b006f23b49b0663164ae864b9b6cc1 | 1,168 | https://github.com/linemanjs/lineman/blob/be78e1b054b006f23b49b0663164ae864b9b6cc1/lib/pretty-prints-value.coffee | 1 | 12 | ||
linemanjs/lineman:lib/pretty-prints-value.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require("lodash")
replacer = (key, value) ->
if _(value).isFunction() then "[Function]" else value
module.exports =
prettyPrint: (value) ->
return value if _(value).isString()
try
JSON.stringify(value, replacer, indentation = 2)
catch ... | var _, replacer;
_ = require("lodash");
replacer = function(key, value) {
if (_(value).isFunction()) {
return "[Function]";
} else {
return value;
}
};
module.exports = {
prettyPrint: function(value) {
var e, indentation;
if (_(value).isString()) {
return value;
}
try {
re... | CoffeeScript | JavaScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | be78e1b054b006f23b49b0663164ae864b9b6cc1 | 1,168 | https://github.com/linemanjs/lineman/blob/be78e1b054b006f23b49b0663164ae864b9b6cc1/lib/pretty-prints-value.coffee | 1 | 12 |
linemanjs/lineman:lib/pretty-prints-value.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, replacer;
_ = require("lodash");
replacer = function(key, value) {
if (_(value).isFunction()) {
return "[Function]";
} else {
return value;
}
};
module.exports = {
prettyPrint: function(value) {
var e, indentation;
if (_(value).isS... | _ = require("lodash")
replacer = (key, value) ->
if _(value).isFunction() then "[Function]" else value
module.exports =
prettyPrint: (value) ->
return value if _(value).isString()
try
JSON.stringify(value, replacer, indentation = 2)
catch e
value | JavaScript | CoffeeScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | be78e1b054b006f23b49b0663164ae864b9b6cc1 | 1,168 | https://github.com/linemanjs/lineman/blob/be78e1b054b006f23b49b0663164ae864b9b6cc1/lib/pretty-prints-value.coffee | 1 | 12 |
linemanjs/lineman:lib/pretty-prints-value.coffee:1:completion | completion | _ = require("lodash")
replacer = (key, value) ->
if _(value).isFunction() then "[Function]" else value
module.exports = | prettyPrint: (value) ->
return value if _(value).isString()
try
JSON.stringify(value, replacer, indentation = 2)
catch e
value | CoffeeScript | CoffeeScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | be78e1b054b006f23b49b0663164ae864b9b6cc1 | 1,168 | https://github.com/linemanjs/lineman/blob/be78e1b054b006f23b49b0663164ae864b9b6cc1/lib/pretty-prints-value.coffee | 1 | 12 |
linemanjs/lineman:lib/pretty-prints-value.coffee:1:raw_corpus | raw_corpus | _ = require("lodash")
replacer = (key, value) ->
if _(value).isFunction() then "[Function]" else value
module.exports =
prettyPrint: (value) ->
try
JSON.stringify(value, replacer, indentation = 2)
catch e
value | CoffeeScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | 57dbe59a6ecac6ffb17b1cc8ea753c8ed5095759 | 1,168 | https://github.com/linemanjs/lineman/blob/57dbe59a6ecac6ffb17b1cc8ea753c8ed5095759/lib/pretty-prints-value.coffee | 1 | 11 | ||
linemanjs/lineman:lib/pretty-prints-value.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require("lodash")
replacer = (key, value) ->
if _(value).isFunction() then "[Function]" else value
module.exports =
prettyPrint: (value) ->
try
JSON.stringify(value, replacer, indentation = 2)
catch e
value
``` | var _, replacer;
_ = require("lodash");
replacer = function(key, value) {
if (_(value).isFunction()) {
return "[Function]";
} else {
return value;
}
};
module.exports = {
prettyPrint: function(value) {
var e, indentation;
try {
return JSON.stringify(value, replacer, indentation = 2);
... | CoffeeScript | JavaScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | 57dbe59a6ecac6ffb17b1cc8ea753c8ed5095759 | 1,168 | https://github.com/linemanjs/lineman/blob/57dbe59a6ecac6ffb17b1cc8ea753c8ed5095759/lib/pretty-prints-value.coffee | 1 | 11 |
linemanjs/lineman:lib/pretty-prints-value.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, replacer;
_ = require("lodash");
replacer = function(key, value) {
if (_(value).isFunction()) {
return "[Function]";
} else {
return value;
}
};
module.exports = {
prettyPrint: function(value) {
var e, indentation;
try {
retu... | _ = require("lodash")
replacer = (key, value) ->
if _(value).isFunction() then "[Function]" else value
module.exports =
prettyPrint: (value) ->
try
JSON.stringify(value, replacer, indentation = 2)
catch e
value | JavaScript | CoffeeScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | 57dbe59a6ecac6ffb17b1cc8ea753c8ed5095759 | 1,168 | https://github.com/linemanjs/lineman/blob/57dbe59a6ecac6ffb17b1cc8ea753c8ed5095759/lib/pretty-prints-value.coffee | 1 | 11 |
linemanjs/lineman:lib/pretty-prints-value.coffee:1:completion | completion | _ = require("lodash")
replacer = (key, value) ->
if _(value).isFunction() then "[Function]" else value | module.exports =
prettyPrint: (value) ->
try
JSON.stringify(value, replacer, indentation = 2)
catch e
value | CoffeeScript | CoffeeScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | 57dbe59a6ecac6ffb17b1cc8ea753c8ed5095759 | 1,168 | https://github.com/linemanjs/lineman/blob/57dbe59a6ecac6ffb17b1cc8ea753c8ed5095759/lib/pretty-prints-value.coffee | 1 | 11 |
linemanjs/lineman:lib/pretty-prints-value.coffee:1:raw_corpus | raw_corpus | _ = require("lodash")
replacer = (key, value) ->
if _(value).isFunction() then "[Function]" else value
module.exports =
prettyPrint: (value) ->
try
return JSON.stringify(value, replacer, indentation = 2)
catch e
value | CoffeeScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | c231b23cdc3baac831e64b6e777f520b23a9c1b5 | 1,168 | https://github.com/linemanjs/lineman/blob/c231b23cdc3baac831e64b6e777f520b23a9c1b5/lib/pretty-prints-value.coffee | 1 | 11 | ||
linemanjs/lineman:lib/pretty-prints-value.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require("lodash")
replacer = (key, value) ->
if _(value).isFunction() then "[Function]" else value
module.exports =
prettyPrint: (value) ->
try
return JSON.stringify(value, replacer, indentation = 2)
catch e
value
``` | var _, replacer;
_ = require("lodash");
replacer = function(key, value) {
if (_(value).isFunction()) {
return "[Function]";
} else {
return value;
}
};
module.exports = {
prettyPrint: function(value) {
var e, indentation;
try {
return JSON.stringify(value, replacer, indentation = 2);
... | CoffeeScript | JavaScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | c231b23cdc3baac831e64b6e777f520b23a9c1b5 | 1,168 | https://github.com/linemanjs/lineman/blob/c231b23cdc3baac831e64b6e777f520b23a9c1b5/lib/pretty-prints-value.coffee | 1 | 11 |
linemanjs/lineman:lib/pretty-prints-value.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, replacer;
_ = require("lodash");
replacer = function(key, value) {
if (_(value).isFunction()) {
return "[Function]";
} else {
return value;
}
};
module.exports = {
prettyPrint: function(value) {
var e, indentation;
try {
retu... | _ = require("lodash")
replacer = (key, value) ->
if _(value).isFunction() then "[Function]" else value
module.exports =
prettyPrint: (value) ->
try
return JSON.stringify(value, replacer, indentation = 2)
catch e
value | JavaScript | CoffeeScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | c231b23cdc3baac831e64b6e777f520b23a9c1b5 | 1,168 | https://github.com/linemanjs/lineman/blob/c231b23cdc3baac831e64b6e777f520b23a9c1b5/lib/pretty-prints-value.coffee | 1 | 11 |
linemanjs/lineman:lib/pretty-prints-value.coffee:1:completion | completion | _ = require("lodash")
replacer = (key, value) ->
if _(value).isFunction() then "[Function]" else value | module.exports =
prettyPrint: (value) ->
try
return JSON.stringify(value, replacer, indentation = 2)
catch e
value | CoffeeScript | CoffeeScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | c231b23cdc3baac831e64b6e777f520b23a9c1b5 | 1,168 | https://github.com/linemanjs/lineman/blob/c231b23cdc3baac831e64b6e777f520b23a9c1b5/lib/pretty-prints-value.coffee | 1 | 11 |
linemanjs/lineman:lib/pretty-prints-value.coffee:1:raw_corpus | raw_corpus | _ = require("lodash")
replacer = (key, value) ->
if _(value).isFunction() then "[Function]" else value
module.exports =
prettyPrint: (value) ->
return value unless _(value).isObject()
try
JSON.stringify(value, replacer, indentation = 2)
catch e
value | CoffeeScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | 5d2138d91b1fb9c079e668b02683356f40c4e449 | 1,168 | https://github.com/linemanjs/lineman/blob/5d2138d91b1fb9c079e668b02683356f40c4e449/lib/pretty-prints-value.coffee | 1 | 12 | ||
linemanjs/lineman:lib/pretty-prints-value.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require("lodash")
replacer = (key, value) ->
if _(value).isFunction() then "[Function]" else value
module.exports =
prettyPrint: (value) ->
return value unless _(value).isObject()
try
JSON.stringify(value, replacer, indentation = 2)
ca... | var _, replacer;
_ = require("lodash");
replacer = function(key, value) {
if (_(value).isFunction()) {
return "[Function]";
} else {
return value;
}
};
module.exports = {
prettyPrint: function(value) {
var e, indentation;
if (!_(value).isObject()) {
return value;
}
try {
r... | CoffeeScript | JavaScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | 5d2138d91b1fb9c079e668b02683356f40c4e449 | 1,168 | https://github.com/linemanjs/lineman/blob/5d2138d91b1fb9c079e668b02683356f40c4e449/lib/pretty-prints-value.coffee | 1 | 12 |
linemanjs/lineman:lib/pretty-prints-value.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, replacer;
_ = require("lodash");
replacer = function(key, value) {
if (_(value).isFunction()) {
return "[Function]";
} else {
return value;
}
};
module.exports = {
prettyPrint: function(value) {
var e, indentation;
if (!_(value).is... | _ = require("lodash")
replacer = (key, value) ->
if _(value).isFunction() then "[Function]" else value
module.exports =
prettyPrint: (value) ->
return value unless _(value).isObject()
try
JSON.stringify(value, replacer, indentation = 2)
catch e
value | JavaScript | CoffeeScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | 5d2138d91b1fb9c079e668b02683356f40c4e449 | 1,168 | https://github.com/linemanjs/lineman/blob/5d2138d91b1fb9c079e668b02683356f40c4e449/lib/pretty-prints-value.coffee | 1 | 12 |
linemanjs/lineman:lib/pretty-prints-value.coffee:1:completion | completion | _ = require("lodash")
replacer = (key, value) ->
if _(value).isFunction() then "[Function]" else value
module.exports = | prettyPrint: (value) ->
return value unless _(value).isObject()
try
JSON.stringify(value, replacer, indentation = 2)
catch e
value | CoffeeScript | CoffeeScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | 5d2138d91b1fb9c079e668b02683356f40c4e449 | 1,168 | https://github.com/linemanjs/lineman/blob/5d2138d91b1fb9c079e668b02683356f40c4e449/lib/pretty-prints-value.coffee | 1 | 12 |
linemanjs/lineman:lib/pretty-prints-value.coffee:1:raw_corpus | raw_corpus | _ = require("lodash")
module.exports =
prettyPrint: (value) ->
return value unless _(value).isObject()
try
JSON.stringify(value, null, 2)
catch e
value | CoffeeScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | 539444b831eb941c7411035198b815bfd421690c | 1,168 | https://github.com/linemanjs/lineman/blob/539444b831eb941c7411035198b815bfd421690c/lib/pretty-prints-value.coffee | 1 | 9 | ||
linemanjs/lineman:lib/pretty-prints-value.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require("lodash")
module.exports =
prettyPrint: (value) ->
return value unless _(value).isObject()
try
JSON.stringify(value, null, 2)
catch e
value
``` | var _;
_ = require("lodash");
module.exports = {
prettyPrint: function(value) {
var e;
if (!_(value).isObject()) {
return value;
}
try {
return JSON.stringify(value, null, 2);
} catch (error) {
e = error;
return value;
}
}
}; | CoffeeScript | JavaScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | 539444b831eb941c7411035198b815bfd421690c | 1,168 | https://github.com/linemanjs/lineman/blob/539444b831eb941c7411035198b815bfd421690c/lib/pretty-prints-value.coffee | 1 | 9 |
linemanjs/lineman:lib/pretty-prints-value.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _;
_ = require("lodash");
module.exports = {
prettyPrint: function(value) {
var e;
if (!_(value).isObject()) {
return value;
}
try {
return JSON.stringify(value, null, 2);
} catch (error) {
e = error;
return value... | _ = require("lodash")
module.exports =
prettyPrint: (value) ->
return value unless _(value).isObject()
try
JSON.stringify(value, null, 2)
catch e
value | JavaScript | CoffeeScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | 539444b831eb941c7411035198b815bfd421690c | 1,168 | https://github.com/linemanjs/lineman/blob/539444b831eb941c7411035198b815bfd421690c/lib/pretty-prints-value.coffee | 1 | 9 |
linemanjs/lineman:lib/pretty-prints-value.coffee:1:completion | completion | _ = require("lodash")
module.exports =
prettyPrint: (value) -> | return value unless _(value).isObject()
try
JSON.stringify(value, null, 2)
catch e
value | CoffeeScript | CoffeeScript | linemanjs/lineman | lib/pretty-prints-value.coffee | MIT | 539444b831eb941c7411035198b815bfd421690c | 1,168 | https://github.com/linemanjs/lineman/blob/539444b831eb941c7411035198b815bfd421690c/lib/pretty-prints-value.coffee | 1 | 9 |
Glavin001/atom-beautify:src/beautifiers/brittany.coffee:1:raw_corpus | raw_corpus | ###
Requires https://github.com/lspitzner/brittany
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class Brittany extends Beautifier
name: "brittany"
link: "https://github.com/lspitzner/brittany"
isPreInstalled: false
options: {
Haskell: false
}
beautify: (text, language, opti... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/brittany.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/brittany.coffee | 1 | 24 | ||
Glavin001/atom-beautify:src/beautifiers/brittany.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
Requires https://github.com/lspitzner/brittany
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class Brittany extends Beautifier
name: "brittany"
link: "https://github.com/lspitzner/brittany"
isPreInstalled: false
options: {
... | /*
Requires https://github.com/lspitzner/brittany
*/
"use strict";
var Beautifier, Brittany;
Beautifier = require('./beautifier');
module.exports = Brittany = (function() {
class Brittany extends Beautifier {
beautify(text, language, options) {
return this.run("brittany", [this.tempFile("input", text)], {... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/brittany.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/brittany.coffee | 1 | 24 |
Glavin001/atom-beautify:src/beautifiers/brittany.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
Requires https://github.com/lspitzner/brittany
*/
"use strict";
var Beautifier, Brittany;
Beautifier = require('./beautifier');
module.exports = Brittany = (function() {
class Brittany extends Beautifier {
beautify(text, language, options) {
return... | ###
Requires https://github.com/lspitzner/brittany
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class Brittany extends Beautifier
name: "brittany"
link: "https://github.com/lspitzner/brittany"
isPreInstalled: false
options: {
Haskell: false
}
beautify: (text, language, opti... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/brittany.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/brittany.coffee | 1 | 24 |
Glavin001/atom-beautify:src/beautifiers/brittany.coffee:1:completion | completion | ###
Requires https://github.com/lspitzner/brittany
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class Brittany extends Beautifier
name: "brittany"
link: "https://github.com/lspitzner/brittany"
isPreInstalled: false | options: {
Haskell: false
}
beautify: (text, language, options) ->
@run("brittany", [
@tempFile("input", text)
], {
help: {
link: "https://github.com/lspitzner/brittany"
}
}) | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/brittany.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/brittany.coffee | 1 | 24 |
Glavin001/atom-beautify:src/beautifiers/brittany.coffee:1:raw_corpus | raw_corpus | ###
Requires https://github.com/lspitzner/brittany
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class Brittany extends Beautifier
name: "brittany"
link: "https://github.com/lspitzner/brittany"
isPreInstalled: false
options: {
Haskell: true
}
beautify: (text, language, optio... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/brittany.coffee | MIT | 0044fab6255ea90888df9c42b57a3b2b6fdab2ed | 1,503 | https://github.com/Glavin001/atom-beautify/blob/0044fab6255ea90888df9c42b57a3b2b6fdab2ed/src/beautifiers/brittany.coffee | 1 | 24 | ||
Glavin001/atom-beautify:src/beautifiers/brittany.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
Requires https://github.com/lspitzner/brittany
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class Brittany extends Beautifier
name: "brittany"
link: "https://github.com/lspitzner/brittany"
isPreInstalled: false
options: {
... | /*
Requires https://github.com/lspitzner/brittany
*/
"use strict";
var Beautifier, Brittany;
Beautifier = require('./beautifier');
module.exports = Brittany = (function() {
class Brittany extends Beautifier {
beautify(text, language, options) {
return this.run("brittany", [this.tempFile("input", text)], {... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/brittany.coffee | MIT | 0044fab6255ea90888df9c42b57a3b2b6fdab2ed | 1,503 | https://github.com/Glavin001/atom-beautify/blob/0044fab6255ea90888df9c42b57a3b2b6fdab2ed/src/beautifiers/brittany.coffee | 1 | 24 |
Glavin001/atom-beautify:src/beautifiers/brittany.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
Requires https://github.com/lspitzner/brittany
*/
"use strict";
var Beautifier, Brittany;
Beautifier = require('./beautifier');
module.exports = Brittany = (function() {
class Brittany extends Beautifier {
beautify(text, language, options) {
return... | ###
Requires https://github.com/lspitzner/brittany
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class Brittany extends Beautifier
name: "brittany"
link: "https://github.com/lspitzner/brittany"
isPreInstalled: false
options: {
Haskell: true
}
beautify: (text, language, optio... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/brittany.coffee | MIT | 0044fab6255ea90888df9c42b57a3b2b6fdab2ed | 1,503 | https://github.com/Glavin001/atom-beautify/blob/0044fab6255ea90888df9c42b57a3b2b6fdab2ed/src/beautifiers/brittany.coffee | 1 | 24 |
Glavin001/atom-beautify:src/beautifiers/brittany.coffee:1:completion | completion | ###
Requires https://github.com/lspitzner/brittany
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class Brittany extends Beautifier
name: "brittany"
link: "https://github.com/lspitzner/brittany"
isPreInstalled: false | options: {
Haskell: true
}
beautify: (text, language, options) ->
@run("brittany", [
@tempFile("input", text)
], {
help: {
link: "https://github.com/lspitzner/brittany"
}
}) | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/brittany.coffee | MIT | 0044fab6255ea90888df9c42b57a3b2b6fdab2ed | 1,503 | https://github.com/Glavin001/atom-beautify/blob/0044fab6255ea90888df9c42b57a3b2b6fdab2ed/src/beautifiers/brittany.coffee | 1 | 24 |
CaryLandholt/AngularFun:scripts/controllers/twitterController.coffee:1:raw_corpus | raw_corpus | ###global define###
define ['angular', 'controllers/controllers', 'services/twitterService'], (angular, controllers) ->
'use strict'
controllers.controller 'twitterController', ['$scope', '$location', 'twitterService', ($scope, $location, twitterService) ->
$scope.searchTerm = ''
$scope.tweets = {}
$scope.se... | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/twitterController.coffee | MIT | d1cdd10b75a390445a1180aeef6460f89f7bfedb | 672 | https://github.com/CaryLandholt/AngularFun/blob/d1cdd10b75a390445a1180aeef6460f89f7bfedb/scripts/controllers/twitterController.coffee | 1 | 21 | ||
CaryLandholt/AngularFun:scripts/controllers/twitterController.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###global define###
define ['angular', 'controllers/controllers', 'services/twitterService'], (angular, controllers) ->
'use strict'
controllers.controller 'twitterController', ['$scope', '$location', 'twitterService', ($scope, $location, twitterService) ->
... | /*global define*/
define(['angular', 'controllers/controllers', 'services/twitterService'], function(angular, controllers) {
'use strict';
return controllers.controller('twitterController', [
'$scope',
'$location',
'twitterService',
function($scope,
$location,
twitterService) {
$scope.... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | scripts/controllers/twitterController.coffee | MIT | d1cdd10b75a390445a1180aeef6460f89f7bfedb | 672 | https://github.com/CaryLandholt/AngularFun/blob/d1cdd10b75a390445a1180aeef6460f89f7bfedb/scripts/controllers/twitterController.coffee | 1 | 21 |
CaryLandholt/AngularFun:scripts/controllers/twitterController.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*global define*/
define(['angular', 'controllers/controllers', 'services/twitterService'], function(angular, controllers) {
'use strict';
return controllers.controller('twitterController', [
'$scope',
'$location',
'twitterService',
function($sc... | ###global define###
define ['angular', 'controllers/controllers', 'services/twitterService'], (angular, controllers) ->
'use strict'
controllers.controller 'twitterController', ['$scope', '$location', 'twitterService', ($scope, $location, twitterService) ->
$scope.searchTerm = ''
$scope.tweets = {}
$scope.se... | JavaScript | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/twitterController.coffee | MIT | d1cdd10b75a390445a1180aeef6460f89f7bfedb | 672 | https://github.com/CaryLandholt/AngularFun/blob/d1cdd10b75a390445a1180aeef6460f89f7bfedb/scripts/controllers/twitterController.coffee | 1 | 21 |
CaryLandholt/AngularFun:scripts/controllers/twitterController.coffee:1:completion | completion | ###global define###
define ['angular', 'controllers/controllers', 'services/twitterService'], (angular, controllers) ->
'use strict'
controllers.controller 'twitterController', ['$scope', '$location', 'twitterService', ($scope, $location, twitterService) ->
$scope.searchTerm = ''
$scope.tweets = {}
$scope.se... | $location.path "/twitter/#{searchTerm}"
$scope.$on '$afterRouteChange', (event, currentRoute, priorRoute) ->
return if not currentRoute or not currentRoute.$route or not currentRoute.$route.controller or currentRoute.$route.controller isnt 'twitterController'
searchTerm = currentRoute.params.searchTerm
if... | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/twitterController.coffee | MIT | d1cdd10b75a390445a1180aeef6460f89f7bfedb | 672 | https://github.com/CaryLandholt/AngularFun/blob/d1cdd10b75a390445a1180aeef6460f89f7bfedb/scripts/controllers/twitterController.coffee | 1 | 21 |
CaryLandholt/AngularFun:scripts/controllers/twitterController.coffee:1:raw_corpus | raw_corpus | ###global define###
define ['use!angular', 'controllers/controllers', 'services/twitterService'], (angular, controllers) ->
'use strict'
controllers.controller 'twitterController', ['$scope', '$location', 'twitterService', ($scope, $location, twitterService) ->
$scope.searchTerm = ''
$scope.tweets = {}
$scop... | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/twitterController.coffee | MIT | dfe4d72aa6e3e26fbc3001a210b6c4e4e937d851 | 672 | https://github.com/CaryLandholt/AngularFun/blob/dfe4d72aa6e3e26fbc3001a210b6c4e4e937d851/scripts/controllers/twitterController.coffee | 1 | 21 | ||
CaryLandholt/AngularFun:scripts/controllers/twitterController.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###global define###
define ['use!angular', 'controllers/controllers', 'services/twitterService'], (angular, controllers) ->
'use strict'
controllers.controller 'twitterController', ['$scope', '$location', 'twitterService', ($scope, $location, twitterService) ... | /*global define*/
define(['use!angular', 'controllers/controllers', 'services/twitterService'], function(angular, controllers) {
'use strict';
return controllers.controller('twitterController', [
'$scope',
'$location',
'twitterService',
function($scope,
$location,
twitterService) {
$sc... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | scripts/controllers/twitterController.coffee | MIT | dfe4d72aa6e3e26fbc3001a210b6c4e4e937d851 | 672 | https://github.com/CaryLandholt/AngularFun/blob/dfe4d72aa6e3e26fbc3001a210b6c4e4e937d851/scripts/controllers/twitterController.coffee | 1 | 21 |
CaryLandholt/AngularFun:scripts/controllers/twitterController.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*global define*/
define(['use!angular', 'controllers/controllers', 'services/twitterService'], function(angular, controllers) {
'use strict';
return controllers.controller('twitterController', [
'$scope',
'$location',
'twitterService',
function... | ###global define###
define ['use!angular', 'controllers/controllers', 'services/twitterService'], (angular, controllers) ->
'use strict'
controllers.controller 'twitterController', ['$scope', '$location', 'twitterService', ($scope, $location, twitterService) ->
$scope.searchTerm = ''
$scope.tweets = {}
$scop... | JavaScript | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/twitterController.coffee | MIT | dfe4d72aa6e3e26fbc3001a210b6c4e4e937d851 | 672 | https://github.com/CaryLandholt/AngularFun/blob/dfe4d72aa6e3e26fbc3001a210b6c4e4e937d851/scripts/controllers/twitterController.coffee | 1 | 21 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.