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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jeremyfa/yaml.js:src/Pattern.coffee:1:raw_corpus | raw_corpus | class Pattern
# @property [RegExp] The RegExp instance
regex: null
# @property [String] The raw regex string
rawRegex: null
# @property [String] The cleaned regex string (used to create the RegExp instance)
cleanedRegex: null
# @property [Object] The dictionary mapping n... | CoffeeScript | jeremyfa/yaml.js | src/Pattern.coffee | MIT | c6cbcf0326723c5f0013490d1fea489694790775 | 887 | https://github.com/jeremyfa/yaml.js/blob/c6cbcf0326723c5f0013490d1fea489694790775/src/Pattern.coffee | 4 | 53 | ||
jeremyfa/yaml.js:src/Pattern.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Pattern
# @property [RegExp] The RegExp instance
regex: null
# @property [String] The raw regex string
rawRegex: null
# @property [String] The cleaned regex string (used to create the RegExp instance)
cleanedRegex: ... | var Pattern;
Pattern = (function() {
class Pattern {
// Constructor
// @param [String] rawRegex The raw regex string defining the pattern
constructor(rawRegex, modifiers = '') {
var capturingBracketNumber, char, cleanedRegex, i, len, mapping, name, part, subChar;
cleanedRegex = '';
le... | CoffeeScript | JavaScript | jeremyfa/yaml.js | src/Pattern.coffee | MIT | c6cbcf0326723c5f0013490d1fea489694790775 | 887 | https://github.com/jeremyfa/yaml.js/blob/c6cbcf0326723c5f0013490d1fea489694790775/src/Pattern.coffee | 4 | 53 |
jeremyfa/yaml.js:src/Pattern.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Pattern;
Pattern = (function() {
class Pattern {
// Constructor
// @param [String] rawRegex The raw regex string defining the pattern
constructor(rawRegex, modifiers = '') {
var capturingBracketNumber, char, cleanedRegex, i, len, mapping,... | class Pattern
# @property [RegExp] The RegExp instance
regex: null
# @property [String] The raw regex string
rawRegex: null
# @property [String] The cleaned regex string (used to create the RegExp instance)
cleanedRegex: null
# @property [Object] The dictionary mapping n... | JavaScript | CoffeeScript | jeremyfa/yaml.js | src/Pattern.coffee | MIT | c6cbcf0326723c5f0013490d1fea489694790775 | 887 | https://github.com/jeremyfa/yaml.js/blob/c6cbcf0326723c5f0013490d1fea489694790775/src/Pattern.coffee | 4 | 53 |
jeremyfa/yaml.js:src/Pattern.coffee:1:completion | completion | class Pattern
# @property [RegExp] The RegExp instance
regex: null
# @property [String] The raw regex string
rawRegex: null
# @property [String] The cleaned regex string (used to create the RegExp instance)
cleanedRegex: null
# @property [Object] The dictionary mapping n... | i = 0
while i < len
char = rawRegex.charAt(i)
if char is '\\'
# Ignore next character
cleanedRegex += rawRegex[i..i+1]
i++
else if char is '('
# Increase bracket number, only if it is capturing
if... | CoffeeScript | CoffeeScript | jeremyfa/yaml.js | src/Pattern.coffee | MIT | c6cbcf0326723c5f0013490d1fea489694790775 | 887 | https://github.com/jeremyfa/yaml.js/blob/c6cbcf0326723c5f0013490d1fea489694790775/src/Pattern.coffee | 4 | 53 |
jeremyfa/yaml.js:src/Pattern.coffee:2:raw_corpus | raw_corpus | if name.length > 0
# Associate a name with a capturing bracket number
mapping ?= {}
mapping[name] = capturingBracketNumber
break
else
... | CoffeeScript | jeremyfa/yaml.js | src/Pattern.coffee | MIT | c6cbcf0326723c5f0013490d1fea489694790775 | 887 | https://github.com/jeremyfa/yaml.js/blob/c6cbcf0326723c5f0013490d1fea489694790775/src/Pattern.coffee | 54 | 103 | ||
jeremyfa/yaml.js:src/Pattern.coffee:2:completion | completion | if name.length > 0
# Associate a name with a capturing bracket number
mapping ?= {}
mapping[name] = capturingBracketNumber
break
else
... | # Executes the pattern's regex and returns the matching values
#
# @param [String] str The string to use to execute the pattern
#
# @return [Array] The matching values extracted from capturing brackets or null if nothing matched
#
exec: (str) ->
@regex.lastIndex = 0
matches = @re... | CoffeeScript | CoffeeScript | jeremyfa/yaml.js | src/Pattern.coffee | MIT | c6cbcf0326723c5f0013490d1fea489694790775 | 887 | https://github.com/jeremyfa/yaml.js/blob/c6cbcf0326723c5f0013490d1fea489694790775/src/Pattern.coffee | 54 | 103 |
octoblu/meshblu:test/SubscriptionGetter-spec.coffee:1:raw_corpus | raw_corpus | SubscriptionGetter = require '../lib/SubscriptionGetter'
TestDatabase = require './test-database'
describe 'SubscriptionGetter', ->
beforeEach (done) ->
TestDatabase.open (error, database) =>
{@devices,@subscriptions} = database
@devices.find {}, (error, devices) =>
done error
describe '-... | CoffeeScript | octoblu/meshblu | test/SubscriptionGetter-spec.coffee | MIT | 398c56b5cc548bb75654e7e9072b88d5417bb18b | 815 | https://github.com/octoblu/meshblu/blob/398c56b5cc548bb75654e7e9072b88d5417bb18b/test/SubscriptionGetter-spec.coffee | 1 | 48 | ||
octoblu/meshblu:test/SubscriptionGetter-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
SubscriptionGetter = require '../lib/SubscriptionGetter'
TestDatabase = require './test-database'
describe 'SubscriptionGetter', ->
beforeEach (done) ->
TestDatabase.open (error, database) =>
{@devices,@subscriptions} = database
@devices.find ... | var SubscriptionGetter, TestDatabase;
SubscriptionGetter = require('../lib/SubscriptionGetter');
TestDatabase = require('./test-database');
describe('SubscriptionGetter', function() {
beforeEach(function(done) {
return TestDatabase.open((error, database) => {
({devices: this.devices, subscriptions: this.... | CoffeeScript | JavaScript | octoblu/meshblu | test/SubscriptionGetter-spec.coffee | MIT | 398c56b5cc548bb75654e7e9072b88d5417bb18b | 815 | https://github.com/octoblu/meshblu/blob/398c56b5cc548bb75654e7e9072b88d5417bb18b/test/SubscriptionGetter-spec.coffee | 1 | 48 |
octoblu/meshblu:test/SubscriptionGetter-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var SubscriptionGetter, TestDatabase;
SubscriptionGetter = require('../lib/SubscriptionGetter');
TestDatabase = require('./test-database');
describe('SubscriptionGetter', function() {
beforeEach(function(done) {
return TestDatabase.open((error, database) =... | SubscriptionGetter = require '../lib/SubscriptionGetter'
TestDatabase = require './test-database'
describe 'SubscriptionGetter', ->
beforeEach (done) ->
TestDatabase.open (error, database) =>
{@devices,@subscriptions} = database
@devices.find {}, (error, devices) =>
done error
describe '-... | JavaScript | CoffeeScript | octoblu/meshblu | test/SubscriptionGetter-spec.coffee | MIT | 398c56b5cc548bb75654e7e9072b88d5417bb18b | 815 | https://github.com/octoblu/meshblu/blob/398c56b5cc548bb75654e7e9072b88d5417bb18b/test/SubscriptionGetter-spec.coffee | 1 | 48 |
octoblu/meshblu:test/SubscriptionGetter-spec.coffee:1:completion | completion | SubscriptionGetter = require '../lib/SubscriptionGetter'
TestDatabase = require './test-database'
describe 'SubscriptionGetter', ->
beforeEach (done) ->
TestDatabase.open (error, database) =>
{@devices,@subscriptions} = database
@devices.find {}, (error, devices) =>
done error
describe '-... | uuid: @receiverUuid
@devices.insert record, done
beforeEach (done) ->
@forwarderUuid = '9749b660-b6dc-4189-b248-1248e72ecb51'
record =
name: 'Forwarder'
uuid: @forwarderUuid
configureWhitelist: [ @receiverUuid ]
@devices.insert record, done
bef... | CoffeeScript | CoffeeScript | octoblu/meshblu | test/SubscriptionGetter-spec.coffee | MIT | 398c56b5cc548bb75654e7e9072b88d5417bb18b | 815 | https://github.com/octoblu/meshblu/blob/398c56b5cc548bb75654e7e9072b88d5417bb18b/test/SubscriptionGetter-spec.coffee | 1 | 48 |
octoblu/meshblu:test/SubscriptionGetter-spec.coffee:1:raw_corpus | raw_corpus | SubscriptionGetter = require '../lib/SubscriptionGetter'
describe 'SubscriptionGetter', ->
beforeEach ->
@dependencies =
subscriptions:
find: sinon.stub()
simpleAuth:
canReceive: sinon.stub() # (fromDevice, toDevice, message, callback)
getDevice: sinon.stub()
@sut = new Sub... | CoffeeScript | octoblu/meshblu | test/SubscriptionGetter-spec.coffee | MIT | 34fcd9be8665d56fe7253a9824cea239276ea0fe | 815 | https://github.com/octoblu/meshblu/blob/34fcd9be8665d56fe7253a9824cea239276ea0fe/test/SubscriptionGetter-spec.coffee | 1 | 50 | ||
octoblu/meshblu:test/SubscriptionGetter-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
SubscriptionGetter = require '../lib/SubscriptionGetter'
describe 'SubscriptionGetter', ->
beforeEach ->
@dependencies =
subscriptions:
find: sinon.stub()
simpleAuth:
canReceive: sinon.stub() # (fromDevice, toDevice, message, ca... | var SubscriptionGetter;
SubscriptionGetter = require('../lib/SubscriptionGetter');
describe('SubscriptionGetter', function() {
beforeEach(function() {
this.dependencies = {
subscriptions: {
find: sinon.stub()
},
simpleAuth: {
canReceive: sinon.stub() // (fromDevice, toDevice, m... | CoffeeScript | JavaScript | octoblu/meshblu | test/SubscriptionGetter-spec.coffee | MIT | 34fcd9be8665d56fe7253a9824cea239276ea0fe | 815 | https://github.com/octoblu/meshblu/blob/34fcd9be8665d56fe7253a9824cea239276ea0fe/test/SubscriptionGetter-spec.coffee | 1 | 50 |
octoblu/meshblu:test/SubscriptionGetter-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var SubscriptionGetter;
SubscriptionGetter = require('../lib/SubscriptionGetter');
describe('SubscriptionGetter', function() {
beforeEach(function() {
this.dependencies = {
subscriptions: {
find: sinon.stub()
},
simpleAuth: {
... | SubscriptionGetter = require '../lib/SubscriptionGetter'
describe 'SubscriptionGetter', ->
beforeEach ->
@dependencies =
subscriptions:
find: sinon.stub()
simpleAuth:
canReceive: sinon.stub() # (fromDevice, toDevice, message, callback)
getDevice: sinon.stub()
@sut = new Sub... | JavaScript | CoffeeScript | octoblu/meshblu | test/SubscriptionGetter-spec.coffee | MIT | 34fcd9be8665d56fe7253a9824cea239276ea0fe | 815 | https://github.com/octoblu/meshblu/blob/34fcd9be8665d56fe7253a9824cea239276ea0fe/test/SubscriptionGetter-spec.coffee | 1 | 50 |
octoblu/meshblu:test/SubscriptionGetter-spec.coffee:1:completion | completion | SubscriptionGetter = require '../lib/SubscriptionGetter'
describe 'SubscriptionGetter', ->
beforeEach ->
@dependencies =
subscriptions:
find: sinon.stub()
simpleAuth:
canReceive: sinon.stub() # (fromDevice, toDevice, message, callback)
getDevice: sinon.stub()
@sut = new Sub... | emitterUuid: 'user-uuid'
type: 'boogey-woogey'
it 'should call canReceive with the two devices', ->
expect(@dependencies.simpleAuth.canReceive).to.have.been.calledWith(
{second: 'object'}
{first: 'object'}
)
it 'should return an empty array', ->
expect... | CoffeeScript | CoffeeScript | octoblu/meshblu | test/SubscriptionGetter-spec.coffee | MIT | 34fcd9be8665d56fe7253a9824cea239276ea0fe | 815 | https://github.com/octoblu/meshblu/blob/34fcd9be8665d56fe7253a9824cea239276ea0fe/test/SubscriptionGetter-spec.coffee | 1 | 50 |
octoblu/meshblu:test/SubscriptionGetter-spec.coffee:2:raw_corpus | raw_corpus | @dependencies.subscriptions.find.yields new Error('yikes!')
@sut.get (@error, @result) => done()
it 'should yield an error', ->
expect(=> throw @error).to.throw 'yikes!'
describe 'when the second getDevice yields an error', ->
beforeEach (done) ->
@sut = new SubscriptionGetter ... | CoffeeScript | octoblu/meshblu | test/SubscriptionGetter-spec.coffee | MIT | 34fcd9be8665d56fe7253a9824cea239276ea0fe | 815 | https://github.com/octoblu/meshblu/blob/34fcd9be8665d56fe7253a9824cea239276ea0fe/test/SubscriptionGetter-spec.coffee | 51 | 78 | ||
octoblu/meshblu:test/SubscriptionGetter-spec.coffee:2:completion | completion | @dependencies.subscriptions.find.yields new Error('yikes!')
@sut.get (@error, @result) => done()
it 'should yield an error', ->
expect(=> throw @error).to.throw 'yikes!'
describe 'when the second getDevice yields an error', ->
beforeEach (done) ->
@sut = new SubscriptionGetter ... | it 'should yield an error', ->
expect(=> throw @error).to.throw 'ops'
describe 'when the canReceive yields an error', ->
beforeEach (done) ->
@sut = new SubscriptionGetter emitterUuid: 'the-uuid', type: 'broadcast', @dependencies
@dependencies.getDevice.onCall(0).yields null, {}
... | CoffeeScript | CoffeeScript | octoblu/meshblu | test/SubscriptionGetter-spec.coffee | MIT | 34fcd9be8665d56fe7253a9824cea239276ea0fe | 815 | https://github.com/octoblu/meshblu/blob/34fcd9be8665d56fe7253a9824cea239276ea0fe/test/SubscriptionGetter-spec.coffee | 51 | 78 |
Glavin001/atom-beautify:src/languages/php.coffee:1:raw_corpus | raw_corpus | module.exports = {
name: "PHP"
namespace: "php"
###
Supported Grammars
###
grammars: [
"PHP"
]
###
Supported extensions
###
extensions: [
"php"
"module"
"inc"
]
defaultBeautifier: "PHP-CS-Fixer"
options:
cs_fixer_path:
title: "PHP-CS-Fixer Path"
type: 'st... | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/languages/php.coffee | 1 | 50 | ||
Glavin001/atom-beautify:src/languages/php.coffee:1:completion | completion | module.exports = {
name: "PHP"
namespace: "php"
###
Supported Grammars
###
grammars: [
"PHP"
]
###
Supported extensions
###
extensions: [
"php"
"module"
"inc"
]
defaultBeautifier: "PHP-CS-Fixer"
options:
cs_fixer_path: | title: "PHP-CS-Fixer Path"
type: 'string'
default: ""
description: "Absolute path to the `php-cs-fixer` CLI executable"
cs_fixer_version:
title: "PHP-CS-Fixer Version"
type: 'integer'
default: 2
enum: [1, 2]
cs_fixer_config_file:
title: "PHP-CS-Fixer Config File"
... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/languages/php.coffee | 1 | 50 |
Glavin001/atom-beautify:src/languages/php.coffee:2:raw_corpus | raw_corpus | description: "Add rule(s). i.e. line_ending,-full_opening_tag,@PSR2 (PHP-CS-Fixer 2 only)"
allow_risky:
title: "Allow risky rules"
type: 'string'
default: "no"
enum: ["no", "yes"]
description: "Allow risky rules to be applied (PHP-CS-Fixer 2 only)"
phpcbf_path:
title: "PHPCBF... | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/languages/php.coffee | 51 | 74 | ||
Glavin001/atom-beautify:src/languages/php.coffee:2:completion | completion | description: "Add rule(s). i.e. line_ending,-full_opening_tag,@PSR2 (PHP-CS-Fixer 2 only)"
allow_risky:
title: "Allow risky rules"
type: 'string'
default: "no"
enum: ["no", "yes"]
description: "Allow risky rules to be applied (PHP-CS-Fixer 2 only)"
phpcbf_path:
title: "PHPCBF... | phpcbf_version:
title: "PHPCBF Version"
type: 'integer'
default: 2
enum: [1, 2, 3]
standard:
title: "PHPCBF Standard"
type: 'string'
default: "PEAR",
description: "Standard name Squiz, PSR2, PSR1, PHPCS, PEAR, Zend, MySource... or path to CS rules. Will use local `php... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/languages/php.coffee | 51 | 74 |
Glavin001/atom-beautify:src/languages/php.coffee:1:raw_corpus | raw_corpus | module.exports = {
name: "PHP"
namespace: "php"
###
Supported Grammars
###
grammars: [
"PHP"
]
###
Supported extensions
###
extensions: [
"php"
"module"
"inc"
]
defaultBeautifier: "PHP-CS-Fixer"
options:
cs_fixer_path:
title: "PHP-CS-Fixer Path"
type: 'st... | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | ce73ce220810286284290bd08342ebb73d7e0e52 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/ce73ce220810286284290bd08342ebb73d7e0e52/src/languages/php.coffee | 1 | 50 | ||
Glavin001/atom-beautify:src/languages/php.coffee:1:completion | completion | module.exports = {
name: "PHP"
namespace: "php"
###
Supported Grammars
###
grammars: [
"PHP"
]
###
Supported extensions
###
extensions: [
"php"
"module"
"inc"
]
defaultBeautifier: "PHP-CS-Fixer"
options:
cs_fixer_path: | title: "PHP-CS-Fixer Path"
type: 'string'
default: ""
description: "Absolute path to the `php-cs-fixer` CLI executable"
cs_fixer_version:
title: "PHP-CS-Fixer Version"
type: 'integer'
default: 2
enum: [1, 2]
fixers:
type: 'string'
default: ""
descripti... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | ce73ce220810286284290bd08342ebb73d7e0e52 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/ce73ce220810286284290bd08342ebb73d7e0e52/src/languages/php.coffee | 1 | 50 |
Glavin001/atom-beautify:src/languages/php.coffee:2:raw_corpus | raw_corpus | enum: ["no", "yes"]
description: "allow risky rules to be applied (PHP-CS-Fixer 2 only)"
phpcbf_path:
title: "PHPCBF Path"
type: 'string'
default: ""
description: "Path to the `phpcbf` CLI executable",
phpcbf_version:
title: "PHPCBF Version"
type: 'integer'
defaul... | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | ce73ce220810286284290bd08342ebb73d7e0e52 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/ce73ce220810286284290bd08342ebb73d7e0e52/src/languages/php.coffee | 51 | 69 | ||
Glavin001/atom-beautify:src/languages/php.coffee:2:completion | completion | enum: ["no", "yes"]
description: "allow risky rules to be applied (PHP-CS-Fixer 2 only)"
phpcbf_path:
title: "PHPCBF Path"
type: 'string'
default: ""
description: "Path to the `phpcbf` CLI executable",
phpcbf_version:
title: "PHPCBF Version" | type: 'integer'
default: 2
enum: [1, 2, 3]
standard:
title: "PHPCBF Standard"
type: 'string'
default: "PEAR",
description: "Standard name Squiz, PSR2, PSR1, PHPCS, PEAR, Zend, MySource... or path to CS rules. Will use local `phpcs.xml`, `phpcs.xml.dist`, `phpcs.ruleset.xml` or `r... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | ce73ce220810286284290bd08342ebb73d7e0e52 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/ce73ce220810286284290bd08342ebb73d7e0e52/src/languages/php.coffee | 51 | 69 |
Glavin001/atom-beautify:src/languages/php.coffee:2:raw_corpus | raw_corpus | enum: ["no", "yes"]
description: "allow risky rules to be applied (PHP-CS-Fixer 2 only)"
phpcbf_path:
title: "PHPCBF Path"
type: 'string'
default: ""
description: "Path to the `phpcbf` CLI executable",
phpcbf_version:
title: "PHPCBF Version"
type: 'integer'
defaul... | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | a344acd48fc68be5ffcf79f94eaf84af6735ddae | 1,503 | https://github.com/Glavin001/atom-beautify/blob/a344acd48fc68be5ffcf79f94eaf84af6735ddae/src/languages/php.coffee | 51 | 69 | ||
Glavin001/atom-beautify:src/languages/php.coffee:2:completion | completion | enum: ["no", "yes"]
description: "allow risky rules to be applied (PHP-CS-Fixer 2 only)"
phpcbf_path:
title: "PHPCBF Path"
type: 'string'
default: ""
description: "Path to the `phpcbf` CLI executable",
phpcbf_version:
title: "PHPCBF Version" | type: 'integer'
default: 2
enum: [1, 2, 3]
standard:
title: "PHPCBF Standard"
type: 'string'
default: "",
description: "Standard name Squiz, PSR2, PSR1, PHPCS, PEAR, Zend, MySource... or path to CS rules. Will use local `phpcs.xml`, `phpcs.xml.dist`, `phpcs.ruleset.xml` or `rules... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | a344acd48fc68be5ffcf79f94eaf84af6735ddae | 1,503 | https://github.com/Glavin001/atom-beautify/blob/a344acd48fc68be5ffcf79f94eaf84af6735ddae/src/languages/php.coffee | 51 | 69 |
Glavin001/atom-beautify:src/languages/php.coffee:2:raw_corpus | raw_corpus | enum: ["no", "yes"]
description: "allow risky rules to be applied (PHP-CS-Fixer 2 only)"
phpcbf_path:
title: "PHPCBF Path"
type: 'string'
default: ""
description: "Path to the `phpcbf` CLI executable",
standard:
title: "PHPCBF Standard"
type: 'string'
default: "",... | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | 449d95b2ad39c1b5122f884e359844d2166643e0 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/449d95b2ad39c1b5122f884e359844d2166643e0/src/languages/php.coffee | 51 | 64 | ||
Glavin001/atom-beautify:src/languages/php.coffee:2:completion | completion | enum: ["no", "yes"]
description: "allow risky rules to be applied (PHP-CS-Fixer 2 only)"
phpcbf_path:
title: "PHPCBF Path"
type: 'string'
default: ""
description: "Path to the `phpcbf` CLI executable", | standard:
title: "PHPCBF Standard"
type: 'string'
default: "",
description: "Standard name Squiz, PSR2, PSR1, PHPCS, PEAR, Zend, MySource... or path to CS rules. Will use local `phpcs.xml`, `phpcs.xml.dist`, `phpcs.ruleset.xml` or `ruleset.xml` if found in the project root."
} | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | 449d95b2ad39c1b5122f884e359844d2166643e0 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/449d95b2ad39c1b5122f884e359844d2166643e0/src/languages/php.coffee | 51 | 64 |
Glavin001/atom-beautify:src/languages/php.coffee:2:raw_corpus | raw_corpus | enum: ["no", "yes"]
description: "allow risky rules to be applied!"
phpcbf_path:
title: "PHPCBF Path"
type: 'string'
default: ""
description: "Path to the `phpcbf` CLI executable",
standard:
title: "PHPCBF Standard"
type: 'string'
default: "",
description: "... | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | 6f2354d375b2ff5846b9f2f0744bb9e48fc3aa61 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/6f2354d375b2ff5846b9f2f0744bb9e48fc3aa61/src/languages/php.coffee | 51 | 64 | ||
Glavin001/atom-beautify:src/languages/php.coffee:2:completion | completion | enum: ["no", "yes"]
description: "allow risky rules to be applied!"
phpcbf_path:
title: "PHPCBF Path"
type: 'string'
default: ""
description: "Path to the `phpcbf` CLI executable", | standard:
title: "PHPCBF Standard"
type: 'string'
default: "",
description: "Standard name Squiz, PSR2, PSR1, PHPCS, PEAR, Zend, MySource... or path to CS rules. Will use local `phpcs.xml`, `phpcs.xml.dist`, `phpcs.ruleset.xml` or `ruleset.xml` if found in the project root."
} | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | 6f2354d375b2ff5846b9f2f0744bb9e48fc3aa61 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/6f2354d375b2ff5846b9f2f0744bb9e48fc3aa61/src/languages/php.coffee | 51 | 64 |
Glavin001/atom-beautify:src/languages/php.coffee:1:raw_corpus | raw_corpus | module.exports = {
name: "PHP"
namespace: "php"
###
Supported Grammars
###
grammars: [
"PHP"
]
###
Supported extensions
###
extensions: [
"php"
"module"
"inc"
]
defaultBeautifier: "PHP-CS-Fixer"
options:
cs_fixer_path:
title: "PHP-CS-Fixer Path"
type: 'st... | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | 652c0ceb1ac89ce69cbd68fceaba22dbf6df56fc | 1,503 | https://github.com/Glavin001/atom-beautify/blob/652c0ceb1ac89ce69cbd68fceaba22dbf6df56fc/src/languages/php.coffee | 1 | 50 | ||
Glavin001/atom-beautify:src/languages/php.coffee:1:completion | completion | module.exports = {
name: "PHP"
namespace: "php"
###
Supported Grammars
###
grammars: [
"PHP"
]
###
Supported extensions
###
extensions: [
"php"
"module"
"inc"
]
defaultBeautifier: "PHP-CS-Fixer"
options:
cs_fixer_path: | title: "PHP-CS-Fixer Path"
type: 'string'
default: ""
description: "Absolute path to the `php-cs-fixer` CLI executable"
cs_fixer_version:
title: "PHP-CS-Fixer Version"
type: 'integer'
default: 2
enum: [1, 2]
fixers:
type: 'string'
default: ""
descripti... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | 652c0ceb1ac89ce69cbd68fceaba22dbf6df56fc | 1,503 | https://github.com/Glavin001/atom-beautify/blob/652c0ceb1ac89ce69cbd68fceaba22dbf6df56fc/src/languages/php.coffee | 1 | 50 |
Glavin001/atom-beautify:src/languages/php.coffee:2:raw_corpus | raw_corpus | description: "Path to the `phpcbf` CLI executable",
standard:
title: "PHPCBF Standard"
type: 'string'
default: "",
description: "Standard name Squiz, PSR2, PSR1, PHPCS, PEAR, Zend, MySource... or path to CS rules. Will use local `phpcs.xml`, `phpcs.xml.dist`, `phpcs.ruleset.xml` or `ruleset.... | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | 652c0ceb1ac89ce69cbd68fceaba22dbf6df56fc | 1,503 | https://github.com/Glavin001/atom-beautify/blob/652c0ceb1ac89ce69cbd68fceaba22dbf6df56fc/src/languages/php.coffee | 51 | 58 | ||
Glavin001/atom-beautify:src/languages/php.coffee:2:completion | completion | description: "Path to the `phpcbf` CLI executable",
standard:
title: "PHPCBF Standard"
type: 'string' | default: "",
description: "Standard name Squiz, PSR2, PSR1, PHPCS, PEAR, Zend, MySource... or path to CS rules. Will use local `phpcs.xml`, `phpcs.xml.dist`, `phpcs.ruleset.xml` or `ruleset.xml` if found in the project root."
} | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | 652c0ceb1ac89ce69cbd68fceaba22dbf6df56fc | 1,503 | https://github.com/Glavin001/atom-beautify/blob/652c0ceb1ac89ce69cbd68fceaba22dbf6df56fc/src/languages/php.coffee | 51 | 58 |
Glavin001/atom-beautify:src/languages/php.coffee:1:raw_corpus | raw_corpus | module.exports = {
name: "PHP"
namespace: "php"
###
Supported Grammars
###
grammars: [
"PHP"
]
###
Supported extensions
###
extensions: [
"php"
"module"
"inc"
]
defaultBeautifier: "PHP-CS-Fixer"
options:
cs_fixer_path:
title: "PHP-CS-Fixer Path"
type: 'st... | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | b63965bbdea0654c956d053a4ef3b422b559309b | 1,503 | https://github.com/Glavin001/atom-beautify/blob/b63965bbdea0654c956d053a4ef3b422b559309b/src/languages/php.coffee | 1 | 45 | ||
Glavin001/atom-beautify:src/languages/php.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = {
name: "PHP"
namespace: "php"
###
Supported Grammars
###
grammars: [
"PHP"
]
###
Supported extensions
###
extensions: [
"php"
"module"
"inc"
]
defaultBeautifier: "PHP-CS-Fixer"
options:
cs_fix... | module.exports = {
name: "PHP",
namespace: "php",
/*
Supported Grammars
*/
grammars: ["PHP"],
/*
Supported extensions
*/
extensions: ["php", "module", "inc"],
defaultBeautifier: "PHP-CS-Fixer",
options: {
cs_fixer_path: {
title: "PHP-CS-Fixer Path",
type: 'string',
default:... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | b63965bbdea0654c956d053a4ef3b422b559309b | 1,503 | https://github.com/Glavin001/atom-beautify/blob/b63965bbdea0654c956d053a4ef3b422b559309b/src/languages/php.coffee | 1 | 45 |
Glavin001/atom-beautify:src/languages/php.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = {
name: "PHP",
namespace: "php",
/*
Supported Grammars
*/
grammars: ["PHP"],
/*
Supported extensions
*/
extensions: ["php", "module", "inc"],
defaultBeautifier: "PHP-CS-Fixer",
options: {
cs_fixer_path: {
title: "P... | module.exports = {
name: "PHP"
namespace: "php"
###
Supported Grammars
###
grammars: [
"PHP"
]
###
Supported extensions
###
extensions: [
"php"
"module"
"inc"
]
defaultBeautifier: "PHP-CS-Fixer"
options:
cs_fixer_path:
title: "PHP-CS-Fixer Path"
type: 'st... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | b63965bbdea0654c956d053a4ef3b422b559309b | 1,503 | https://github.com/Glavin001/atom-beautify/blob/b63965bbdea0654c956d053a4ef3b422b559309b/src/languages/php.coffee | 1 | 45 |
Glavin001/atom-beautify:src/languages/php.coffee:1:completion | completion | module.exports = {
name: "PHP"
namespace: "php"
###
Supported Grammars
###
grammars: [
"PHP"
]
###
Supported extensions
###
extensions: [
"php"
"module"
"inc"
]
defaultBeautifier: "PHP-CS-Fixer" | options:
cs_fixer_path:
title: "PHP-CS-Fixer Path"
type: 'string'
default: ""
description: "Absolute path to the `php-cs-fixer` CLI executable"
rules:
type: 'string'
default: ""
description: "Add rule(s). i.e. line_ending,-full_opening_tag,@PSR2"
phpcbf_path:
... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | b63965bbdea0654c956d053a4ef3b422b559309b | 1,503 | https://github.com/Glavin001/atom-beautify/blob/b63965bbdea0654c956d053a4ef3b422b559309b/src/languages/php.coffee | 1 | 45 |
Glavin001/atom-beautify:src/languages/php.coffee:1:raw_corpus | raw_corpus | module.exports = {
name: "PHP"
namespace: "php"
###
Supported Grammars
###
grammars: [
"PHP"
]
###
Supported extensions
###
extensions: [
"php"
"module"
"inc"
]
defaultBeautifier: "PHP-CS-Fixer"
options:
cs_fixer_path:
title: "PHP-CS-Fixer Path"
type: 'st... | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | 42cc95593048c2b78d7df9699cce50f966f7dc8d | 1,503 | https://github.com/Glavin001/atom-beautify/blob/42cc95593048c2b78d7df9699cce50f966f7dc8d/src/languages/php.coffee | 1 | 45 | ||
Glavin001/atom-beautify:src/languages/php.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = {
name: "PHP"
namespace: "php"
###
Supported Grammars
###
grammars: [
"PHP"
]
###
Supported extensions
###
extensions: [
"php"
"module"
"inc"
]
defaultBeautifier: "PHP-CS-Fixer"
options:
cs_fix... | module.exports = {
name: "PHP",
namespace: "php",
/*
Supported Grammars
*/
grammars: ["PHP"],
/*
Supported extensions
*/
extensions: ["php", "module", "inc"],
defaultBeautifier: "PHP-CS-Fixer",
options: {
cs_fixer_path: {
title: "PHP-CS-Fixer Path",
type: 'string',
default:... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | 42cc95593048c2b78d7df9699cce50f966f7dc8d | 1,503 | https://github.com/Glavin001/atom-beautify/blob/42cc95593048c2b78d7df9699cce50f966f7dc8d/src/languages/php.coffee | 1 | 45 |
Glavin001/atom-beautify:src/languages/php.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = {
name: "PHP",
namespace: "php",
/*
Supported Grammars
*/
grammars: ["PHP"],
/*
Supported extensions
*/
extensions: ["php", "module", "inc"],
defaultBeautifier: "PHP-CS-Fixer",
options: {
cs_fixer_path: {
title: "P... | module.exports = {
name: "PHP"
namespace: "php"
###
Supported Grammars
###
grammars: [
"PHP"
]
###
Supported extensions
###
extensions: [
"php"
"module"
"inc"
]
defaultBeautifier: "PHP-CS-Fixer"
options:
cs_fixer_path:
title: "PHP-CS-Fixer Path"
type: 'st... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | 42cc95593048c2b78d7df9699cce50f966f7dc8d | 1,503 | https://github.com/Glavin001/atom-beautify/blob/42cc95593048c2b78d7df9699cce50f966f7dc8d/src/languages/php.coffee | 1 | 45 |
Glavin001/atom-beautify:src/languages/php.coffee:1:completion | completion | module.exports = {
name: "PHP"
namespace: "php"
###
Supported Grammars
###
grammars: [
"PHP"
]
###
Supported extensions
###
extensions: [
"php"
"module"
"inc"
]
defaultBeautifier: "PHP-CS-Fixer" | options:
cs_fixer_path:
title: "PHP-CS-Fixer Path"
type: 'string'
default: ""
description: "Path to the `php-cs-fixer` CLI executable"
rules:
type: 'string'
default: ""
description: "Add rule(s). i.e. line_ending,-full_opening_tag,@PSR2"
phpcbf_path:
title: "P... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | 42cc95593048c2b78d7df9699cce50f966f7dc8d | 1,503 | https://github.com/Glavin001/atom-beautify/blob/42cc95593048c2b78d7df9699cce50f966f7dc8d/src/languages/php.coffee | 1 | 45 |
Glavin001/atom-beautify:src/languages/php.coffee:1:raw_corpus | raw_corpus | module.exports = {
name: "PHP"
namespace: "php"
###
Supported Grammars
###
grammars: [
"PHP"
]
###
Supported extensions
###
extensions: [
"php"
"module"
"inc"
]
options:
cs_fixer_path:
title: "PHP-CS-Fixer Path"
type: 'string'
default: ""
descrip... | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | 85d0f19e37b048bba5813b4b0e4f8c91cccf8568 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/85d0f19e37b048bba5813b4b0e4f8c91cccf8568/src/languages/php.coffee | 1 | 47 | ||
Glavin001/atom-beautify:src/languages/php.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = {
name: "PHP"
namespace: "php"
###
Supported Grammars
###
grammars: [
"PHP"
]
###
Supported extensions
###
extensions: [
"php"
"module"
"inc"
]
options:
cs_fixer_path:
title: "PHP-CS-Fixer P... | module.exports = {
name: "PHP",
namespace: "php",
/*
Supported Grammars
*/
grammars: ["PHP"],
/*
Supported extensions
*/
extensions: ["php", "module", "inc"],
options: {
cs_fixer_path: {
title: "PHP-CS-Fixer Path",
type: 'string',
default: "",
description: "Path to the ... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | 85d0f19e37b048bba5813b4b0e4f8c91cccf8568 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/85d0f19e37b048bba5813b4b0e4f8c91cccf8568/src/languages/php.coffee | 1 | 47 |
Glavin001/atom-beautify:src/languages/php.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = {
name: "PHP",
namespace: "php",
/*
Supported Grammars
*/
grammars: ["PHP"],
/*
Supported extensions
*/
extensions: ["php", "module", "inc"],
options: {
cs_fixer_path: {
title: "PHP-CS-Fixer Path",
type: 'strin... | module.exports = {
name: "PHP"
namespace: "php"
###
Supported Grammars
###
grammars: [
"PHP"
]
###
Supported extensions
###
extensions: [
"php"
"module"
"inc"
]
options:
cs_fixer_path:
title: "PHP-CS-Fixer Path"
type: 'string'
default: ""
descrip... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | 85d0f19e37b048bba5813b4b0e4f8c91cccf8568 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/85d0f19e37b048bba5813b4b0e4f8c91cccf8568/src/languages/php.coffee | 1 | 47 |
Glavin001/atom-beautify:src/languages/php.coffee:1:completion | completion | module.exports = {
name: "PHP"
namespace: "php"
###
Supported Grammars
###
grammars: [
"PHP"
]
###
Supported extensions
###
extensions: [
"php"
"module"
"inc"
]
options:
cs_fixer_path: | title: "PHP-CS-Fixer Path"
type: 'string'
default: ""
description: "Path to the `php-cs-fixer` CLI executable"
fixers:
type: 'string'
default: ""
description: "Add fixer(s). i.e. linefeed,-short_tag,indentation"
level:
type: 'string'
default: ""
description:... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/languages/php.coffee | MIT | 85d0f19e37b048bba5813b4b0e4f8c91cccf8568 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/85d0f19e37b048bba5813b4b0e4f8c91cccf8568/src/languages/php.coffee | 1 | 47 |
jianliaoim/talk-os:talk-web/client/util/animate.coffee:1:raw_corpus | raw_corpus | ease = require './ease'
exports.scrollTo = (node, targetPos, duration = 600, cb) ->
startPos = node.scrollTop
if startPos isnt targetPos
start = null
animate = (timestamp) ->
diff = Math.round targetPos - startPos
start or= timestamp
progress = timestamp - start
percent = if progr... | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/animate.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/animate.coffee | 1 | 22 | ||
jianliaoim/talk-os:talk-web/client/util/animate.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
ease = require './ease'
exports.scrollTo = (node, targetPos, duration = 600, cb) ->
startPos = node.scrollTop
if startPos isnt targetPos
start = null
animate = (timestamp) ->
diff = Math.round targetPos - startPos
start or= timestamp
... | var ease;
ease = require('./ease');
exports.scrollTo = function(node, targetPos, duration = 600, cb) {
var animate, start, startPos;
startPos = node.scrollTop;
if (startPos !== targetPos) {
start = null;
animate = function(timestamp) {
var currentPos, diff, percent, progress;
diff = Math.rou... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/util/animate.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/animate.coffee | 1 | 22 |
jianliaoim/talk-os:talk-web/client/util/animate.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ease;
ease = require('./ease');
exports.scrollTo = function(node, targetPos, duration = 600, cb) {
var animate, start, startPos;
startPos = node.scrollTop;
if (startPos !== targetPos) {
start = null;
animate = function(timestamp) {
var cur... | ease = require './ease'
exports.scrollTo = (node, targetPos, duration = 600, cb) ->
startPos = node.scrollTop
if startPos isnt targetPos
start = null
animate = (timestamp) ->
diff = Math.round targetPos - startPos
start or= timestamp
progress = timestamp - start
percent = if progr... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/animate.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/animate.coffee | 1 | 22 |
jianliaoim/talk-os:talk-web/client/util/animate.coffee:1:completion | completion | ease = require './ease'
exports.scrollTo = (node, targetPos, duration = 600, cb) ->
startPos = node.scrollTop
if startPos isnt targetPos
start = null
animate = (timestamp) ->
diff = Math.round targetPos - startPos
start or= timestamp | progress = timestamp - start
percent = if progress >= duration then 1 else ease.default progress / duration
currentPos = startPos + Math.ceil diff * percent
node.scrollTop = currentPos
if percent < 1
window.requestAnimationFrame animate
else cb?()
window.requestAnimationFram... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/animate.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/animate.coffee | 1 | 22 |
jianliaoim/talk-os:talk-api2x/server/controllers/discover.coffee:1:raw_corpus | raw_corpus | app = require '../server'
config = require 'config'
striker = require '../components/striker'
util = require '../util'
limbo = require 'limbo'
{
TeamModel
} = limbo.use 'talk'
module.exports = discoverController = app.controller 'discover', ->
@ratelimit '20', only: 'urlMeta'
@ensure 'url', only: 'urlMeta'
... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/controllers/discover.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/controllers/discover.coffee | 1 | 45 | ||
jianliaoim/talk-os:talk-api2x/server/controllers/discover.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
app = require '../server'
config = require 'config'
striker = require '../components/striker'
util = require '../util'
limbo = require 'limbo'
{
TeamModel
} = limbo.use 'talk'
module.exports = discoverController = app.controller 'discover', ->
@ratelimit '... | var TeamModel, app, config, discoverController, limbo, striker, util;
app = require('../server');
config = require('config');
striker = require('../components/striker');
util = require('../util');
limbo = require('limbo');
({TeamModel} = limbo.use('talk'));
module.exports = discoverController = app.controller('d... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/server/controllers/discover.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/controllers/discover.coffee | 1 | 45 |
jianliaoim/talk-os:talk-api2x/server/controllers/discover.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var TeamModel, app, config, discoverController, limbo, striker, util;
app = require('../server');
config = require('config');
striker = require('../components/striker');
util = require('../util');
limbo = require('limbo');
({TeamModel} = limbo.use('talk'));
... | app = require '../server'
config = require 'config'
striker = require '../components/striker'
util = require '../util'
limbo = require 'limbo'
{
TeamModel
} = limbo.use 'talk'
module.exports = discoverController = app.controller 'discover', ->
@ratelimit '20', only: 'urlMeta'
@ensure 'url', only: 'urlMeta'
... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/controllers/discover.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/controllers/discover.coffee | 1 | 45 |
jianliaoim/talk-os:talk-api2x/server/controllers/discover.coffee:1:completion | completion | app = require '../server'
config = require 'config'
striker = require '../components/striker'
util = require '../util'
limbo = require 'limbo'
{
TeamModel
} = limbo.use 'talk'
module.exports = discoverController = app.controller 'discover', ->
@ratelimit '20', only: 'urlMeta'
@ensure 'url', only: 'urlMeta'
... | apis[apiKey] or=
path: stack.path
method: stack.method
callback null, apis
@action 'strikerToken', (req, res, callback) ->
callback null, token: striker.signAuth()
@action 'urlMeta', (req, res, callback) ->
{url} = req.get()
url = 'http://' + url unless url.indexOf('http') is 0
... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/controllers/discover.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/controllers/discover.coffee | 1 | 45 |
andreyvit/json-diff:test/colorize_test.coffee:1:raw_corpus | raw_corpus | assert = require 'assert'
{ colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize"
describe 'colorizeToArray', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return ' <value>' for 'null' value", ->
assert.deepEq... | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | 76adeca7de9c86bb156dfecf6e3f43dc4237ab02 | 1,205 | https://github.com/andreyvit/json-diff/blob/76adeca7de9c86bb156dfecf6e3f43dc4237ab02/test/colorize_test.coffee | 1 | 50 | ||
andreyvit/json-diff:test/colorize_test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
assert = require 'assert'
{ colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize"
describe 'colorizeToArray', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should ... | var assert, colorize, colorizeToArray;
assert = require('assert');
({colorize, colorizeToArray} = require(`../${process.env.JSLIB || 'lib'}/colorize`));
describe('colorizeToArray', function() {
it("should return ' <value>' for a scalar value", function() {
return assert.deepEqual([' 42'], colorizeToArray(42));... | CoffeeScript | JavaScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | 76adeca7de9c86bb156dfecf6e3f43dc4237ab02 | 1,205 | https://github.com/andreyvit/json-diff/blob/76adeca7de9c86bb156dfecf6e3f43dc4237ab02/test/colorize_test.coffee | 1 | 50 |
andreyvit/json-diff:test/colorize_test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var assert, colorize, colorizeToArray;
assert = require('assert');
({colorize, colorizeToArray} = require(`../${process.env.JSLIB || 'lib'}/colorize`));
describe('colorizeToArray', function() {
it("should return ' <value>' for a scalar value", function() {
... | assert = require 'assert'
{ colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize"
describe 'colorizeToArray', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return ' <value>' for 'null' value", ->
assert.deepEq... | JavaScript | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | 76adeca7de9c86bb156dfecf6e3f43dc4237ab02 | 1,205 | https://github.com/andreyvit/json-diff/blob/76adeca7de9c86bb156dfecf6e3f43dc4237ab02/test/colorize_test.coffee | 1 | 50 |
andreyvit/json-diff:test/colorize_test.coffee:1:completion | completion | assert = require 'assert'
{ colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize"
describe 'colorizeToArray', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return ' <value>' for 'null' value", ->
assert.deepEq... | it "should return '+<added key>: <added value>' for an object diff with an added key", ->
assert.deepEqual [' {', '+ foo: 42', ' }'], colorizeToArray({ foo__added: 42 })
it "should return '+<added key>: <added value>' for an object diff with an added key with 'null' value", ->
assert.deepEqual [' {', '+ fo... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | 76adeca7de9c86bb156dfecf6e3f43dc4237ab02 | 1,205 | https://github.com/andreyvit/json-diff/blob/76adeca7de9c86bb156dfecf6e3f43dc4237ab02/test/colorize_test.coffee | 1 | 50 |
andreyvit/json-diff:test/colorize_test.coffee:2:raw_corpus | raw_corpus | it "should collapse long sequences of identical subobjects into one '...'", ->
input = [ [" "], [" "], [" "], [" "], [" "], [" "], [" "], ["~", {"foo__added": 42}], [" "] ]
expected = [" [", " ... (7 entries)", " {", "+ foo: 42", " }", " ...", " ]"]
assert.deepEqual colorizeToArray(input, {maxEli... | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | 76adeca7de9c86bb156dfecf6e3f43dc4237ab02 | 1,205 | https://github.com/andreyvit/json-diff/blob/76adeca7de9c86bb156dfecf6e3f43dc4237ab02/test/colorize_test.coffee | 51 | 63 | ||
andreyvit/json-diff:test/colorize_test.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "should collapse long sequences of identical subobjects into one '...'", ->
input = [ [" "], [" "], [" "], [" "], [" "], [" "], [" "], ["~", {"foo__added": 42}], [" "] ]
expected = [" [", " ... (7 entries)", " {", "+ foo: 42", " }", " ...", ... | it("should collapse long sequences of identical subobjects into one '...'", function() {
var expected, input;
input = [
[" "],
[" "],
[" "],
[" "],
[" "],
[" "],
[" "],
[
"~",
{
"foo__added": 42
}
],
[" "]
];
expected = [" [", " ... (7 entries)... | CoffeeScript | JavaScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | 76adeca7de9c86bb156dfecf6e3f43dc4237ab02 | 1,205 | https://github.com/andreyvit/json-diff/blob/76adeca7de9c86bb156dfecf6e3f43dc4237ab02/test/colorize_test.coffee | 51 | 63 |
andreyvit/json-diff:test/colorize_test.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("should collapse long sequences of identical subobjects into one '...'", function() {
var expected, input;
input = [
[" "],
[" "],
[" "],
[" "],
[" "],
[" "],
[" "],
[
"~",
{
"foo__added": 42
}
],... | it "should collapse long sequences of identical subobjects into one '...'", ->
input = [ [" "], [" "], [" "], [" "], [" "], [" "], [" "], ["~", {"foo__added": 42}], [" "] ]
expected = [" [", " ... (7 entries)", " {", "+ foo: 42", " }", " ...", " ]"]
assert.deepEqual colorizeToArray(input, {maxEli... | JavaScript | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | 76adeca7de9c86bb156dfecf6e3f43dc4237ab02 | 1,205 | https://github.com/andreyvit/json-diff/blob/76adeca7de9c86bb156dfecf6e3f43dc4237ab02/test/colorize_test.coffee | 51 | 63 |
andreyvit/json-diff:test/colorize_test.coffee:2:completion | completion | it "should collapse long sequences of identical subobjects into one '...'", ->
input = [ [" "], [" "], [" "], [" "], [" "], [" "], [" "], ["~", {"foo__added": 42}], [" "] ]
expected = [" [", " ... (7 entries)", " {", "+ foo: 42", " }", " ...", " ]"]
assert.deepEqual colorizeToArray(input, {maxEli... | describe 'colorize', ->
it "should return a string with ANSI escapes", ->
assert.equal colorize({ foo: { __old: 42, __new: 10 } }), " {\n\u001b[31m- foo: 42\u001b[39m\n\u001b[32m+ foo: 10\u001b[39m\n }\n"
it "should return a string without ANSI escapes on { color: false }", ->
assert.equal colorize({ fo... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | 76adeca7de9c86bb156dfecf6e3f43dc4237ab02 | 1,205 | https://github.com/andreyvit/json-diff/blob/76adeca7de9c86bb156dfecf6e3f43dc4237ab02/test/colorize_test.coffee | 51 | 63 |
andreyvit/json-diff:test/colorize_test.coffee:2:raw_corpus | raw_corpus | it "should collapse long sequences of identical subobjects into one '...'", ->
input = [ [" "], [" "], [" "], [" "], [" "], [" "], [" "], ["~", {"foo__added": 42}], [" "] ]
expected = [" [", " ... (7 entries)", " {", "+ foo: 42", " }", " ...", " ]"]
assert.deepEqual colorizeToArray(input, {collap... | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | d08cc67caff0e9d7fdbf41aaffa8b67947b673ef | 1,205 | https://github.com/andreyvit/json-diff/blob/d08cc67caff0e9d7fdbf41aaffa8b67947b673ef/test/colorize_test.coffee | 51 | 63 | ||
andreyvit/json-diff:test/colorize_test.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "should collapse long sequences of identical subobjects into one '...'", ->
input = [ [" "], [" "], [" "], [" "], [" "], [" "], [" "], ["~", {"foo__added": 42}], [" "] ]
expected = [" [", " ... (7 entries)", " {", "+ foo: 42", " }", " ...", ... | it("should collapse long sequences of identical subobjects into one '...'", function() {
var expected, input;
input = [
[" "],
[" "],
[" "],
[" "],
[" "],
[" "],
[" "],
[
"~",
{
"foo__added": 42
}
],
[" "]
];
expected = [" [", " ... (7 entries)... | CoffeeScript | JavaScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | d08cc67caff0e9d7fdbf41aaffa8b67947b673ef | 1,205 | https://github.com/andreyvit/json-diff/blob/d08cc67caff0e9d7fdbf41aaffa8b67947b673ef/test/colorize_test.coffee | 51 | 63 |
andreyvit/json-diff:test/colorize_test.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("should collapse long sequences of identical subobjects into one '...'", function() {
var expected, input;
input = [
[" "],
[" "],
[" "],
[" "],
[" "],
[" "],
[" "],
[
"~",
{
"foo__added": 42
}
],... | it "should collapse long sequences of identical subobjects into one '...'", ->
input = [ [" "], [" "], [" "], [" "], [" "], [" "], [" "], ["~", {"foo__added": 42}], [" "] ]
expected = [" [", " ... (7 entries)", " {", "+ foo: 42", " }", " ...", " ]"]
assert.deepEqual colorizeToArray(input, {collap... | JavaScript | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | d08cc67caff0e9d7fdbf41aaffa8b67947b673ef | 1,205 | https://github.com/andreyvit/json-diff/blob/d08cc67caff0e9d7fdbf41aaffa8b67947b673ef/test/colorize_test.coffee | 51 | 63 |
andreyvit/json-diff:test/colorize_test.coffee:2:completion | completion | it "should collapse long sequences of identical subobjects into one '...'", ->
input = [ [" "], [" "], [" "], [" "], [" "], [" "], [" "], ["~", {"foo__added": 42}], [" "] ]
expected = [" [", " ... (7 entries)", " {", "+ foo: 42", " }", " ...", " ]"]
assert.deepEqual colorizeToArray(input, {collap... | describe 'colorize', ->
it "should return a string with ANSI escapes", ->
assert.equal colorize({ foo: { __old: 42, __new: 10 } }), " {\n\u001b[31m- foo: 42\u001b[39m\n\u001b[32m+ foo: 10\u001b[39m\n }\n"
it "should return a string without ANSI escapes on { color: false }", ->
assert.equal colorize({ fo... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | d08cc67caff0e9d7fdbf41aaffa8b67947b673ef | 1,205 | https://github.com/andreyvit/json-diff/blob/d08cc67caff0e9d7fdbf41aaffa8b67947b673ef/test/colorize_test.coffee | 51 | 63 |
andreyvit/json-diff:test/colorize_test.coffee:2:raw_corpus | raw_corpus | describe 'colorize', ->
it "should return a string with ANSI escapes", ->
assert.equal colorize({ foo: { __old: 42, __new: 10 } }), " {\n\u001b[31m- foo: 42\u001b[39m\n\u001b[32m+ foo: 10\u001b[39m\n }\n"
it "should return a string without ANSI escapes on { color: false }", ->
assert.equal colorize({ fo... | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | a1009936f3a5b4e83026b05281339a6c79881fad | 1,205 | https://github.com/andreyvit/json-diff/blob/a1009936f3a5b4e83026b05281339a6c79881fad/test/colorize_test.coffee | 51 | 59 | ||
andreyvit/json-diff:test/colorize_test.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe 'colorize', ->
it "should return a string with ANSI escapes", ->
assert.equal colorize({ foo: { __old: 42, __new: 10 } }), " {\n\u001b[31m- foo: 42\u001b[39m\n\u001b[32m+ foo: 10\u001b[39m\n }\n"
it "should return a string without ANSI escape... | describe('colorize', function() {
it("should return a string with ANSI escapes", function() {
return assert.equal(colorize({
foo: {
__old: 42,
__new: 10
}
}), " {\n\u001b[31m- foo: 42\u001b[39m\n\u001b[32m+ foo: 10\u001b[39m\n }\n");
});
return it("should return a string with... | CoffeeScript | JavaScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | a1009936f3a5b4e83026b05281339a6c79881fad | 1,205 | https://github.com/andreyvit/json-diff/blob/a1009936f3a5b4e83026b05281339a6c79881fad/test/colorize_test.coffee | 51 | 59 |
andreyvit/json-diff:test/colorize_test.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe('colorize', function() {
it("should return a string with ANSI escapes", function() {
return assert.equal(colorize({
foo: {
__old: 42,
__new: 10
}
}), " {\n\u001b[31m- foo: 42\u001b[39m\n\u001b[32m+ foo: 10\u001b[39m\... | describe 'colorize', ->
it "should return a string with ANSI escapes", ->
assert.equal colorize({ foo: { __old: 42, __new: 10 } }), " {\n\u001b[31m- foo: 42\u001b[39m\n\u001b[32m+ foo: 10\u001b[39m\n }\n"
it "should return a string without ANSI escapes on { color: false }", ->
assert.equal colorize({ fo... | JavaScript | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | a1009936f3a5b4e83026b05281339a6c79881fad | 1,205 | https://github.com/andreyvit/json-diff/blob/a1009936f3a5b4e83026b05281339a6c79881fad/test/colorize_test.coffee | 51 | 59 |
andreyvit/json-diff:test/colorize_test.coffee:2:completion | completion | describe 'colorize', ->
it "should return a string with ANSI escapes", -> | assert.equal colorize({ foo: { __old: 42, __new: 10 } }), " {\n\u001b[31m- foo: 42\u001b[39m\n\u001b[32m+ foo: 10\u001b[39m\n }\n"
it "should return a string without ANSI escapes on { color: false }", ->
assert.equal colorize({ foo: { __old: 42, __new: 10 } }, color: no), " {\n- foo: 42\n+ foo: 10\n }\n" | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | a1009936f3a5b4e83026b05281339a6c79881fad | 1,205 | https://github.com/andreyvit/json-diff/blob/a1009936f3a5b4e83026b05281339a6c79881fad/test/colorize_test.coffee | 51 | 59 |
andreyvit/json-diff:test/colorize_test.coffee:1:raw_corpus | raw_corpus | assert = require 'assert'
{ colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize"
describe 'colorizeToArray', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return ' <value>' for 'null' value", ->
assert.deepEq... | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | 62c99508765e58389b2c1d9c4833eac069eb575e | 1,205 | https://github.com/andreyvit/json-diff/blob/62c99508765e58389b2c1d9c4833eac069eb575e/test/colorize_test.coffee | 1 | 50 | ||
andreyvit/json-diff:test/colorize_test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
assert = require 'assert'
{ colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize"
describe 'colorizeToArray', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should ... | var assert, colorize, colorizeToArray;
assert = require('assert');
({colorize, colorizeToArray} = require(`../${process.env.JSLIB || 'lib'}/colorize`));
describe('colorizeToArray', function() {
it("should return ' <value>' for a scalar value", function() {
return assert.deepEqual([' 42'], colorizeToArray(42));... | CoffeeScript | JavaScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | 62c99508765e58389b2c1d9c4833eac069eb575e | 1,205 | https://github.com/andreyvit/json-diff/blob/62c99508765e58389b2c1d9c4833eac069eb575e/test/colorize_test.coffee | 1 | 50 |
andreyvit/json-diff:test/colorize_test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var assert, colorize, colorizeToArray;
assert = require('assert');
({colorize, colorizeToArray} = require(`../${process.env.JSLIB || 'lib'}/colorize`));
describe('colorizeToArray', function() {
it("should return ' <value>' for a scalar value", function() {
... | assert = require 'assert'
{ colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize"
describe 'colorizeToArray', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return ' <value>' for 'null' value", ->
assert.deepEq... | JavaScript | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | 62c99508765e58389b2c1d9c4833eac069eb575e | 1,205 | https://github.com/andreyvit/json-diff/blob/62c99508765e58389b2c1d9c4833eac069eb575e/test/colorize_test.coffee | 1 | 50 |
andreyvit/json-diff:test/colorize_test.coffee:1:completion | completion | assert = require 'assert'
{ colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize"
describe 'colorizeToArray', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return ' <value>' for 'null' value", ->
assert.deepEq... | assert.deepEqual [' {', '+ foo: 42', ' }'], colorizeToArray({ foo__added: 42 })
it "should return '+<added key>: <added value>' for an object diff with an added key with 'null' value", ->
assert.deepEqual [' {', '+ foo: null', ' }'], colorizeToArray({ foo__added: null })
it "should return '+<added key>: <ad... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | 62c99508765e58389b2c1d9c4833eac069eb575e | 1,205 | https://github.com/andreyvit/json-diff/blob/62c99508765e58389b2c1d9c4833eac069eb575e/test/colorize_test.coffee | 1 | 50 |
andreyvit/json-diff:test/colorize_test.coffee:1:raw_corpus | raw_corpus | assert = require 'assert'
{ colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize"
describe 'colorizeToArray', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return '-<old value>', '+<new value>' for a scalar diff",... | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | a582fd1c182245f8ea364876ce97fe49c3170d9d | 1,205 | https://github.com/andreyvit/json-diff/blob/a582fd1c182245f8ea364876ce97fe49c3170d9d/test/colorize_test.coffee | 1 | 45 | ||
andreyvit/json-diff:test/colorize_test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
assert = require 'assert'
{ colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize"
describe 'colorizeToArray', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should ... | var assert, colorize, colorizeToArray;
assert = require('assert');
({colorize, colorizeToArray} = require(`../${process.env.JSLIB || 'lib'}/colorize`));
describe('colorizeToArray', function() {
it("should return ' <value>' for a scalar value", function() {
return assert.deepEqual([' 42'], colorizeToArray(42));... | CoffeeScript | JavaScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | a582fd1c182245f8ea364876ce97fe49c3170d9d | 1,205 | https://github.com/andreyvit/json-diff/blob/a582fd1c182245f8ea364876ce97fe49c3170d9d/test/colorize_test.coffee | 1 | 45 |
andreyvit/json-diff:test/colorize_test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var assert, colorize, colorizeToArray;
assert = require('assert');
({colorize, colorizeToArray} = require(`../${process.env.JSLIB || 'lib'}/colorize`));
describe('colorizeToArray', function() {
it("should return ' <value>' for a scalar value", function() {
... | assert = require 'assert'
{ colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize"
describe 'colorizeToArray', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return '-<old value>', '+<new value>' for a scalar diff",... | JavaScript | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | a582fd1c182245f8ea364876ce97fe49c3170d9d | 1,205 | https://github.com/andreyvit/json-diff/blob/a582fd1c182245f8ea364876ce97fe49c3170d9d/test/colorize_test.coffee | 1 | 45 |
andreyvit/json-diff:test/colorize_test.coffee:1:completion | completion | assert = require 'assert'
{ colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize"
describe 'colorizeToArray', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return '-<old value>', '+<new value>' for a scalar diff",... | assert.deepEqual [' {', '- foo: 42', '+ foo: 10', ' }'], colorizeToArray({ foo: { __old: 42, __new: 10 } })
it "should return '+<inserted item>' for an array diff", ->
assert.deepEqual [' [', ' 10', '+ 20', ' 30', ' ]'], colorizeToArray([[' ', 10], ['+', 20], [' ', 30]])
it "should return '-<deleted it... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | a582fd1c182245f8ea364876ce97fe49c3170d9d | 1,205 | https://github.com/andreyvit/json-diff/blob/a582fd1c182245f8ea364876ce97fe49c3170d9d/test/colorize_test.coffee | 1 | 45 |
andreyvit/json-diff:test/colorize_test.coffee:1:raw_corpus | raw_corpus | assert = require 'assert'
{ colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize"
describe 'colorizeToArray', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return '-<old value>', '+<new value>' for a scalar diff",... | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | 1de4e92df747d474742770494504260ffc311363 | 1,205 | https://github.com/andreyvit/json-diff/blob/1de4e92df747d474742770494504260ffc311363/test/colorize_test.coffee | 1 | 38 | ||
andreyvit/json-diff:test/colorize_test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
assert = require 'assert'
{ colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize"
describe 'colorizeToArray', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should ... | var assert, colorize, colorizeToArray;
assert = require('assert');
({colorize, colorizeToArray} = require(`../${process.env.JSLIB || 'lib'}/colorize`));
describe('colorizeToArray', function() {
it("should return ' <value>' for a scalar value", function() {
return assert.deepEqual([' 42'], colorizeToArray(42));... | CoffeeScript | JavaScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | 1de4e92df747d474742770494504260ffc311363 | 1,205 | https://github.com/andreyvit/json-diff/blob/1de4e92df747d474742770494504260ffc311363/test/colorize_test.coffee | 1 | 38 |
andreyvit/json-diff:test/colorize_test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var assert, colorize, colorizeToArray;
assert = require('assert');
({colorize, colorizeToArray} = require(`../${process.env.JSLIB || 'lib'}/colorize`));
describe('colorizeToArray', function() {
it("should return ' <value>' for a scalar value", function() {
... | assert = require 'assert'
{ colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize"
describe 'colorizeToArray', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return '-<old value>', '+<new value>' for a scalar diff",... | JavaScript | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | 1de4e92df747d474742770494504260ffc311363 | 1,205 | https://github.com/andreyvit/json-diff/blob/1de4e92df747d474742770494504260ffc311363/test/colorize_test.coffee | 1 | 38 |
andreyvit/json-diff:test/colorize_test.coffee:1:completion | completion | assert = require 'assert'
{ colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize"
describe 'colorizeToArray', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return '-<old value>', '+<new value>' for a scalar diff",... | assert.deepEqual [' {', '+ foo: {', '+ bar: 42', '+ }', ' }'], colorizeToArray({ foo__added: { bar: 42 } })
it "should return ' <modified key>: <colorized diff>' for an object diff with a modified key", ->
assert.deepEqual [' {', '- foo: 42', '+ foo: 10', ' }'], colorizeToArray({ foo: { __old: 42, __new: ... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | 1de4e92df747d474742770494504260ffc311363 | 1,205 | https://github.com/andreyvit/json-diff/blob/1de4e92df747d474742770494504260ffc311363/test/colorize_test.coffee | 1 | 38 |
andreyvit/json-diff:test/colorize_test.coffee:1:raw_corpus | raw_corpus | assert = require 'assert'
{ colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize"
describe 'colorize', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return '-<old value>', '+<new value>' for a scalar diff", ->
... | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | 75d044d9d6c9dd00c27f920d5149021a10dc54b1 | 1,205 | https://github.com/andreyvit/json-diff/blob/75d044d9d6c9dd00c27f920d5149021a10dc54b1/test/colorize_test.coffee | 1 | 29 | ||
andreyvit/json-diff:test/colorize_test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
assert = require 'assert'
{ colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize"
describe 'colorize', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return ... | var assert, colorize, colorizeToArray;
assert = require('assert');
({colorize, colorizeToArray} = require(`../${process.env.JSLIB || 'lib'}/colorize`));
describe('colorize', function() {
it("should return ' <value>' for a scalar value", function() {
return assert.deepEqual([' 42'], colorizeToArray(42));
});
... | CoffeeScript | JavaScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | 75d044d9d6c9dd00c27f920d5149021a10dc54b1 | 1,205 | https://github.com/andreyvit/json-diff/blob/75d044d9d6c9dd00c27f920d5149021a10dc54b1/test/colorize_test.coffee | 1 | 29 |
andreyvit/json-diff:test/colorize_test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var assert, colorize, colorizeToArray;
assert = require('assert');
({colorize, colorizeToArray} = require(`../${process.env.JSLIB || 'lib'}/colorize`));
describe('colorize', function() {
it("should return ' <value>' for a scalar value", function() {
return... | assert = require 'assert'
{ colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize"
describe 'colorize', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return '-<old value>', '+<new value>' for a scalar diff", ->
... | JavaScript | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | 75d044d9d6c9dd00c27f920d5149021a10dc54b1 | 1,205 | https://github.com/andreyvit/json-diff/blob/75d044d9d6c9dd00c27f920d5149021a10dc54b1/test/colorize_test.coffee | 1 | 29 |
andreyvit/json-diff:test/colorize_test.coffee:1:completion | completion | assert = require 'assert'
{ colorize, colorizeToArray } = require "../#{process.env.JSLIB or 'lib'}/colorize"
describe 'colorize', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return '-<old value>', '+<new value>' for a scalar diff", ->
... | it "should return '+<added key>: <added value>' for an object diff with an added key", ->
assert.deepEqual [' {', '+ foo: 42', ' }'], colorizeToArray({ foo__added: 42 })
it "should return '+<added key>: <added stringified value>' for an object diff with an added key and a non-scalar value", ->
assert.deepEq... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | 75d044d9d6c9dd00c27f920d5149021a10dc54b1 | 1,205 | https://github.com/andreyvit/json-diff/blob/75d044d9d6c9dd00c27f920d5149021a10dc54b1/test/colorize_test.coffee | 1 | 29 |
andreyvit/json-diff:test/colorize_test.coffee:1:raw_corpus | raw_corpus | assert = require 'assert'
{ colorizeToArray } = require '../lib/colorize'
describe 'colorize', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return '-<old value>', '+<new value>' for a scalar diff", ->
assert.deepEqual ['-42', '+10'], co... | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | c9b173d7d808f22a55224f332f72bd25c5b7c352 | 1,205 | https://github.com/andreyvit/json-diff/blob/c9b173d7d808f22a55224f332f72bd25c5b7c352/test/colorize_test.coffee | 1 | 29 | ||
andreyvit/json-diff:test/colorize_test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
assert = require 'assert'
{ colorizeToArray } = require '../lib/colorize'
describe 'colorize', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return '-<old value>', '+<new value>' for a... | var assert, colorizeToArray;
assert = require('assert');
({colorizeToArray} = require('../lib/colorize'));
describe('colorize', function() {
it("should return ' <value>' for a scalar value", function() {
return assert.deepEqual([' 42'], colorizeToArray(42));
});
it("should return '-<old value>', '+<new val... | CoffeeScript | JavaScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | c9b173d7d808f22a55224f332f72bd25c5b7c352 | 1,205 | https://github.com/andreyvit/json-diff/blob/c9b173d7d808f22a55224f332f72bd25c5b7c352/test/colorize_test.coffee | 1 | 29 |
andreyvit/json-diff:test/colorize_test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var assert, colorizeToArray;
assert = require('assert');
({colorizeToArray} = require('../lib/colorize'));
describe('colorize', function() {
it("should return ' <value>' for a scalar value", function() {
return assert.deepEqual([' 42'], colorizeToArray(42)... | assert = require 'assert'
{ colorizeToArray } = require '../lib/colorize'
describe 'colorize', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return '-<old value>', '+<new value>' for a scalar diff", ->
assert.deepEqual ['-42', '+10'], co... | JavaScript | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | c9b173d7d808f22a55224f332f72bd25c5b7c352 | 1,205 | https://github.com/andreyvit/json-diff/blob/c9b173d7d808f22a55224f332f72bd25c5b7c352/test/colorize_test.coffee | 1 | 29 |
andreyvit/json-diff:test/colorize_test.coffee:1:completion | completion | assert = require 'assert'
{ colorizeToArray } = require '../lib/colorize'
describe 'colorize', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return '-<old value>', '+<new value>' for a scalar diff", ->
assert.deepEqual ['-42', '+10'], co... | it "should return '+<added key>: <added value>' for an object diff with an added key", ->
assert.deepEqual [' {', '+ foo: 42', ' }'], colorizeToArray({ foo__added: 42 })
it "should return '+<added key>: <added stringified value>' for an object diff with an added key and a non-scalar value", ->
assert.deepEq... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | c9b173d7d808f22a55224f332f72bd25c5b7c352 | 1,205 | https://github.com/andreyvit/json-diff/blob/c9b173d7d808f22a55224f332f72bd25c5b7c352/test/colorize_test.coffee | 1 | 29 |
andreyvit/json-diff:test/colorize_test.coffee:1:raw_corpus | raw_corpus | assert = require 'assert'
{ colorizeToArray } = require '../lib/colorize'
describe 'colorize', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return '-<old value>', '+<new value>' for a scalar diff", ->
assert.deepEqual ['-42', '+10'], co... | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | c37d2709f7f1f7566b1a4b3d239c04211e828d9b | 1,205 | https://github.com/andreyvit/json-diff/blob/c37d2709f7f1f7566b1a4b3d239c04211e828d9b/test/colorize_test.coffee | 1 | 29 | ||
andreyvit/json-diff:test/colorize_test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
assert = require 'assert'
{ colorizeToArray } = require '../lib/colorize'
describe 'colorize', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return '-<old value>', '+<new value>' for a... | var assert, colorizeToArray;
assert = require('assert');
({colorizeToArray} = require('../lib/colorize'));
describe('colorize', function() {
it("should return ' <value>' for a scalar value", function() {
return assert.deepEqual([' 42'], colorizeToArray(42));
});
it("should return '-<old value>', '+<new val... | CoffeeScript | JavaScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | c37d2709f7f1f7566b1a4b3d239c04211e828d9b | 1,205 | https://github.com/andreyvit/json-diff/blob/c37d2709f7f1f7566b1a4b3d239c04211e828d9b/test/colorize_test.coffee | 1 | 29 |
andreyvit/json-diff:test/colorize_test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var assert, colorizeToArray;
assert = require('assert');
({colorizeToArray} = require('../lib/colorize'));
describe('colorize', function() {
it("should return ' <value>' for a scalar value", function() {
return assert.deepEqual([' 42'], colorizeToArray(42)... | assert = require 'assert'
{ colorizeToArray } = require '../lib/colorize'
describe 'colorize', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return '-<old value>', '+<new value>' for a scalar diff", ->
assert.deepEqual ['-42', '+10'], co... | JavaScript | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | c37d2709f7f1f7566b1a4b3d239c04211e828d9b | 1,205 | https://github.com/andreyvit/json-diff/blob/c37d2709f7f1f7566b1a4b3d239c04211e828d9b/test/colorize_test.coffee | 1 | 29 |
andreyvit/json-diff:test/colorize_test.coffee:1:completion | completion | assert = require 'assert'
{ colorizeToArray } = require '../lib/colorize'
describe 'colorize', ->
it "should return ' <value>' for a scalar value", ->
assert.deepEqual [' 42'], colorizeToArray(42)
it "should return '-<old value>', '+<new value>' for a scalar diff", ->
assert.deepEqual ['-42', '+10'], co... | it "should return '+<added key>: <added value>' for an object diff with an added key", ->
assert.deepEqual [' {', '+ foo: 42', ' }'], colorizeToArray({ foo__added: 42 })
it "should return '+<added key>: <added stringified value>' for an object diff with an added key and a non-scalar value", ->
assert.deepEq... | CoffeeScript | CoffeeScript | andreyvit/json-diff | test/colorize_test.coffee | MIT | c37d2709f7f1f7566b1a4b3d239c04211e828d9b | 1,205 | https://github.com/andreyvit/json-diff/blob/c37d2709f7f1f7566b1a4b3d239c04211e828d9b/test/colorize_test.coffee | 1 | 29 |
meltingice/psd.js:lib/psd/init.coffee:1:raw_corpus | raw_corpus | fs = require 'fs'
RSVP = require 'rsvp'
# The init methods for the NodeJS version of PSD.js. When compiled for
# the web, browserify will overwrite this file with a browser-based shim.
module.exports =
extended: (PSD) ->
# Instantiates a new PSD object synchronously from the given
# file path.
@fromFile ... | CoffeeScript | meltingice/psd.js | lib/psd/init.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/init.coffee | 1 | 21 | ||
meltingice/psd.js:lib/psd/init.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
fs = require 'fs'
RSVP = require 'rsvp'
# The init methods for the NodeJS version of PSD.js. When compiled for
# the web, browserify will overwrite this file with a browser-based shim.
module.exports =
extended: (PSD) ->
# Instantiates a new PSD object syn... | var RSVP, fs;
fs = require('fs');
RSVP = require('rsvp');
// The init methods for the NodeJS version of PSD.js. When compiled for
// the web, browserify will overwrite this file with a browser-based shim.
module.exports = {
extended: function(PSD) {
// Instantiates a new PSD object synchronously from the given... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/init.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/init.coffee | 1 | 21 |
meltingice/psd.js:lib/psd/init.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var RSVP, fs;
fs = require('fs');
RSVP = require('rsvp');
// The init methods for the NodeJS version of PSD.js. When compiled for
// the web, browserify will overwrite this file with a browser-based shim.
module.exports = {
extended: function(PSD) {
// Ins... | fs = require 'fs'
RSVP = require 'rsvp'
# The init methods for the NodeJS version of PSD.js. When compiled for
# the web, browserify will overwrite this file with a browser-based shim.
module.exports =
extended: (PSD) ->
# Instantiates a new PSD object synchronously from the given
# file path.
@fromFile ... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/init.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/init.coffee | 1 | 21 |
meltingice/psd.js:lib/psd/init.coffee:1:completion | completion | fs = require 'fs'
RSVP = require 'rsvp'
# The init methods for the NodeJS version of PSD.js. When compiled for
# the web, browserify will overwrite this file with a browser-based shim.
module.exports =
extended: (PSD) ->
# Instantiates a new PSD object synchronously from the given
# file path.
@fromFile ... | # Instantiates a new PSD object asynchronously from the given
# file path. This method also parses the PSD for you.
@open = (file) ->
new RSVP.Promise (resolve, reject) ->
fs.readFile file, (err, data) =>
return reject(err) if err
psd = new PSD(data)
psd.parse()
... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/init.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/init.coffee | 1 | 21 |
meltingice/psd.js:lib/psd/init.coffee:1:raw_corpus | raw_corpus | fs = require 'fs'
RSVP = require 'rsvp'
module.exports =
extended: (PSD) ->
@fromFile = (file) -> new PSD(fs.readFileSync(file))
@open = (file) ->
new RSVP.Promise (resolve, reject) ->
fs.readFile file, (err, data) =>
return reject(err) if err
psd = new PSD(data)
... | CoffeeScript | meltingice/psd.js | lib/psd/init.coffee | MIT | b43e5693bd81415b488df0b75206be5b660fa16d | 2,846 | https://github.com/meltingice/psd.js/blob/b43e5693bd81415b488df0b75206be5b660fa16d/lib/psd/init.coffee | 1 | 14 | ||
meltingice/psd.js:lib/psd/init.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
fs = require 'fs'
RSVP = require 'rsvp'
module.exports =
extended: (PSD) ->
@fromFile = (file) -> new PSD(fs.readFileSync(file))
@open = (file) ->
new RSVP.Promise (resolve, reject) ->
fs.readFile file, (err, data) =>
return rej... | var RSVP, fs;
fs = require('fs');
RSVP = require('rsvp');
module.exports = {
extended: function(PSD) {
this.fromFile = function(file) {
return new PSD(fs.readFileSync(file));
};
return this.open = function(file) {
return new RSVP.Promise(function(resolve, reject) {
return fs.readFil... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/init.coffee | MIT | b43e5693bd81415b488df0b75206be5b660fa16d | 2,846 | https://github.com/meltingice/psd.js/blob/b43e5693bd81415b488df0b75206be5b660fa16d/lib/psd/init.coffee | 1 | 14 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.