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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
octoblu/meshblu:lib/doMessageHooks.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
async = require 'async'
module.exports = (device, hooks, message, callback=_.noop, dependencies={}) ->
MessageWebhook = dependencies.MessageWebhook ? require './MessageWebhook'
hooks ?= []
async.map hooks, (hook, cb=->) =>
messageWebhook = new MessageWebhook device.uuid, hook
messag... | CoffeeScript | octoblu/meshblu | lib/doMessageHooks.coffee | MIT | 91a7e4ed0094294d168de96de0a3f76ed5f21e9b | 815 | https://github.com/octoblu/meshblu/blob/91a7e4ed0094294d168de96de0a3f76ed5f21e9b/lib/doMessageHooks.coffee | 1 | 13 | ||
octoblu/meshblu:lib/doMessageHooks.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
async = require 'async'
module.exports = (device, hooks, message, callback=_.noop, dependencies={}) ->
MessageWebhook = dependencies.MessageWebhook ? require './MessageWebhook'
hooks ?= []
async.map hooks, (hook, cb=->) =>
message... | var _, async;
_ = require('lodash');
async = require('async');
module.exports = function(device, hooks, message, callback = _.noop, dependencies = {}) {
var MessageWebhook, ref;
MessageWebhook = (ref = dependencies.MessageWebhook) != null ? ref : require('./MessageWebhook');
if (hooks == null) {
hooks = []... | CoffeeScript | JavaScript | octoblu/meshblu | lib/doMessageHooks.coffee | MIT | 91a7e4ed0094294d168de96de0a3f76ed5f21e9b | 815 | https://github.com/octoblu/meshblu/blob/91a7e4ed0094294d168de96de0a3f76ed5f21e9b/lib/doMessageHooks.coffee | 1 | 13 |
octoblu/meshblu:lib/doMessageHooks.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, async;
_ = require('lodash');
async = require('async');
module.exports = function(device, hooks, message, callback = _.noop, dependencies = {}) {
var MessageWebhook, ref;
MessageWebhook = (ref = dependencies.MessageWebhook) != null ? ref : require('./... | _ = require 'lodash'
async = require 'async'
module.exports = (device, hooks, message, callback=_.noop, dependencies={}) ->
MessageWebhook = dependencies.MessageWebhook ? require './MessageWebhook'
hooks ?= []
async.map hooks, (hook, cb=->) =>
messageWebhook = new MessageWebhook device.uuid, hook
messag... | JavaScript | CoffeeScript | octoblu/meshblu | lib/doMessageHooks.coffee | MIT | 91a7e4ed0094294d168de96de0a3f76ed5f21e9b | 815 | https://github.com/octoblu/meshblu/blob/91a7e4ed0094294d168de96de0a3f76ed5f21e9b/lib/doMessageHooks.coffee | 1 | 13 |
octoblu/meshblu:lib/doMessageHooks.coffee:1:completion | completion | _ = require 'lodash'
async = require 'async'
module.exports = (device, hooks, message, callback=_.noop, dependencies={}) ->
MessageWebhook = dependencies.MessageWebhook ? require './MessageWebhook'
hooks ?= [] | async.map hooks, (hook, cb=->) =>
messageWebhook = new MessageWebhook device.uuid, hook
messageWebhook.send message, (error) =>
cb null, error
, (error, errors) =>
callback errors | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/doMessageHooks.coffee | MIT | 91a7e4ed0094294d168de96de0a3f76ed5f21e9b | 815 | https://github.com/octoblu/meshblu/blob/91a7e4ed0094294d168de96de0a3f76ed5f21e9b/lib/doMessageHooks.coffee | 1 | 13 |
octoblu/meshblu:lib/doMessageHooks.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
async = require 'async'
module.exports = (device, hooks, message, callback=_.noop, dependencies={}) ->
MessageWebhook = dependencies.MessageWebhook ? require './MessageWebhook'
hooks ?= []
async.map hooks, (hook, cb=->) =>
messageWebhook = new MessageWebhook device, hook
messageWebh... | CoffeeScript | octoblu/meshblu | lib/doMessageHooks.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/lib/doMessageHooks.coffee | 1 | 13 | ||
octoblu/meshblu:lib/doMessageHooks.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
async = require 'async'
module.exports = (device, hooks, message, callback=_.noop, dependencies={}) ->
MessageWebhook = dependencies.MessageWebhook ? require './MessageWebhook'
hooks ?= []
async.map hooks, (hook, cb=->) =>
message... | var _, async;
_ = require('lodash');
async = require('async');
module.exports = function(device, hooks, message, callback = _.noop, dependencies = {}) {
var MessageWebhook, ref;
MessageWebhook = (ref = dependencies.MessageWebhook) != null ? ref : require('./MessageWebhook');
if (hooks == null) {
hooks = []... | CoffeeScript | JavaScript | octoblu/meshblu | lib/doMessageHooks.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/lib/doMessageHooks.coffee | 1 | 13 |
octoblu/meshblu:lib/doMessageHooks.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, async;
_ = require('lodash');
async = require('async');
module.exports = function(device, hooks, message, callback = _.noop, dependencies = {}) {
var MessageWebhook, ref;
MessageWebhook = (ref = dependencies.MessageWebhook) != null ? ref : require('./... | _ = require 'lodash'
async = require 'async'
module.exports = (device, hooks, message, callback=_.noop, dependencies={}) ->
MessageWebhook = dependencies.MessageWebhook ? require './MessageWebhook'
hooks ?= []
async.map hooks, (hook, cb=->) =>
messageWebhook = new MessageWebhook device, hook
messageWebh... | JavaScript | CoffeeScript | octoblu/meshblu | lib/doMessageHooks.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/lib/doMessageHooks.coffee | 1 | 13 |
octoblu/meshblu:lib/doMessageHooks.coffee:1:completion | completion | _ = require 'lodash'
async = require 'async'
module.exports = (device, hooks, message, callback=_.noop, dependencies={}) ->
MessageWebhook = dependencies.MessageWebhook ? require './MessageWebhook'
hooks ?= [] | async.map hooks, (hook, cb=->) =>
messageWebhook = new MessageWebhook device, hook
messageWebhook.send message, (error) =>
cb null, error
, (error, errors) =>
callback errors | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/doMessageHooks.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/lib/doMessageHooks.coffee | 1 | 13 |
octoblu/meshblu:lib/doMessageHooks.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
async = require 'async'
module.exports = (hooks, message, callback=_.noop, dependencies={}) ->
MessageWebhook = dependencies.MessageWebhook ? require './MessageWebhook'
hooks ?= []
async.map hooks, (hook, cb=->) =>
messageWebhook = new MessageWebhook hook
messageWebhook.send message... | CoffeeScript | octoblu/meshblu | lib/doMessageHooks.coffee | MIT | c5c362d82ec94ad008db45c35f10e3f02ad222e2 | 815 | https://github.com/octoblu/meshblu/blob/c5c362d82ec94ad008db45c35f10e3f02ad222e2/lib/doMessageHooks.coffee | 1 | 13 | ||
octoblu/meshblu:lib/doMessageHooks.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
async = require 'async'
module.exports = (hooks, message, callback=_.noop, dependencies={}) ->
MessageWebhook = dependencies.MessageWebhook ? require './MessageWebhook'
hooks ?= []
async.map hooks, (hook, cb=->) =>
messageWebhook ... | var _, async;
_ = require('lodash');
async = require('async');
module.exports = function(hooks, message, callback = _.noop, dependencies = {}) {
var MessageWebhook, ref;
MessageWebhook = (ref = dependencies.MessageWebhook) != null ? ref : require('./MessageWebhook');
if (hooks == null) {
hooks = [];
}
... | CoffeeScript | JavaScript | octoblu/meshblu | lib/doMessageHooks.coffee | MIT | c5c362d82ec94ad008db45c35f10e3f02ad222e2 | 815 | https://github.com/octoblu/meshblu/blob/c5c362d82ec94ad008db45c35f10e3f02ad222e2/lib/doMessageHooks.coffee | 1 | 13 |
octoblu/meshblu:lib/doMessageHooks.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, async;
_ = require('lodash');
async = require('async');
module.exports = function(hooks, message, callback = _.noop, dependencies = {}) {
var MessageWebhook, ref;
MessageWebhook = (ref = dependencies.MessageWebhook) != null ? ref : require('./MessageW... | _ = require 'lodash'
async = require 'async'
module.exports = (hooks, message, callback=_.noop, dependencies={}) ->
MessageWebhook = dependencies.MessageWebhook ? require './MessageWebhook'
hooks ?= []
async.map hooks, (hook, cb=->) =>
messageWebhook = new MessageWebhook hook
messageWebhook.send message... | JavaScript | CoffeeScript | octoblu/meshblu | lib/doMessageHooks.coffee | MIT | c5c362d82ec94ad008db45c35f10e3f02ad222e2 | 815 | https://github.com/octoblu/meshblu/blob/c5c362d82ec94ad008db45c35f10e3f02ad222e2/lib/doMessageHooks.coffee | 1 | 13 |
octoblu/meshblu:lib/doMessageHooks.coffee:1:completion | completion | _ = require 'lodash'
async = require 'async'
module.exports = (hooks, message, callback=_.noop, dependencies={}) ->
MessageWebhook = dependencies.MessageWebhook ? require './MessageWebhook'
hooks ?= [] | async.map hooks, (hook, cb=->) =>
messageWebhook = new MessageWebhook hook
messageWebhook.send message, (error) =>
cb null, error
, (error, errors) =>
callback errors | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/doMessageHooks.coffee | MIT | c5c362d82ec94ad008db45c35f10e3f02ad222e2 | 815 | https://github.com/octoblu/meshblu/blob/c5c362d82ec94ad008db45c35f10e3f02ad222e2/lib/doMessageHooks.coffee | 1 | 13 |
jianliaoim/talk-os:talk-web/client/module/light-dialog.coffee:1:raw_corpus | raw_corpus | React = require 'react'
keycode = require 'keycode'
mixinLayered = require '../mixin/layered'
Transition = React.createFactory require './transition'
div = React.createFactory 'div'
span = React.createFactory 'span'
a = React.createFactory 'a'
button = React.createFactory 'button'
T = React.PropTypes
cx =... | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/light-dialog.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-dialog.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-web/client/module/light-dialog.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
React = require 'react'
keycode = require 'keycode'
mixinLayered = require '../mixin/layered'
Transition = React.createFactory require './transition'
div = React.createFactory 'div'
span = React.createFactory 'span'
a = React.createFactory 'a'
button... | var React, T, Transition, a, button, cx, div, keycode, mixinLayered, span;
React = require('react');
keycode = require('keycode');
mixinLayered = require('../mixin/layered');
Transition = React.createFactory(require('./transition'));
div = React.createFactory('div');
span = React.createFactory('span');
a = React... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/module/light-dialog.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-dialog.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/module/light-dialog.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var React, T, Transition, a, button, cx, div, keycode, mixinLayered, span;
React = require('react');
keycode = require('keycode');
mixinLayered = require('../mixin/layered');
Transition = React.createFactory(require('./transition'));
div = React.createFactory(... | React = require 'react'
keycode = require 'keycode'
mixinLayered = require '../mixin/layered'
Transition = React.createFactory require './transition'
div = React.createFactory 'div'
span = React.createFactory 'span'
a = React.createFactory 'a'
button = React.createFactory 'button'
T = React.PropTypes
cx =... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/light-dialog.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-dialog.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/module/light-dialog.coffee:1:completion | completion | React = require 'react'
keycode = require 'keycode'
mixinLayered = require '../mixin/layered'
Transition = React.createFactory require './transition'
div = React.createFactory 'div'
span = React.createFactory 'span'
a = React.createFactory 'a'
button = React.createFactory 'button'
T = React.PropTypes
cx =... | show: T.bool.isRequired
onCloseClick: T.func.isRequired
onConfirm: T.func.isRequired
bindWindowEvents: ->
window.addEventListener 'keydown', @onWindowKeydown
unbindWindowEvents: ->
window.removeEventListener 'keydown', @onWindowKeydown
onWindowKeydown: (event) ->
if keycode(event... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/light-dialog.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-dialog.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/module/light-dialog.coffee:2:raw_corpus | raw_corpus | renderActions: ->
div className: 'actions line',
button className: 'button is-link', onClick: @onCloseClick,
@props.cancel
button className: 'button is-danger', onClick: @onConfirmClick,
@props.confirm
renderLayer: (afterTransition) ->
className = "light-dialog is-for-#{@props.nam... | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/light-dialog.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-dialog.coffee | 51 | 73 | ||
jianliaoim/talk-os:talk-web/client/module/light-dialog.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
renderActions: ->
div className: 'actions line',
button className: 'button is-link', onClick: @onCloseClick,
@props.cancel
button className: 'button is-danger', onClick: @onConfirmClick,
@props.confirm
renderLayer: (afterTransit... | ({
renderActions: function() {
return div({
className: 'actions line'
}, button({
className: 'button is-link',
onClick: this.onCloseClick
}, this.props.cancel), button({
className: 'button is-danger',
onClick: this.onConfirmClick
}, this.props.confirm));
},
renderLaye... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/module/light-dialog.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-dialog.coffee | 51 | 73 |
jianliaoim/talk-os:talk-web/client/module/light-dialog.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
renderActions: function() {
return div({
className: 'actions line'
}, button({
className: 'button is-link',
onClick: this.onCloseClick
}, this.props.cancel), button({
className: 'button is-danger',
onClick: this.onConf... | renderActions: ->
div className: 'actions line',
button className: 'button is-link', onClick: @onCloseClick,
@props.cancel
button className: 'button is-danger', onClick: @onConfirmClick,
@props.confirm
renderLayer: (afterTransition) ->
className = "light-dialog is-for-#{@props.nam... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/light-dialog.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-dialog.coffee | 51 | 73 |
jianliaoim/talk-os:talk-web/client/module/light-dialog.coffee:2:completion | completion | renderActions: ->
div className: 'actions line',
button className: 'button is-link', onClick: @onCloseClick,
@props.cancel
button className: 'button is-danger', onClick: @onConfirmClick,
@props.confirm
renderLayer: (afterTransition) ->
className = "light-dialog is-for-#{@props.nam... | if @props.show and afterTransition
div className: className, onClick: @onBackdropClick,
div className: 'wrapper', onClick: @onBackdropClick,
div className: boxClassName,
div className: 'content',
div className: 'inner', @props.content
@props.ch... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/light-dialog.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/light-dialog.coffee | 51 | 73 |
jianliaoim/talk-os:talk-web/client/updater/device.coffee:1:raw_corpus | raw_corpus | Immutable = require 'immutable'
emptyMap = Immutable.Map()
emptyList = Immutable.List()
exports.reload = (store) ->
store
.setIn ['device', 'disconnection'], false
exports.disconnect = (store) ->
store
.setIn ['device', 'disconnection'], true
exports.loading = (store, loadingInfo) ->
store.updateIn ['devic... | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/device.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/device.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-web/client/updater/device.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Immutable = require 'immutable'
emptyMap = Immutable.Map()
emptyList = Immutable.List()
exports.reload = (store) ->
store
.setIn ['device', 'disconnection'], false
exports.disconnect = (store) ->
store
.setIn ['device', 'disconnection'], true
exports.l... | var Immutable, emptyList, emptyMap;
Immutable = require('immutable');
emptyMap = Immutable.Map();
emptyList = Immutable.List();
exports.reload = function(store) {
return store.setIn(['device', 'disconnection'], false);
};
exports.disconnect = function(store) {
return store.setIn(['device', 'disconnection'], tr... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/updater/device.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/device.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/updater/device.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Immutable, emptyList, emptyMap;
Immutable = require('immutable');
emptyMap = Immutable.Map();
emptyList = Immutable.List();
exports.reload = function(store) {
return store.setIn(['device', 'disconnection'], false);
};
exports.disconnect = function(store)... | Immutable = require 'immutable'
emptyMap = Immutable.Map()
emptyList = Immutable.List()
exports.reload = (store) ->
store
.setIn ['device', 'disconnection'], false
exports.disconnect = (store) ->
store
.setIn ['device', 'disconnection'], true
exports.loading = (store, loadingInfo) ->
store.updateIn ['devic... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/device.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/device.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/updater/device.coffee:1:completion | completion | Immutable = require 'immutable'
emptyMap = Immutable.Map()
emptyList = Immutable.List()
exports.reload = (store) ->
store
.setIn ['device', 'disconnection'], false
exports.disconnect = (store) ->
store
.setIn ['device', 'disconnection'], true
exports.loading = (store, loadingInfo) ->
store.updateIn ['devic... | store.setIn ['device', 'viewingAttachment'], _attachmentId
exports.tuned = (store, tuned) ->
store.setIn ['device', 'isTuned'], tuned
exports.detectFocus = (store, status) ->
store.setIn ['device', 'isFocused'], status
exports.markChannel = (store, channel) ->
store.setIn [ 'device', 'lastChannel' ], channel
... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/device.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/device.coffee | 1 | 50 |
CaryLandholt/AngularFun:scripts/services/peopleService.coffee:1:raw_corpus | raw_corpus | ###global define###
define ['services/services'], (services) ->
'use strict'
people = {}
services.factory 'peopleService', ['$resource', ($resource) ->
activity = $resource './members',
{
callback: 'JSON_CALLBACK'
}
{
get:
method: 'GET'
isArray: true
post:
method: 'POST'
... | CoffeeScript | CaryLandholt/AngularFun | scripts/services/peopleService.coffee | MIT | 0a646d2281b057df758d819b5e9224a0ad3461d6 | 672 | https://github.com/CaryLandholt/AngularFun/blob/0a646d2281b057df758d819b5e9224a0ad3461d6/scripts/services/peopleService.coffee | 1 | 38 | ||
CaryLandholt/AngularFun:scripts/services/peopleService.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###global define###
define ['services/services'], (services) ->
'use strict'
people = {}
services.factory 'peopleService', ['$resource', ($resource) ->
activity = $resource './members',
{
callback: 'JSON_CALLBACK'
}
{
get:
method: 'G... | /*global define*/
define(['services/services'], function(services) {
'use strict';
var people;
people = {};
return services.factory('peopleService', [
'$resource',
function($resource) {
var activity;
activity = $resource('./members',
{
callback: 'JSON_CALLBACK'
},
{
... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | scripts/services/peopleService.coffee | MIT | 0a646d2281b057df758d819b5e9224a0ad3461d6 | 672 | https://github.com/CaryLandholt/AngularFun/blob/0a646d2281b057df758d819b5e9224a0ad3461d6/scripts/services/peopleService.coffee | 1 | 38 |
CaryLandholt/AngularFun:scripts/services/peopleService.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*global define*/
define(['services/services'], function(services) {
'use strict';
var people;
people = {};
return services.factory('peopleService', [
'$resource',
function($resource) {
var activity;
activity = $resource('./members',
... | ###global define###
define ['services/services'], (services) ->
'use strict'
people = {}
services.factory 'peopleService', ['$resource', ($resource) ->
activity = $resource './members',
{
callback: 'JSON_CALLBACK'
}
{
get:
method: 'GET'
isArray: true
post:
method: 'POST'
... | JavaScript | CoffeeScript | CaryLandholt/AngularFun | scripts/services/peopleService.coffee | MIT | 0a646d2281b057df758d819b5e9224a0ad3461d6 | 672 | https://github.com/CaryLandholt/AngularFun/blob/0a646d2281b057df758d819b5e9224a0ad3461d6/scripts/services/peopleService.coffee | 1 | 38 |
CaryLandholt/AngularFun:scripts/services/peopleService.coffee:1:completion | completion | ###global define###
define ['services/services'], (services) ->
'use strict'
people = {}
services.factory 'peopleService', ['$resource', ($resource) ->
activity = $resource './members',
{
callback: 'JSON_CALLBACK'
}
{
get:
method: 'GET'
isArray: true
post:
method: 'POST'
... | put:
method: 'PUT'
isArray: true
}
people: people
get: ->
people = activity.get (Resource, getResponseHeaders) ->
console.log 'success', Resource, getResponseHeaders()
, (obj) ->
console.log 'error', obj.config, obj.headers(), obj.status
post: ->
people = activity.post "name": "So... | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | scripts/services/peopleService.coffee | MIT | 0a646d2281b057df758d819b5e9224a0ad3461d6 | 672 | https://github.com/CaryLandholt/AngularFun/blob/0a646d2281b057df758d819b5e9224a0ad3461d6/scripts/services/peopleService.coffee | 1 | 38 |
jsdf/coffee-react-transform:test.coffee:1:raw_corpus | raw_corpus | testRewriteOutput = (description, input, expectedOutput) ->
rewritten = rewrite input
console.assert rewritten == expectedOutput,
"""
#{description}
--- Expected output ---
#{expectedOutput}
--- Actual output ---
#{rewritten}
"""
# start tests
console.time('all tests passed')
testRewriteOutput '... | CoffeeScript | jsdf/coffee-react-transform | test.coffee | MIT | f7c5d68651c841b22e8e3947780b17f15ee2c0b1 | 431 | https://github.com/jsdf/coffee-react-transform/blob/f7c5d68651c841b22e8e3947780b17f15ee2c0b1/test.coffee | 6 | 55 | ||
jsdf/coffee-react-transform:test.coffee:1:completion | completion | testRewriteOutput = (description, input, expectedOutput) ->
rewritten = rewrite input
console.assert rewritten == expectedOutput,
"""
#{description}
--- Expected output ---
#{expectedOutput}
--- Actual output ---
#{rewritten}
"""
# start tests
console.time('all tests passed')
testRewriteOutput '... | testRewriteOutput 'escaped coffeescript attribute over multiple lines' ,
"""
<Person name={window.isLoggedIn
? window.name
: ''} />
""",
"""
Person({"name": (window.isLoggedIn
? window.name
: '')})
"""
testRewriteOutput 'multiple line escaped coffeescript with nested csx',
"""
<Person name={window.isLoggedIn
? window.... | CoffeeScript | CoffeeScript | jsdf/coffee-react-transform | test.coffee | MIT | f7c5d68651c841b22e8e3947780b17f15ee2c0b1 | 431 | https://github.com/jsdf/coffee-react-transform/blob/f7c5d68651c841b22e8e3947780b17f15ee2c0b1/test.coffee | 6 | 55 |
jsdf/coffee-react-transform:test.coffee:2:raw_corpus | raw_corpus | }
</Person>
""",
"""
Person({"name": (window.isLoggedIn
? window.name
: '')}, (
for n in a
div(null, '''asf''', li({"xy": ("as")}, ( n+1 ), a(null), a(null)))
))
"""
testRewriteOutput 'multiline tag attributes with escaped coffeescript',
"""
<Person name={window.isLoggedIn ? window.name : ''}
loltags='on new l... | CoffeeScript | jsdf/coffee-react-transform | test.coffee | MIT | f7c5d68651c841b22e8e3947780b17f15ee2c0b1 | 431 | https://github.com/jsdf/coffee-react-transform/blob/f7c5d68651c841b22e8e3947780b17f15ee2c0b1/test.coffee | 56 | 105 | ||
jsdf/coffee-react-transform:test.coffee:2:completion | completion | }
</Person>
""",
"""
Person({"name": (window.isLoggedIn
? window.name
: '')}, (
for n in a
div(null, '''asf''', li({"xy": ("as")}, ( n+1 ), a(null), a(null)))
))
"""
testRewriteOutput 'multiline tag attributes with escaped coffeescript',
"""
<Person name={window.isLoggedIn ? window.name : ''}
loltags='on new l... | HelloWorld = React.createClass({
render: () ->
return (
<p>
Hello, <input type="text" placeholder="Your name here" />!
It is {this.props.date.toTimeString()}
</p>
);
});
""",
"""
HelloWorld = React.createClass({
render: () ->
return (
p(null, '''Hello,''', input({"type"... | CoffeeScript | CoffeeScript | jsdf/coffee-react-transform | test.coffee | MIT | f7c5d68651c841b22e8e3947780b17f15ee2c0b1 | 431 | https://github.com/jsdf/coffee-react-transform/blob/f7c5d68651c841b22e8e3947780b17f15ee2c0b1/test.coffee | 56 | 105 |
jsdf/coffee-react-transform:test.coffee:3:raw_corpus | raw_corpus | document.getElementById('example')
);
, 500);
React.createClass
render: ->
return <Nav color="blue">
{<Profile>click{Math.random(),<Selfclosing coolattr />}</Profile> for i in [start...finish]}
</Nav>
""",
"""
setInterval(() ->
React.renderComponent(
HelloWorld({"date": "{new Date()}"}),
do... | CoffeeScript | jsdf/coffee-react-transform | test.coffee | MIT | f7c5d68651c841b22e8e3947780b17f15ee2c0b1 | 431 | https://github.com/jsdf/coffee-react-transform/blob/f7c5d68651c841b22e8e3947780b17f15ee2c0b1/test.coffee | 106 | 139 | ||
jsdf/coffee-react-transform:test.coffee:3:completion | completion | document.getElementById('example')
);
, 500);
React.createClass
render: ->
return <Nav color="blue">
{<Profile>click{Math.random(),<Selfclosing coolattr />}</Profile> for i in [start...finish]}
</Nav>
""",
"""
setInterval(() ->
React.renderComponent(
HelloWorld({"date": "{new Date()}"}),
do... | React.createClass
render: ->
return Nav({"color": "blue"}, (Profile(null, '''click''', (Math.random(),Selfclosing({"coolattr": true}))) for i in [start...finish]))
"""
testRewriteOutput 'lots of attributes',
"""
<Car doors=4 safety={getSafetyRating()*2} crackedWindscreen = "yep"
insurance={ insurancehas() ? 'coo... | CoffeeScript | CoffeeScript | jsdf/coffee-react-transform | test.coffee | MIT | f7c5d68651c841b22e8e3947780b17f15ee2c0b1 | 431 | https://github.com/jsdf/coffee-react-transform/blob/f7c5d68651c841b22e8e3947780b17f15ee2c0b1/test.coffee | 106 | 139 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:1:raw_corpus | raw_corpus | # Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
should = require 'should'
parser = require '../../src/parser/python-parser'
describe 'python-parser >', ->
describe 'indent >', ->
it 'check space indent #1'... | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/test/parser/python-parser.test.coffee | 1 | 42 | ||
outsideris/popularconvention:test/parser/python-parser.test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
should = require 'should'
parser = require '../../src/parser/python-parser'
describe 'python-parser >', ->
... | // Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
// Licensed under the MIT license.
// <http://outsider.mit-license.org/>
var parser, should;
should = require('should');
parser = require('../../src/parser/python-parser');
describe('python-parser >', function() {
return describe('i... | CoffeeScript | JavaScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/test/parser/python-parser.test.coffee | 1 | 42 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
// Licensed under the MIT license.
// <http://outsider.mit-license.org/>
var parser, should;
should = require('should');
parser = require('../../src/parser/python-parser');
descri... | # Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
should = require 'should'
parser = require '../../src/parser/python-parser'
describe 'python-parser >', ->
describe 'indent >', ->
it 'check space indent #1'... | JavaScript | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/test/parser/python-parser.test.coffee | 1 | 42 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:1:completion | completion | # Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
# Licensed under the MIT license.
# <http://outsider.mit-license.org/>
should = require 'should'
parser = require '../../src/parser/python-parser'
describe 'python-parser >', ->
describe 'indent >', ->
it 'check space indent #1'... | convention.indent.space.should.equal 1
it 'check space indent #4', ->
convention = parser.indent ' a = 1;', {}
convention.indent.space.should.equal 1
it 'check tab indent #1', ->
convention = parser.indent '\ta = 1;', {}
convention.indent.tab.should.equal 1
it 'check tab indent ... | CoffeeScript | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/test/parser/python-parser.test.coffee | 1 | 42 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:2:raw_corpus | raw_corpus | it 'check tab indent #5', ->
convention = parser.indent 'a = 1;', {}
convention.indent.tab.should.equal 0
describe 'linelength >', ->
it 'line length is 80 characters #1', ->
convention = parser.linelength ' public String findFirstName( String name, String age) { return \"a\"; }', {}
... | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/test/parser/python-parser.test.coffee | 44 | 82 | ||
outsideris/popularconvention:test/parser/python-parser.test.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'check tab indent #5', ->
convention = parser.indent 'a = 1;', {}
convention.indent.tab.should.equal 0
describe 'linelength >', ->
it 'line length is 80 characters #1', ->
convention = parser.linelength ' public String findFirstNam... | it('check tab indent #5', function() {
var convention;
convention = parser.indent('a = 1;', {});
return convention.indent.tab.should.equal(0);
});
describe('linelength >', function() {
it('line length is 80 characters #1', function() {
var convention;
convention = parser.linelength(' public String f... | CoffeeScript | JavaScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/test/parser/python-parser.test.coffee | 44 | 82 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('check tab indent #5', function() {
var convention;
convention = parser.indent('a = 1;', {});
return convention.indent.tab.should.equal(0);
});
describe('linelength >', function() {
it('line length is 80 characters #1', function() {
var convention;
... | it 'check tab indent #5', ->
convention = parser.indent 'a = 1;', {}
convention.indent.tab.should.equal 0
describe 'linelength >', ->
it 'line length is 80 characters #1', ->
convention = parser.linelength ' public String findFirstName( String name, String age) { return \"a\"; }', {}
... | JavaScript | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/test/parser/python-parser.test.coffee | 44 | 82 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:2:completion | completion | it 'check tab indent #5', ->
convention = parser.indent 'a = 1;', {}
convention.indent.tab.should.equal 0
describe 'linelength >', ->
it 'line length is 80 characters #1', ->
convention = parser.linelength ' public String findFirstName( String name, String age) { return \"a\"; }', {}
... | convention = parser.linelength ' public String findFirstName( String name, String age, String job) { return \"a\"; }', {}
convention.linelength.char120.should.equal 1
it 'line length is 120 characters #2', ->
convention = parser.linelength '\t\tpublic String findFirstName( String name, String age, S... | CoffeeScript | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/test/parser/python-parser.test.coffee | 44 | 82 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:3:raw_corpus | raw_corpus | it 'imports on separate lines #2', ->
convention = parser.imports ' import foo.bar.yourclass', {}
convention.imports.separated.should.equal 1
it 'imports on separate lines #3', ->
convention = parser.imports ' import os # ,', {}
convention.imports.separated.should.equal 1
it 'imports... | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/test/parser/python-parser.test.coffee | 84 | 124 | ||
outsideris/popularconvention:test/parser/python-parser.test.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'imports on separate lines #2', ->
convention = parser.imports ' import foo.bar.yourclass', {}
convention.imports.separated.should.equal 1
it 'imports on separate lines #3', ->
convention = parser.imports ' import os # ,', {}
con... | it('imports on separate lines #2', function() {
var convention;
convention = parser.imports(' import foo.bar.yourclass', {});
return convention.imports.separated.should.equal(1);
});
it('imports on separate lines #3', function() {
var convention;
convention = parser.imports(' import os # ,', {});
return ... | CoffeeScript | JavaScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/test/parser/python-parser.test.coffee | 84 | 124 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('imports on separate lines #2', function() {
var convention;
convention = parser.imports(' import foo.bar.yourclass', {});
return convention.imports.separated.should.equal(1);
});
it('imports on separate lines #3', function() {
var convention;
conven... | it 'imports on separate lines #2', ->
convention = parser.imports ' import foo.bar.yourclass', {}
convention.imports.separated.should.equal 1
it 'imports on separate lines #3', ->
convention = parser.imports ' import os # ,', {}
convention.imports.separated.should.equal 1
it 'imports... | JavaScript | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/test/parser/python-parser.test.coffee | 84 | 124 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:3:completion | completion | it 'imports on separate lines #2', ->
convention = parser.imports ' import foo.bar.yourclass', {}
convention.imports.separated.should.equal 1
it 'imports on separate lines #3', ->
convention = parser.imports ' import os # ,', {}
convention.imports.separated.should.equal 1
it 'imports... | it 'imports on non-separate lines #3', ->
convention = parser.imports 'import os', {}
convention.imports.noseparated.should.equal 0
describe 'whitespace >', ->
it 'no extraneous whitespace #1', ->
convention = parser.whitespace 'spam(ham[1], {eggs: 2})', {}
convention.whitespace.noextra.... | CoffeeScript | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/test/parser/python-parser.test.coffee | 84 | 124 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:4:raw_corpus | raw_corpus | it 'no extraneous whitespace #5', ->
convention = parser.whitespace 'x = 1', {}
convention.whitespace.noextra.should.equal 1
it 'no extraneous whitespace #6', ->
convention = parser.whitespace "dict ['key'] = list [index]", {}
convention.whitespace.noextra.should.equal 0
it 'extraneous... | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/test/parser/python-parser.test.coffee | 126 | 156 | ||
outsideris/popularconvention:test/parser/python-parser.test.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'no extraneous whitespace #5', ->
convention = parser.whitespace 'x = 1', {}
convention.whitespace.noextra.should.equal 1
it 'no extraneous whitespace #6', ->
convention = parser.whitespace "dict ['key'] = list [index]", {}
convent... | it('no extraneous whitespace #5', function() {
var convention;
convention = parser.whitespace('x = 1', {});
return convention.whitespace.noextra.should.equal(1);
});
it('no extraneous whitespace #6', function() {
var convention;
convention = parser.whitespace("dict ['key'] = list [index]", {});
return conv... | CoffeeScript | JavaScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/test/parser/python-parser.test.coffee | 126 | 156 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('no extraneous whitespace #5', function() {
var convention;
convention = parser.whitespace('x = 1', {});
return convention.whitespace.noextra.should.equal(1);
});
it('no extraneous whitespace #6', function() {
var convention;
convention = parser.white... | it 'no extraneous whitespace #5', ->
convention = parser.whitespace 'x = 1', {}
convention.whitespace.noextra.should.equal 1
it 'no extraneous whitespace #6', ->
convention = parser.whitespace "dict ['key'] = list [index]", {}
convention.whitespace.noextra.should.equal 0
it 'extraneous... | JavaScript | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/test/parser/python-parser.test.coffee | 126 | 156 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:4:completion | completion | it 'no extraneous whitespace #5', ->
convention = parser.whitespace 'x = 1', {}
convention.whitespace.noextra.should.equal 1
it 'no extraneous whitespace #6', ->
convention = parser.whitespace "dict ['key'] = list [index]", {}
convention.whitespace.noextra.should.equal 0
it 'extraneous... | it 'extraneous whitespace #3', ->
convention = parser.whitespace 'spam (1)', {}
convention.whitespace.extra.should.equal 1
it 'extraneous whitespace #4', ->
convention = parser.whitespace "dict ['key'] = list [index]", {}
convention.whitespace.extra.should.equal 1
it 'extraneous whites... | CoffeeScript | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | 4e14df19a1d7fd3747c73620648df56853902087 | 730 | https://github.com/outsideris/popularconvention/blob/4e14df19a1d7fd3747c73620648df56853902087/test/parser/python-parser.test.coffee | 126 | 156 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:1:raw_corpus | raw_corpus | should = require 'should'
parser = require '../../src/parser/python-parser'
describe 'python-parser >', ->
describe 'indent >', ->
it 'check space indent #1', ->
convention = parser.indent 'a = 1;', {}
convention.indent.space.should.equal 0
it 'check space indent #2', ->
convention = par... | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | a7104902960f0af7dce5330d553126dc3df71ebf | 730 | https://github.com/outsideris/popularconvention/blob/a7104902960f0af7dce5330d553126dc3df71ebf/test/parser/python-parser.test.coffee | 1 | 42 | ||
outsideris/popularconvention:test/parser/python-parser.test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
should = require 'should'
parser = require '../../src/parser/python-parser'
describe 'python-parser >', ->
describe 'indent >', ->
it 'check space indent #1', ->
convention = parser.indent 'a = 1;', {}
convention.indent.space.should.equal 0
... | var parser, should;
should = require('should');
parser = require('../../src/parser/python-parser');
describe('python-parser >', function() {
return describe('indent >', function() {
it('check space indent #1', function() {
var convention;
convention = parser.indent('a = 1;', {});
return conve... | CoffeeScript | JavaScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | a7104902960f0af7dce5330d553126dc3df71ebf | 730 | https://github.com/outsideris/popularconvention/blob/a7104902960f0af7dce5330d553126dc3df71ebf/test/parser/python-parser.test.coffee | 1 | 42 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var parser, should;
should = require('should');
parser = require('../../src/parser/python-parser');
describe('python-parser >', function() {
return describe('indent >', function() {
it('check space indent #1', function() {
var convention;
conve... | should = require 'should'
parser = require '../../src/parser/python-parser'
describe 'python-parser >', ->
describe 'indent >', ->
it 'check space indent #1', ->
convention = parser.indent 'a = 1;', {}
convention.indent.space.should.equal 0
it 'check space indent #2', ->
convention = par... | JavaScript | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | a7104902960f0af7dce5330d553126dc3df71ebf | 730 | https://github.com/outsideris/popularconvention/blob/a7104902960f0af7dce5330d553126dc3df71ebf/test/parser/python-parser.test.coffee | 1 | 42 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:1:completion | completion | should = require 'should'
parser = require '../../src/parser/python-parser'
describe 'python-parser >', ->
describe 'indent >', ->
it 'check space indent #1', ->
convention = parser.indent 'a = 1;', {}
convention.indent.space.should.equal 0
it 'check space indent #2', ->
convention = par... | convention.indent.space.should.equal 1
it 'check tab indent #1', ->
convention = parser.indent '\ta = 1;', {}
convention.indent.tab.should.equal 1
it 'check tab indent #2', ->
convention = parser.indent '\t\ta = 1;', {}
convention.indent.tab.should.equal 1
it 'check tab indent #3'... | CoffeeScript | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | a7104902960f0af7dce5330d553126dc3df71ebf | 730 | https://github.com/outsideris/popularconvention/blob/a7104902960f0af7dce5330d553126dc3df71ebf/test/parser/python-parser.test.coffee | 1 | 42 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:2:raw_corpus | raw_corpus | describe 'linelength >', ->
it 'line length is 80 characters #1', ->
convention = parser.linelength ' public String findFirstName( String name, String age) { return \"a\"; }', {}
convention.linelength.char80.should.equal 1
it 'line length is 80 characters #2', ->
convention = parser.linel... | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | a7104902960f0af7dce5330d553126dc3df71ebf | 730 | https://github.com/outsideris/popularconvention/blob/a7104902960f0af7dce5330d553126dc3df71ebf/test/parser/python-parser.test.coffee | 44 | 82 | ||
outsideris/popularconvention:test/parser/python-parser.test.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe 'linelength >', ->
it 'line length is 80 characters #1', ->
convention = parser.linelength ' public String findFirstName( String name, String age) { return \"a\"; }', {}
convention.linelength.char80.should.equal 1
it 'line length... | describe('linelength >', function() {
it('line length is 80 characters #1', function() {
var convention;
convention = parser.linelength(' public String findFirstName( String name, String age) { return \"a\"; }', {});
return convention.linelength.char80.should.equal(1);
});
it('line length is 80 cha... | CoffeeScript | JavaScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | a7104902960f0af7dce5330d553126dc3df71ebf | 730 | https://github.com/outsideris/popularconvention/blob/a7104902960f0af7dce5330d553126dc3df71ebf/test/parser/python-parser.test.coffee | 44 | 82 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe('linelength >', function() {
it('line length is 80 characters #1', function() {
var convention;
convention = parser.linelength(' public String findFirstName( String name, String age) { return \"a\"; }', {});
return convention.linelength.ch... | describe 'linelength >', ->
it 'line length is 80 characters #1', ->
convention = parser.linelength ' public String findFirstName( String name, String age) { return \"a\"; }', {}
convention.linelength.char80.should.equal 1
it 'line length is 80 characters #2', ->
convention = parser.linel... | JavaScript | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | a7104902960f0af7dce5330d553126dc3df71ebf | 730 | https://github.com/outsideris/popularconvention/blob/a7104902960f0af7dce5330d553126dc3df71ebf/test/parser/python-parser.test.coffee | 44 | 82 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:2:completion | completion | describe 'linelength >', ->
it 'line length is 80 characters #1', ->
convention = parser.linelength ' public String findFirstName( String name, String age) { return \"a\"; }', {}
convention.linelength.char80.should.equal 1
it 'line length is 80 characters #2', ->
convention = parser.linel... | convention = parser.linelength '\t\tpublic String findFirstName( String name, String age, String job) { return \"a\"; }', {}
convention.linelength.char120.should.equal 1
it 'line length is 120 characters #3', ->
convention = parser.linelength '\t\tpublic String findFirstName( String name, String age) {... | CoffeeScript | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | a7104902960f0af7dce5330d553126dc3df71ebf | 730 | https://github.com/outsideris/popularconvention/blob/a7104902960f0af7dce5330d553126dc3df71ebf/test/parser/python-parser.test.coffee | 44 | 82 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:3:raw_corpus | raw_corpus | it 'imports on separate lines #3', ->
convention = parser.imports ' import os # ,', {}
convention.imports.separated.should.equal 1
it 'imports on separate lines #4', ->
convention = parser.imports ' import os, sys', {}
convention.imports.separated.should.equal 0
it 'imports on non-se... | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | a7104902960f0af7dce5330d553126dc3df71ebf | 730 | https://github.com/outsideris/popularconvention/blob/a7104902960f0af7dce5330d553126dc3df71ebf/test/parser/python-parser.test.coffee | 84 | 124 | ||
outsideris/popularconvention:test/parser/python-parser.test.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'imports on separate lines #3', ->
convention = parser.imports ' import os # ,', {}
convention.imports.separated.should.equal 1
it 'imports on separate lines #4', ->
convention = parser.imports ' import os, sys', {}
convention.im... | it('imports on separate lines #3', function() {
var convention;
convention = parser.imports(' import os # ,', {});
return convention.imports.separated.should.equal(1);
});
it('imports on separate lines #4', function() {
var convention;
convention = parser.imports(' import os, sys', {});
return convention... | CoffeeScript | JavaScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | a7104902960f0af7dce5330d553126dc3df71ebf | 730 | https://github.com/outsideris/popularconvention/blob/a7104902960f0af7dce5330d553126dc3df71ebf/test/parser/python-parser.test.coffee | 84 | 124 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('imports on separate lines #3', function() {
var convention;
convention = parser.imports(' import os # ,', {});
return convention.imports.separated.should.equal(1);
});
it('imports on separate lines #4', function() {
var convention;
convention = pars... | it 'imports on separate lines #3', ->
convention = parser.imports ' import os # ,', {}
convention.imports.separated.should.equal 1
it 'imports on separate lines #4', ->
convention = parser.imports ' import os, sys', {}
convention.imports.separated.should.equal 0
it 'imports on non-se... | JavaScript | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | a7104902960f0af7dce5330d553126dc3df71ebf | 730 | https://github.com/outsideris/popularconvention/blob/a7104902960f0af7dce5330d553126dc3df71ebf/test/parser/python-parser.test.coffee | 84 | 124 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:3:completion | completion | it 'imports on separate lines #3', ->
convention = parser.imports ' import os # ,', {}
convention.imports.separated.should.equal 1
it 'imports on separate lines #4', ->
convention = parser.imports ' import os, sys', {}
convention.imports.separated.should.equal 0
it 'imports on non-se... | describe 'whitespace >', ->
it 'no extraneous whitespace #1', ->
convention = parser.whitespace 'spam(ham[1], {eggs: 2})', {}
convention.whitespace.noextra.should.equal 1
it 'no extraneous whitespace #2', ->
convention = parser.whitespace 'if x == 4: print x, y; x, y = y, x', {}
conven... | CoffeeScript | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | a7104902960f0af7dce5330d553126dc3df71ebf | 730 | https://github.com/outsideris/popularconvention/blob/a7104902960f0af7dce5330d553126dc3df71ebf/test/parser/python-parser.test.coffee | 84 | 124 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:4:raw_corpus | raw_corpus | it 'no extraneous whitespace #6', ->
convention = parser.whitespace "dict ['key'] = list [index]", {}
convention.whitespace.noextra.should.equal 0
it 'extraneous whitespace #1', ->
convention = parser.whitespace 'spam( ham[ 1 ], { eggs: 2 } )', {}
convention.whitespace.extra.should.equal 1
... | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | a7104902960f0af7dce5330d553126dc3df71ebf | 730 | https://github.com/outsideris/popularconvention/blob/a7104902960f0af7dce5330d553126dc3df71ebf/test/parser/python-parser.test.coffee | 126 | 152 | ||
outsideris/popularconvention:test/parser/python-parser.test.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'no extraneous whitespace #6', ->
convention = parser.whitespace "dict ['key'] = list [index]", {}
convention.whitespace.noextra.should.equal 0
it 'extraneous whitespace #1', ->
convention = parser.whitespace 'spam( ham[ 1 ], { eggs: 2 }... | it('no extraneous whitespace #6', function() {
var convention;
convention = parser.whitespace("dict ['key'] = list [index]", {});
return convention.whitespace.noextra.should.equal(0);
});
it('extraneous whitespace #1', function() {
var convention;
convention = parser.whitespace('spam( ham[ 1 ], { eggs: 2 } )... | CoffeeScript | JavaScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | a7104902960f0af7dce5330d553126dc3df71ebf | 730 | https://github.com/outsideris/popularconvention/blob/a7104902960f0af7dce5330d553126dc3df71ebf/test/parser/python-parser.test.coffee | 126 | 152 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('no extraneous whitespace #6', function() {
var convention;
convention = parser.whitespace("dict ['key'] = list [index]", {});
return convention.whitespace.noextra.should.equal(0);
});
it('extraneous whitespace #1', function() {
var convention;
conven... | it 'no extraneous whitespace #6', ->
convention = parser.whitespace "dict ['key'] = list [index]", {}
convention.whitespace.noextra.should.equal 0
it 'extraneous whitespace #1', ->
convention = parser.whitespace 'spam( ham[ 1 ], { eggs: 2 } )', {}
convention.whitespace.extra.should.equal 1
... | JavaScript | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | a7104902960f0af7dce5330d553126dc3df71ebf | 730 | https://github.com/outsideris/popularconvention/blob/a7104902960f0af7dce5330d553126dc3df71ebf/test/parser/python-parser.test.coffee | 126 | 152 |
outsideris/popularconvention:test/parser/python-parser.test.coffee:4:completion | completion | it 'no extraneous whitespace #6', ->
convention = parser.whitespace "dict ['key'] = list [index]", {}
convention.whitespace.noextra.should.equal 0
it 'extraneous whitespace #1', ->
convention = parser.whitespace 'spam( ham[ 1 ], { eggs: 2 } )', {}
convention.whitespace.extra.should.equal 1
... | convention = parser.whitespace 'spam (1)', {}
convention.whitespace.extra.should.equal 1
it 'extraneous whitespace #4', ->
convention = parser.whitespace "dict ['key'] = list [index]", {}
convention.whitespace.extra.should.equal 1
it 'extraneous whitespace #5', ->
convention = parser.w... | CoffeeScript | CoffeeScript | outsideris/popularconvention | test/parser/python-parser.test.coffee | MIT | a7104902960f0af7dce5330d553126dc3df71ebf | 730 | https://github.com/outsideris/popularconvention/blob/a7104902960f0af7dce5330d553126dc3df71ebf/test/parser/python-parser.test.coffee | 126 | 152 |
cdglabs/apparatus:src/View/Generic/HTMLCanvas.coffee:1:raw_corpus | raw_corpus | _ = require "underscore"
R = require "../R"
devicePixelRatio = window.devicePixelRatio || 1
sizeCanvas = (canvas) ->
rect = canvas.getBoundingClientRect()
canvas.width = rect.width * devicePixelRatio
canvas.height = rect.height * devicePixelRatio
R.create "HTMLCanvas",
propTypes:
draw: Function
rend... | CoffeeScript | cdglabs/apparatus | src/View/Generic/HTMLCanvas.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/View/Generic/HTMLCanvas.coffee | 1 | 40 | ||
cdglabs/apparatus:src/View/Generic/HTMLCanvas.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require "underscore"
R = require "../R"
devicePixelRatio = window.devicePixelRatio || 1
sizeCanvas = (canvas) ->
rect = canvas.getBoundingClientRect()
canvas.width = rect.width * devicePixelRatio
canvas.height = rect.height * devicePixelRatio
R.cre... | var R, _, devicePixelRatio, sizeCanvas;
_ = require("underscore");
R = require("../R");
devicePixelRatio = window.devicePixelRatio || 1;
sizeCanvas = function(canvas) {
var rect;
rect = canvas.getBoundingClientRect();
canvas.width = rect.width * devicePixelRatio;
return canvas.height = rect.height * deviceP... | CoffeeScript | JavaScript | cdglabs/apparatus | src/View/Generic/HTMLCanvas.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/View/Generic/HTMLCanvas.coffee | 1 | 40 |
cdglabs/apparatus:src/View/Generic/HTMLCanvas.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var R, _, devicePixelRatio, sizeCanvas;
_ = require("underscore");
R = require("../R");
devicePixelRatio = window.devicePixelRatio || 1;
sizeCanvas = function(canvas) {
var rect;
rect = canvas.getBoundingClientRect();
canvas.width = rect.width * devicePix... | _ = require "underscore"
R = require "../R"
devicePixelRatio = window.devicePixelRatio || 1
sizeCanvas = (canvas) ->
rect = canvas.getBoundingClientRect()
canvas.width = rect.width * devicePixelRatio
canvas.height = rect.height * devicePixelRatio
R.create "HTMLCanvas",
propTypes:
draw: Function
rend... | JavaScript | CoffeeScript | cdglabs/apparatus | src/View/Generic/HTMLCanvas.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/View/Generic/HTMLCanvas.coffee | 1 | 40 |
cdglabs/apparatus:src/View/Generic/HTMLCanvas.coffee:1:completion | completion | _ = require "underscore"
R = require "../R"
devicePixelRatio = window.devicePixelRatio || 1
sizeCanvas = (canvas) ->
rect = canvas.getBoundingClientRect()
canvas.width = rect.width * devicePixelRatio
canvas.height = rect.height * devicePixelRatio
R.create "HTMLCanvas",
propTypes:
draw: Function
rend... | componentDidMount: -> @_refresh()
componentDidUpdate: -> @_refresh()
resize: ->
@_canvasIsSized = false
_refresh: ->
canvas = R.findDOMNode(@)
if @_canvasIsSized
canvas.width = canvas.width
else
sizeCanvas(canvas)
@_canvasIsSized = true
ctx = canvas.getContext("2d")
c... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/View/Generic/HTMLCanvas.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/View/Generic/HTMLCanvas.coffee | 1 | 40 |
cdglabs/apparatus:src/View/Generic/HTMLCanvas.coffee:1:raw_corpus | raw_corpus | _ = require "underscore"
R = require "../R"
devicePixelRatio = window.devicePixelRatio || 1
sizeCanvas = (canvas) ->
rect = canvas.getBoundingClientRect()
canvas.width = rect.width * devicePixelRatio
canvas.height = rect.height * devicePixelRatio
R.create "HTMLCanvas",
propTypes:
draw: Function
rend... | CoffeeScript | cdglabs/apparatus | src/View/Generic/HTMLCanvas.coffee | MIT | e0c680ac2ebb88b109fb9885a89e49b3222e0285 | 1,052 | https://github.com/cdglabs/apparatus/blob/e0c680ac2ebb88b109fb9885a89e49b3222e0285/src/View/Generic/HTMLCanvas.coffee | 1 | 40 | ||
cdglabs/apparatus:src/View/Generic/HTMLCanvas.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require "underscore"
R = require "../R"
devicePixelRatio = window.devicePixelRatio || 1
sizeCanvas = (canvas) ->
rect = canvas.getBoundingClientRect()
canvas.width = rect.width * devicePixelRatio
canvas.height = rect.height * devicePixelRatio
R.cre... | var R, _, devicePixelRatio, sizeCanvas;
_ = require("underscore");
R = require("../R");
devicePixelRatio = window.devicePixelRatio || 1;
sizeCanvas = function(canvas) {
var rect;
rect = canvas.getBoundingClientRect();
canvas.width = rect.width * devicePixelRatio;
return canvas.height = rect.height * deviceP... | CoffeeScript | JavaScript | cdglabs/apparatus | src/View/Generic/HTMLCanvas.coffee | MIT | e0c680ac2ebb88b109fb9885a89e49b3222e0285 | 1,052 | https://github.com/cdglabs/apparatus/blob/e0c680ac2ebb88b109fb9885a89e49b3222e0285/src/View/Generic/HTMLCanvas.coffee | 1 | 40 |
cdglabs/apparatus:src/View/Generic/HTMLCanvas.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var R, _, devicePixelRatio, sizeCanvas;
_ = require("underscore");
R = require("../R");
devicePixelRatio = window.devicePixelRatio || 1;
sizeCanvas = function(canvas) {
var rect;
rect = canvas.getBoundingClientRect();
canvas.width = rect.width * devicePix... | _ = require "underscore"
R = require "../R"
devicePixelRatio = window.devicePixelRatio || 1
sizeCanvas = (canvas) ->
rect = canvas.getBoundingClientRect()
canvas.width = rect.width * devicePixelRatio
canvas.height = rect.height * devicePixelRatio
R.create "HTMLCanvas",
propTypes:
draw: Function
rend... | JavaScript | CoffeeScript | cdglabs/apparatus | src/View/Generic/HTMLCanvas.coffee | MIT | e0c680ac2ebb88b109fb9885a89e49b3222e0285 | 1,052 | https://github.com/cdglabs/apparatus/blob/e0c680ac2ebb88b109fb9885a89e49b3222e0285/src/View/Generic/HTMLCanvas.coffee | 1 | 40 |
cdglabs/apparatus:src/View/Generic/HTMLCanvas.coffee:1:completion | completion | _ = require "underscore"
R = require "../R"
devicePixelRatio = window.devicePixelRatio || 1
sizeCanvas = (canvas) ->
rect = canvas.getBoundingClientRect()
canvas.width = rect.width * devicePixelRatio
canvas.height = rect.height * devicePixelRatio
R.create "HTMLCanvas",
propTypes:
draw: Function
rend... | componentDidMount: -> @_refresh()
componentDidUpdate: -> @_refresh()
resize: ->
@_canvasIsSized = false
_refresh: ->
canvas = @getDOMNode()
if @_canvasIsSized
canvas.width = canvas.width
else
sizeCanvas(canvas)
@_canvasIsSized = true
ctx = canvas.getContext("2d")
ctx.... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/View/Generic/HTMLCanvas.coffee | MIT | e0c680ac2ebb88b109fb9885a89e49b3222e0285 | 1,052 | https://github.com/cdglabs/apparatus/blob/e0c680ac2ebb88b109fb9885a89e49b3222e0285/src/View/Generic/HTMLCanvas.coffee | 1 | 40 |
jianliaoim/talk-os:talk-api2x/test/servers/rly.coffee:1:raw_corpus | raw_corpus | express = require 'express'
Err = require 'err1st'
app = express()
callResults =
'16031610490641240001030600108079':
statusCode: '000000'
CallResult:
state: '1'
callTime: '8'
'1603161049064124000103060010807a':
statusCode: '000000'
CallResult:
state: '1'
callTime: '17'
app... | CoffeeScript | jianliaoim/talk-os | talk-api2x/test/servers/rly.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/servers/rly.coffee | 1 | 34 | ||
jianliaoim/talk-os:talk-api2x/test/servers/rly.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
express = require 'express'
Err = require 'err1st'
app = express()
callResults =
'16031610490641240001030600108079':
statusCode: '000000'
CallResult:
state: '1'
callTime: '8'
'1603161049064124000103060010807a':
statusCode: '000000'
... | var Err, app, callResults, express;
express = require('express');
Err = require('err1st');
app = express();
callResults = {
'16031610490641240001030600108079': {
statusCode: '000000',
CallResult: {
state: '1',
callTime: '8'
}
},
'1603161049064124000103060010807a': {
statusCode: '00... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/test/servers/rly.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/servers/rly.coffee | 1 | 34 |
jianliaoim/talk-os:talk-api2x/test/servers/rly.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Err, app, callResults, express;
express = require('express');
Err = require('err1st');
app = express();
callResults = {
'16031610490641240001030600108079': {
statusCode: '000000',
CallResult: {
state: '1',
callTime: '8'
}
},
'1... | express = require 'express'
Err = require 'err1st'
app = express()
callResults =
'16031610490641240001030600108079':
statusCode: '000000'
CallResult:
state: '1'
callTime: '8'
'1603161049064124000103060010807a':
statusCode: '000000'
CallResult:
state: '1'
callTime: '17'
app... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/test/servers/rly.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/servers/rly.coffee | 1 | 34 |
jianliaoim/talk-os:talk-api2x/test/servers/rly.coffee:1:completion | completion | express = require 'express'
Err = require 'err1st'
app = express()
callResults =
'16031610490641240001030600108079':
statusCode: '000000'
CallResult:
state: '1'
callTime: '8'
'1603161049064124000103060010807a':
statusCode: '000000'
CallResult:
state: '1'
callTime: '17' | app.post '/Accounts/:appId/SubAccounts', (req, res) ->
res.send
SubAccount:
voipAccount: 'abc'
voipPwd: '123'
subToken: 'afasd'
subAccountSid: 'fasfasdf'
app.get '/Accounts/:appId/CallResult', (req, res) ->
req.query.should.have.properties 'sig', 'callsid'
unless callResults[req.query... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/test/servers/rly.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/servers/rly.coffee | 1 | 34 |
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:1:raw_corpus | raw_corpus | adjust_space = (line) ->
string_list = line.match /(['"])[^\1]*?\1/g
muli_string = line.match /\[(=*)\[([^\]\1\]]*)/
comment = line.match /\-{2}[^\[].*$/
line = line.replace /\s+/g, ' '
# replace all whitespaces inside the string with one space, WARNING: the whitespaces in string will be replace too!
line =... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/lua-beautifier/beautifier.coffee | 3 | 24 | ||
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
adjust_space = (line) ->
string_list = line.match /(['"])[^\1]*?\1/g
muli_string = line.match /\[(=*)\[([^\]\1\]]*)/
comment = line.match /\-{2}[^\[].*$/
line = line.replace /\s+/g, ' '
# replace all whitespaces inside the string with one space, WARNING... | var adjust_space;
adjust_space = function(line) {
var comment, muli_string, string_list;
string_list = line.match(/(['"])[^\1]*?\1/g);
muli_string = line.match(/\[(=*)\[([^\]\1\]]*)/);
comment = line.match(/\-{2}[^\[].*$/);
line = line.replace(/\s+/g, ' ');
// replace all whitespaces inside the string with... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/lua-beautifier/beautifier.coffee | 3 | 24 |
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var adjust_space;
adjust_space = function(line) {
var comment, muli_string, string_list;
string_list = line.match(/(['"])[^\1]*?\1/g);
muli_string = line.match(/\[(=*)\[([^\]\1\]]*)/);
comment = line.match(/\-{2}[^\[].*$/);
line = line.replace(/\s+/g, ' ... | adjust_space = (line) ->
string_list = line.match /(['"])[^\1]*?\1/g
muli_string = line.match /\[(=*)\[([^\]\1\]]*)/
comment = line.match /\-{2}[^\[].*$/
line = line.replace /\s+/g, ' '
# replace all whitespaces inside the string with one space, WARNING: the whitespaces in string will be replace too!
line =... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/lua-beautifier/beautifier.coffee | 3 | 24 |
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:1:completion | completion | adjust_space = (line) ->
string_list = line.match /(['"])[^\1]*?\1/g
muli_string = line.match /\[(=*)\[([^\]\1\]]*)/
comment = line.match /\-{2}[^\[].*$/
line = line.replace /\s+/g, ' '
# replace all whitespaces inside the string with one space, WARNING: the whitespaces in string will be replace too!
line =... | line = line.replace /,([^\s])/g, ', $1'
# adjust ','
line = line.replace /\s+,/g, ','
# recover the whitespaces in string.
line = line.replace /(['"])[^\1]*?\1/g, ->
string_list.shift()
if muli_string and muli_string[0]
line = line.replace /\[(=*)\[([^\]\1\]]*)/, muli_string[0]
if comment and commen... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/lua-beautifier/beautifier.coffee | 3 | 24 |
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:3:raw_corpus | raw_corpus | module.exports = (str, indent, warn_fn, opts = {}) ->
eol = opts?.eol or '\n'
indent = indent or DEFAULT_INDENT
warn_fn = if typeof warn_fn == 'function' then warn_fn else DEFAULT_WARN_FN
indent = ' '.repeat(indent) if Number.isInteger(indent)
$currIndent = 0
$nextIndent = 0
$prevLength = 0
$extIndent =... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/lua-beautifier/beautifier.coffee | 29 | 78 | ||
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = (str, indent, warn_fn, opts = {}) ->
eol = opts?.eol or '\n'
indent = indent or DEFAULT_INDENT
warn_fn = if typeof warn_fn == 'function' then warn_fn else DEFAULT_WARN_FN
indent = ' '.repeat(indent) if Number.isInteger(indent)
$currInde... | module.exports = function(str, indent, warn_fn, opts = {}) {
var $currIndent, $extIndent, $lastIndent, $nextIndent, $prevLength, $template, eol, new_code;
eol = (opts != null ? opts.eol : void 0) || '\n';
indent = indent || DEFAULT_INDENT;
warn_fn = typeof warn_fn === 'function' ? warn_fn : DEFAULT_WARN_FN;
i... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/lua-beautifier/beautifier.coffee | 29 | 78 |
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function(str, indent, warn_fn, opts = {}) {
var $currIndent, $extIndent, $lastIndent, $nextIndent, $prevLength, $template, eol, new_code;
eol = (opts != null ? opts.eol : void 0) || '\n';
indent = indent || DEFAULT_INDENT;
warn_fn = typeof ... | module.exports = (str, indent, warn_fn, opts = {}) ->
eol = opts?.eol or '\n'
indent = indent or DEFAULT_INDENT
warn_fn = if typeof warn_fn == 'function' then warn_fn else DEFAULT_WARN_FN
indent = ' '.repeat(indent) if Number.isInteger(indent)
$currIndent = 0
$nextIndent = 0
$prevLength = 0
$extIndent =... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/lua-beautifier/beautifier.coffee | 29 | 78 |
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:3:completion | completion | module.exports = (str, indent, warn_fn, opts = {}) ->
eol = opts?.eol or '\n'
indent = indent or DEFAULT_INDENT
warn_fn = if typeof warn_fn == 'function' then warn_fn else DEFAULT_WARN_FN
indent = ' '.repeat(indent) if Number.isInteger(indent)
$currIndent = 0
$nextIndent = 0
$prevLength = 0
$extIndent =... | return line
res1 = line.match(/\[(=*)\[/)
if res1 and (not new RegExp("\\]#{'='.repeat res1[1].length}\\]").test line)
$template = res1[1].length + 1
if !$template_flag
line = line.trim()
# remote all spaces on both ends
line = adjust_space(line)
if !line.length
return ''
... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/lua-beautifier/beautifier.coffee | 29 | 78 |
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:4:raw_corpus | raw_corpus | # capture unbalanced curly brackets
# close (curly) brackets if needed
if $curly < 0
$currIndent += $curly
if $brackets < 0
$currIndent += $brackets
$nextIndent += $brackets + $curly
# console.log({last: $lastIndent, curr: $currIndent, next: $nextIndent, ext: $extIndent})
if $currInd... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/lua-beautifier/beautifier.coffee | 79 | 105 | ||
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:4:completion | completion | # capture unbalanced curly brackets
# close (curly) brackets if needed
if $curly < 0
$currIndent += $curly
if $brackets < 0
$currIndent += $brackets
$nextIndent += $brackets + $curly
# console.log({last: $lastIndent, curr: $currIndent, next: $nextIndent, ext: $extIndent})
if $currInd... | $currIndent = -1 + $lastIndent
if $nextIndent < $currIndent
$nextIndent = $currIndent
# console.log({last: $lastIndent, curr: $currIndent, next: $nextIndent, ext: $extIndent})
warn_fn """negative indentation at line #{line_number}: #{raw_line}""" if $currIndent < 0
new_line = (if raw_line.length a... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/lua-beautifier/beautifier.coffee | 79 | 105 |
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:3:raw_corpus | raw_corpus | module.exports = (str, indent, warn_fn, opts = {}) ->
eol = opts?.eol or '\n'
indent = indent or DEFAULT_INDENT
warn_fn = if typeof warn_fn == 'function' then warn_fn else DEFAULT_WARN_FN
indent = ' '.repeat(indent) if Number.isInteger(indent)
$currIndent = 0
$nextIndent = 0
$prevLength = 0
$extIndent =... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | ce287977c81c843f489eac3b706ad04cf15974a5 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/ce287977c81c843f489eac3b706ad04cf15974a5/src/beautifiers/lua-beautifier/beautifier.coffee | 29 | 78 | ||
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = (str, indent, warn_fn, opts = {}) ->
eol = opts?.eol or '\n'
indent = indent or DEFAULT_INDENT
warn_fn = if typeof warn_fn == 'function' then warn_fn else DEFAULT_WARN_FN
indent = ' '.repeat(indent) if Number.isInteger(indent)
$currInde... | module.exports = function(str, indent, warn_fn, opts = {}) {
var $currIndent, $extIndent, $lastIndent, $nextIndent, $prevLength, $template, eol, new_code;
eol = (opts != null ? opts.eol : void 0) || '\n';
indent = indent || DEFAULT_INDENT;
warn_fn = typeof warn_fn === 'function' ? warn_fn : DEFAULT_WARN_FN;
i... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | ce287977c81c843f489eac3b706ad04cf15974a5 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/ce287977c81c843f489eac3b706ad04cf15974a5/src/beautifiers/lua-beautifier/beautifier.coffee | 29 | 78 |
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function(str, indent, warn_fn, opts = {}) {
var $currIndent, $extIndent, $lastIndent, $nextIndent, $prevLength, $template, eol, new_code;
eol = (opts != null ? opts.eol : void 0) || '\n';
indent = indent || DEFAULT_INDENT;
warn_fn = typeof ... | module.exports = (str, indent, warn_fn, opts = {}) ->
eol = opts?.eol or '\n'
indent = indent or DEFAULT_INDENT
warn_fn = if typeof warn_fn == 'function' then warn_fn else DEFAULT_WARN_FN
indent = ' '.repeat(indent) if Number.isInteger(indent)
$currIndent = 0
$nextIndent = 0
$prevLength = 0
$extIndent =... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | ce287977c81c843f489eac3b706ad04cf15974a5 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/ce287977c81c843f489eac3b706ad04cf15974a5/src/beautifiers/lua-beautifier/beautifier.coffee | 29 | 78 |
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:3:completion | completion | module.exports = (str, indent, warn_fn, opts = {}) ->
eol = opts?.eol or '\n'
indent = indent or DEFAULT_INDENT
warn_fn = if typeof warn_fn == 'function' then warn_fn else DEFAULT_WARN_FN
indent = ' '.repeat(indent) if Number.isInteger(indent)
$currIndent = 0
$nextIndent = 0
$prevLength = 0
$extIndent =... | return line
res1 = line.match(/\[(=*)\[/)
if res1
$template = res1[1].length + 1
if !$template_flag
line = line.trim()
# remote all spaces on both ends
line = adjust_space(line)
if !line.length
return ''
raw_line = line
line = line.replace(/(['"])[^\1]*?\1/, '')
... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | ce287977c81c843f489eac3b706ad04cf15974a5 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/ce287977c81c843f489eac3b706ad04cf15974a5/src/beautifiers/lua-beautifier/beautifier.coffee | 29 | 78 |
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:3:raw_corpus | raw_corpus | module.exports = (str, indent, warn_fn, opts = {}) ->
do_not_change_whitespace = !!opts?.do_not_change_whitespace
eol = opts?.eol or '\n'
indent = indent or DEFAULT_INDENT
warn_fn = if typeof warn_fn == 'function' then warn_fn else DEFAULT_WARN_FN
indent = ' '.repeat(indent) if Number.isInteger(indent)
$cur... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | 1e7b5cbe9f2b88f90dee1389dbcae526bca84d49 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/1e7b5cbe9f2b88f90dee1389dbcae526bca84d49/src/beautifiers/lua-beautifier/beautifier.coffee | 29 | 78 | ||
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = (str, indent, warn_fn, opts = {}) ->
do_not_change_whitespace = !!opts?.do_not_change_whitespace
eol = opts?.eol or '\n'
indent = indent or DEFAULT_INDENT
warn_fn = if typeof warn_fn == 'function' then warn_fn else DEFAULT_WARN_FN
inden... | module.exports = function(str, indent, warn_fn, opts = {}) {
var $currIndent, $extIndent, $lastIndent, $nextIndent, $prevLength, $template, do_not_change_whitespace, eol, new_code;
do_not_change_whitespace = !!(opts != null ? opts.do_not_change_whitespace : void 0);
eol = (opts != null ? opts.eol : void 0) || '\n... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | 1e7b5cbe9f2b88f90dee1389dbcae526bca84d49 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/1e7b5cbe9f2b88f90dee1389dbcae526bca84d49/src/beautifiers/lua-beautifier/beautifier.coffee | 29 | 78 |
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function(str, indent, warn_fn, opts = {}) {
var $currIndent, $extIndent, $lastIndent, $nextIndent, $prevLength, $template, do_not_change_whitespace, eol, new_code;
do_not_change_whitespace = !!(opts != null ? opts.do_not_change_whitespace : voi... | module.exports = (str, indent, warn_fn, opts = {}) ->
do_not_change_whitespace = !!opts?.do_not_change_whitespace
eol = opts?.eol or '\n'
indent = indent or DEFAULT_INDENT
warn_fn = if typeof warn_fn == 'function' then warn_fn else DEFAULT_WARN_FN
indent = ' '.repeat(indent) if Number.isInteger(indent)
$cur... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | 1e7b5cbe9f2b88f90dee1389dbcae526bca84d49 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/1e7b5cbe9f2b88f90dee1389dbcae526bca84d49/src/beautifiers/lua-beautifier/beautifier.coffee | 29 | 78 |
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:3:completion | completion | module.exports = (str, indent, warn_fn, opts = {}) ->
do_not_change_whitespace = !!opts?.do_not_change_whitespace
eol = opts?.eol or '\n'
indent = indent or DEFAULT_INDENT
warn_fn = if typeof warn_fn == 'function' then warn_fn else DEFAULT_WARN_FN
indent = ' '.repeat(indent) if Number.isInteger(indent)
$cur... | else
return line
res1 = line.match(/\[(=*)\[/)
if res1
$template = res1[1].length + 1
if !$template_flag
line = line.trim()
# remote all spaces on both ends
line = if do_not_change_whitespace then line else adjust_space(line)
if !line.length
return ''
raw_line =... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | 1e7b5cbe9f2b88f90dee1389dbcae526bca84d49 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/1e7b5cbe9f2b88f90dee1389dbcae526bca84d49/src/beautifiers/lua-beautifier/beautifier.coffee | 29 | 78 |
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:4:raw_corpus | raw_corpus | $curly = (line.match(/\{/g) or []).length - ((line.match(/\}/g) or []).length)
# capture unbalanced curly brackets
# close (curly) brackets if needed
if $curly < 0
$currIndent += $curly
if $brackets < 0
$currIndent += $brackets
$nextIndent += $brackets + $curly
# console.log({last: $... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | 1e7b5cbe9f2b88f90dee1389dbcae526bca84d49 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/1e7b5cbe9f2b88f90dee1389dbcae526bca84d49/src/beautifiers/lua-beautifier/beautifier.coffee | 79 | 106 | ||
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:4:completion | completion | $curly = (line.match(/\{/g) or []).length - ((line.match(/\}/g) or []).length)
# capture unbalanced curly brackets
# close (curly) brackets if needed
if $curly < 0
$currIndent += $curly
if $brackets < 0
$currIndent += $brackets
$nextIndent += $brackets + $curly
# console.log({last: $... | $currIndent = -1 + $lastIndent
if $nextIndent < $currIndent
$nextIndent = $currIndent
# console.log({last: $lastIndent, curr: $currIndent, next: $nextIndent, ext: $extIndent})
warn_fn """negative indentation at line #{line_number}: #{raw_line}""" if $currIndent < 0
new_line = (if raw_line.length a... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | 1e7b5cbe9f2b88f90dee1389dbcae526bca84d49 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/1e7b5cbe9f2b88f90dee1389dbcae526bca84d49/src/beautifiers/lua-beautifier/beautifier.coffee | 79 | 106 |
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:3:raw_corpus | raw_corpus | module.exports = (str, indent, warn_fn, opts = {}) ->
do_not_change_whitespace = !!opts?.do_not_change_whitespace
indent = indent or DEFAULT_INDENT
warn_fn = if typeof warn_fn == 'function' then warn_fn else DEFAULT_WARN_FN
indent = ' '.repeat(indent) if Number.isInteger(indent)
$currIndent = 0
$nextIndent ... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | 893e116fc4f9a905596e906a8b79fca3241cbcf1 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/893e116fc4f9a905596e906a8b79fca3241cbcf1/src/beautifiers/lua-beautifier/beautifier.coffee | 29 | 78 | ||
Glavin001/atom-beautify:src/beautifiers/lua-beautifier/beautifier.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = (str, indent, warn_fn, opts = {}) ->
do_not_change_whitespace = !!opts?.do_not_change_whitespace
indent = indent or DEFAULT_INDENT
warn_fn = if typeof warn_fn == 'function' then warn_fn else DEFAULT_WARN_FN
indent = ' '.repeat(indent) if ... | module.exports = function(str, indent, warn_fn, opts = {}) {
var $currIndent, $extIndent, $lastIndent, $nextIndent, $prevLength, $template, do_not_change_whitespace, new_code;
do_not_change_whitespace = !!(opts != null ? opts.do_not_change_whitespace : void 0);
indent = indent || DEFAULT_INDENT;
warn_fn = typeo... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/lua-beautifier/beautifier.coffee | MIT | 893e116fc4f9a905596e906a8b79fca3241cbcf1 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/893e116fc4f9a905596e906a8b79fca3241cbcf1/src/beautifiers/lua-beautifier/beautifier.coffee | 29 | 78 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.