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
buttercoin/buttercoin:lib/ews/ws_connection.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript handle_error: (error) => # @error 'uncaught error', error, '\n', error.stack # @disconnect() # if not is_node # throw error @error error throw error handle_open: => @info 'handle_open' @emit('open', @) handle_close: => ...
({ handle_error: (error) => { // @error 'uncaught error', error, '\n', error.stack // @disconnect() // if not is_node // throw error this.error(error); throw error; }, handle_open: () => { this.info('handle_open'); return this.emit('open', this); }, handle_close: () => { ...
CoffeeScript
JavaScript
buttercoin/buttercoin
lib/ews/ws_connection.coffee
MIT
a825a9ea31d695f8abb600f3f27ff635a839c0c2
663
https://github.com/buttercoin/buttercoin/blob/a825a9ea31d695f8abb600f3f27ff635a839c0c2/lib/ews/ws_connection.coffee
64
105
buttercoin/buttercoin:lib/ews/ws_connection.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript ({ handle_error: (error) => { // @error 'uncaught error', error, '\n', error.stack // @disconnect() // if not is_node // throw error this.error(error); throw error; }, handle_open: () => { this.info('handle_open'); return thi...
handle_error: (error) => # @error 'uncaught error', error, '\n', error.stack # @disconnect() # if not is_node # throw error @error error throw error handle_open: => @info 'handle_open' @emit('open', @) handle_close: => @info 'Connection Closed' @emit('close') handle_da...
JavaScript
CoffeeScript
buttercoin/buttercoin
lib/ews/ws_connection.coffee
MIT
a825a9ea31d695f8abb600f3f27ff635a839c0c2
663
https://github.com/buttercoin/buttercoin/blob/a825a9ea31d695f8abb600f3f27ff635a839c0c2/lib/ews/ws_connection.coffee
64
105
buttercoin/buttercoin:lib/ews/ws_connection.coffee:2:completion
completion
handle_error: (error) => # @error 'uncaught error', error, '\n', error.stack # @disconnect() # if not is_node # throw error @error error throw error handle_open: => @info 'handle_open' @emit('open', @) handle_close: => @info 'Connection Closed' @emit('close') handle_da...
@emit('parsed_data', obj) send_obj: (objOrPromise) => #@info 'READY TO SEND_OBJ', objOrPromise Q.when(objOrPromise) .then (obj) => @send_raw JSON.stringify( obj ) send_raw: (data) => Q.invoke(@senddeferred.promise, "call", @ws, data) .fail (error) => @warn 'FAILED TO SEND. SHUTTING...
CoffeeScript
CoffeeScript
buttercoin/buttercoin
lib/ews/ws_connection.coffee
MIT
a825a9ea31d695f8abb600f3f27ff635a839c0c2
663
https://github.com/buttercoin/buttercoin/blob/a825a9ea31d695f8abb600f3f27ff635a839c0c2/lib/ews/ws_connection.coffee
64
105
buttercoin/buttercoin:lib/ews/ws_connection.coffee:2:raw_corpus
raw_corpus
handle_error: (error) => # @error 'uncaught error', error, '\n', error.stack # @disconnect() # if not is_node # throw error throw error handle_open: => @info 'handle_open' @emit('open', @) handle_close: => @info 'Connection Closed' @emit('close') handle_data: (data, flags...
CoffeeScript
buttercoin/buttercoin
lib/ews/ws_connection.coffee
MIT
a557f655fbd8ff5f37d35d3ca94d025585bb08d2
663
https://github.com/buttercoin/buttercoin/blob/a557f655fbd8ff5f37d35d3ca94d025585bb08d2/lib/ews/ws_connection.coffee
64
105
buttercoin/buttercoin:lib/ews/ws_connection.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript handle_error: (error) => # @error 'uncaught error', error, '\n', error.stack # @disconnect() # if not is_node # throw error throw error handle_open: => @info 'handle_open' @emit('open', @) handle_close: => @info 'Connectio...
({ handle_error: (error) => { // @error 'uncaught error', error, '\n', error.stack // @disconnect() // if not is_node // throw error throw error; }, handle_open: () => { this.info('handle_open'); return this.emit('open', this); }, handle_close: () => { this.info('Connection C...
CoffeeScript
JavaScript
buttercoin/buttercoin
lib/ews/ws_connection.coffee
MIT
a557f655fbd8ff5f37d35d3ca94d025585bb08d2
663
https://github.com/buttercoin/buttercoin/blob/a557f655fbd8ff5f37d35d3ca94d025585bb08d2/lib/ews/ws_connection.coffee
64
105
buttercoin/buttercoin:lib/ews/ws_connection.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript ({ handle_error: (error) => { // @error 'uncaught error', error, '\n', error.stack // @disconnect() // if not is_node // throw error throw error; }, handle_open: () => { this.info('handle_open'); return this.emit('open', this); ...
handle_error: (error) => # @error 'uncaught error', error, '\n', error.stack # @disconnect() # if not is_node # throw error throw error handle_open: => @info 'handle_open' @emit('open', @) handle_close: => @info 'Connection Closed' @emit('close') handle_data: (data, flags...
JavaScript
CoffeeScript
buttercoin/buttercoin
lib/ews/ws_connection.coffee
MIT
a557f655fbd8ff5f37d35d3ca94d025585bb08d2
663
https://github.com/buttercoin/buttercoin/blob/a557f655fbd8ff5f37d35d3ca94d025585bb08d2/lib/ews/ws_connection.coffee
64
105
buttercoin/buttercoin:lib/ews/ws_connection.coffee:2:completion
completion
handle_error: (error) => # @error 'uncaught error', error, '\n', error.stack # @disconnect() # if not is_node # throw error throw error handle_open: => @info 'handle_open' @emit('open', @) handle_close: => @info 'Connection Closed' @emit('close') handle_data: (data, flags...
@emit('parsed_data', obj) send_obj: (objOrPromise) => # @info 'READY TO SEND_OBJ', objOrPromise Q.when(objOrPromise) .then (obj) => @send_raw JSON.stringify( obj ) send_raw: (data) => Q.invoke(@senddeferred.promise, "call", @ws, data) .fail (error) => @warn 'FAILED TO SEND. SHUTTIN...
CoffeeScript
CoffeeScript
buttercoin/buttercoin
lib/ews/ws_connection.coffee
MIT
a557f655fbd8ff5f37d35d3ca94d025585bb08d2
663
https://github.com/buttercoin/buttercoin/blob/a557f655fbd8ff5f37d35d3ca94d025585bb08d2/lib/ews/ws_connection.coffee
64
105
buttercoin/buttercoin:lib/ews/ws_connection.coffee:1:raw_corpus
raw_corpus
module.exports = class Connection extends EventEmitter constructor: (@parent) -> @parent.stumpify(@, @_get_obj_desc) @conncounter = globalconncounter globalconncounter += 1 @ws = null deferred = Q.defer() @senddeferred = deferred socket_accepted: (@ws) => @prepare_ws() @senddeferr...
CoffeeScript
buttercoin/buttercoin
lib/ews/ws_connection.coffee
MIT
c87785c085716042476fba3dee430b2baaacc139
663
https://github.com/buttercoin/buttercoin/blob/c87785c085716042476fba3dee430b2baaacc139/lib/ews/ws_connection.coffee
14
63
buttercoin/buttercoin:lib/ews/ws_connection.coffee:1:completion
completion
module.exports = class Connection extends EventEmitter constructor: (@parent) -> @parent.stumpify(@, @_get_obj_desc) @conncounter = globalconncounter globalconncounter += 1 @ws = null deferred = Q.defer() @senddeferred = deferred socket_accepted: (@ws) => @prepare_ws() @senddeferr...
@senddeferred.resolve(@ws.send) # .done() @once 'close', => @info 'ONCECLOSE' @senddeferred.reject( "Connection closed" ) # .done() prepare_ws: => @ws.on 'error', @handle_error @ws.on 'open', wrap_error(@handle_open, @uncaught_exception) @ws.on 'close', wrap_error(@handle_clo...
CoffeeScript
CoffeeScript
buttercoin/buttercoin
lib/ews/ws_connection.coffee
MIT
c87785c085716042476fba3dee430b2baaacc139
663
https://github.com/buttercoin/buttercoin/blob/c87785c085716042476fba3dee430b2baaacc139/lib/ews/ws_connection.coffee
14
63
jianliaoim/talk-os:talk-web/client/app/quote-slim.coffee:1:raw_corpus
raw_corpus
React = require 'react' Immutable = require 'immutable' format = require '../util/format' div = React.createFactory 'div' T = React.PropTypes module.exports = React.createClass displayName: 'quote-slim' propTypes: quote: T.instanceOf(Immutable.Map) onClick: T.func.isRequired onClick: -> @props.o...
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/quote-slim.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/quote-slim.coffee
1
30
jianliaoim/talk-os:talk-web/client/app/quote-slim.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript React = require 'react' Immutable = require 'immutable' format = require '../util/format' div = React.createFactory 'div' T = React.PropTypes module.exports = React.createClass displayName: 'quote-slim' propTypes: quote: T.instanceOf(Immutable.Map) ...
var Immutable, React, T, div, format; React = require('react'); Immutable = require('immutable'); format = require('../util/format'); div = React.createFactory('div'); T = React.PropTypes; module.exports = React.createClass({ displayName: 'quote-slim', propTypes: { quote: T.instanceOf(Immutable.Map), ...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/app/quote-slim.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/quote-slim.coffee
1
30
jianliaoim/talk-os:talk-web/client/app/quote-slim.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var Immutable, React, T, div, format; React = require('react'); Immutable = require('immutable'); format = require('../util/format'); div = React.createFactory('div'); T = React.PropTypes; module.exports = React.createClass({ displayName: 'quote-slim', pr...
React = require 'react' Immutable = require 'immutable' format = require '../util/format' div = React.createFactory 'div' T = React.PropTypes module.exports = React.createClass displayName: 'quote-slim' propTypes: quote: T.instanceOf(Immutable.Map) onClick: T.func.isRequired onClick: -> @props.o...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/quote-slim.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/quote-slim.coffee
1
30
jianliaoim/talk-os:talk-web/client/app/quote-slim.coffee:1:completion
completion
React = require 'react' Immutable = require 'immutable' format = require '../util/format' div = React.createFactory 'div' T = React.PropTypes module.exports = React.createClass displayName: 'quote-slim' propTypes: quote: T.instanceOf(Immutable.Map) onClick: T.func.isRequired
onClick: -> @props.onClick @props.quote.get('redirectUrl') render: -> wholeText = format.htmlAsText(@props.quote.get('text') or '') if wholeText.length > 200 visibleText = "#{wholeText[...200]}..." else visibleText = wholeText div className: 'quote-slim', onClick: @onClick, div...
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/quote-slim.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/quote-slim.coffee
1
30
octoblu/meshblu:lib/sendConfigActivity.coffee:1:raw_corpus
raw_corpus
getDevice = require './getDevice' Publisher = require './Publisher' publisher = new Publisher sendConfigActivity = (uuid) => getDevice uuid, (error, device) => publisher.publish 'config', uuid, device module.exports = sendConfigActivity
CoffeeScript
octoblu/meshblu
lib/sendConfigActivity.coffee
MIT
522227fcd1396af7d488c8b34d61bd045bd0c85b
815
https://github.com/octoblu/meshblu/blob/522227fcd1396af7d488c8b34d61bd045bd0c85b/lib/sendConfigActivity.coffee
1
10
octoblu/meshblu:lib/sendConfigActivity.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript getDevice = require './getDevice' Publisher = require './Publisher' publisher = new Publisher sendConfigActivity = (uuid) => getDevice uuid, (error, device) => publisher.publish 'config', uuid, device module.exports = sendConfigActivity ```
var Publisher, getDevice, publisher, sendConfigActivity; getDevice = require('./getDevice'); Publisher = require('./Publisher'); publisher = new Publisher(); sendConfigActivity = (uuid) => { return getDevice(uuid, (error, device) => { return publisher.publish('config', uuid, device); }); }; module.exports ...
CoffeeScript
JavaScript
octoblu/meshblu
lib/sendConfigActivity.coffee
MIT
522227fcd1396af7d488c8b34d61bd045bd0c85b
815
https://github.com/octoblu/meshblu/blob/522227fcd1396af7d488c8b34d61bd045bd0c85b/lib/sendConfigActivity.coffee
1
10
octoblu/meshblu:lib/sendConfigActivity.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var Publisher, getDevice, publisher, sendConfigActivity; getDevice = require('./getDevice'); Publisher = require('./Publisher'); publisher = new Publisher(); sendConfigActivity = (uuid) => { return getDevice(uuid, (error, device) => { return publisher.pub...
getDevice = require './getDevice' Publisher = require './Publisher' publisher = new Publisher sendConfigActivity = (uuid) => getDevice uuid, (error, device) => publisher.publish 'config', uuid, device module.exports = sendConfigActivity
JavaScript
CoffeeScript
octoblu/meshblu
lib/sendConfigActivity.coffee
MIT
522227fcd1396af7d488c8b34d61bd045bd0c85b
815
https://github.com/octoblu/meshblu/blob/522227fcd1396af7d488c8b34d61bd045bd0c85b/lib/sendConfigActivity.coffee
1
10
octoblu/meshblu:lib/sendConfigActivity.coffee:1:completion
completion
getDevice = require './getDevice' Publisher = require './Publisher' publisher = new Publisher
sendConfigActivity = (uuid) => getDevice uuid, (error, device) => publisher.publish 'config', uuid, device module.exports = sendConfigActivity
CoffeeScript
CoffeeScript
octoblu/meshblu
lib/sendConfigActivity.coffee
MIT
522227fcd1396af7d488c8b34d61bd045bd0c85b
815
https://github.com/octoblu/meshblu/blob/522227fcd1396af7d488c8b34d61bd045bd0c85b/lib/sendConfigActivity.coffee
1
10
octoblu/meshblu:test/lib/getPublicKey-spec.coffee:1:raw_corpus
raw_corpus
describe 'getPublicKey', -> beforeEach -> @sut = require '../../lib/getPublicKey' describe 'when called with (almost) nothing', -> beforeEach (done) -> storeError = (@error) => done() @sut null, storeError it 'should call done with an error', -> expect(@error.message).to.equal 'uuid ...
CoffeeScript
octoblu/meshblu
test/lib/getPublicKey-spec.coffee
MIT
dabb5d5eea2ceb996456d06ee4c6b76ba66d7023
815
https://github.com/octoblu/meshblu/blob/dabb5d5eea2ceb996456d06ee4c6b76ba66d7023/test/lib/getPublicKey-spec.coffee
1
50
octoblu/meshblu:test/lib/getPublicKey-spec.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript describe 'getPublicKey', -> beforeEach -> @sut = require '../../lib/getPublicKey' describe 'when called with (almost) nothing', -> beforeEach (done) -> storeError = (@error) => done() @sut null, storeError it 'should call done with a...
describe('getPublicKey', function() { beforeEach(function() { return this.sut = require('../../lib/getPublicKey'); }); describe('when called with (almost) nothing', function() { beforeEach(function(done) { var storeError; storeError = (error) => { this.error = error; return don...
CoffeeScript
JavaScript
octoblu/meshblu
test/lib/getPublicKey-spec.coffee
MIT
dabb5d5eea2ceb996456d06ee4c6b76ba66d7023
815
https://github.com/octoblu/meshblu/blob/dabb5d5eea2ceb996456d06ee4c6b76ba66d7023/test/lib/getPublicKey-spec.coffee
1
50
octoblu/meshblu:test/lib/getPublicKey-spec.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript describe('getPublicKey', function() { beforeEach(function() { return this.sut = require('../../lib/getPublicKey'); }); describe('when called with (almost) nothing', function() { beforeEach(function(done) { var storeError; storeError = (err...
describe 'getPublicKey', -> beforeEach -> @sut = require '../../lib/getPublicKey' describe 'when called with (almost) nothing', -> beforeEach (done) -> storeError = (@error) => done() @sut null, storeError it 'should call done with an error', -> expect(@error.message).to.equal 'uuid ...
JavaScript
CoffeeScript
octoblu/meshblu
test/lib/getPublicKey-spec.coffee
MIT
dabb5d5eea2ceb996456d06ee4c6b76ba66d7023
815
https://github.com/octoblu/meshblu/blob/dabb5d5eea2ceb996456d06ee4c6b76ba66d7023/test/lib/getPublicKey-spec.coffee
1
50
octoblu/meshblu:test/lib/getPublicKey-spec.coffee:1:completion
completion
describe 'getPublicKey', -> beforeEach -> @sut = require '../../lib/getPublicKey' describe 'when called with (almost) nothing', -> beforeEach (done) -> storeError = (@error) => done() @sut null, storeError it 'should call done with an error', -> expect(@error.message).to.equal 'uuid ...
beforeEach (done) -> @getDevice = sinon.stub().yields null, null storeResult = (@error, @publicKey) => done() @sut '79b20d9f-2de2-4ce2-ae44-8b0bb68f4f21', storeResult, getDevice: @getDevice it 'should return null', -> expect(@publicKey).to.be.null it 'should call getDevice with the uui...
CoffeeScript
CoffeeScript
octoblu/meshblu
test/lib/getPublicKey-spec.coffee
MIT
dabb5d5eea2ceb996456d06ee4c6b76ba66d7023
815
https://github.com/octoblu/meshblu/blob/dabb5d5eea2ceb996456d06ee4c6b76ba66d7023/test/lib/getPublicKey-spec.coffee
1
50
octoblu/meshblu:test/lib/getPublicKey-spec.coffee:2:raw_corpus
raw_corpus
@getDevice = sinon.stub().yields error: {message: "I can't let you do that"} storeResult = (@error, @publicKey) => done() @sut 'db34cd53-c1ab-4da6-919f-9c7359142905', storeResult, getDevice: @getDevice it 'should return the super secret', -> expect(@error.message).to.equal "I can't let you do tha...
CoffeeScript
octoblu/meshblu
test/lib/getPublicKey-spec.coffee
MIT
dabb5d5eea2ceb996456d06ee4c6b76ba66d7023
815
https://github.com/octoblu/meshblu/blob/dabb5d5eea2ceb996456d06ee4c6b76ba66d7023/test/lib/getPublicKey-spec.coffee
51
59
octoblu/meshblu:test/lib/getPublicKey-spec.coffee:2:completion
completion
@getDevice = sinon.stub().yields error: {message: "I can't let you do that"} storeResult = (@error, @publicKey) => done() @sut 'db34cd53-c1ab-4da6-919f-9c7359142905', storeResult, getDevice: @getDevice
it 'should return the super secret', -> expect(@error.message).to.equal "I can't let you do that" it 'should call getDevice with the uuid', -> expect(@getDevice).to.have.been.calledWith 'db34cd53-c1ab-4da6-919f-9c7359142905'
CoffeeScript
CoffeeScript
octoblu/meshblu
test/lib/getPublicKey-spec.coffee
MIT
dabb5d5eea2ceb996456d06ee4c6b76ba66d7023
815
https://github.com/octoblu/meshblu/blob/dabb5d5eea2ceb996456d06ee4c6b76ba66d7023/test/lib/getPublicKey-spec.coffee
51
59
jianliaoim/talk-os:talk-account/client/updater/account.coffee:1:raw_corpus
raw_corpus
exports.unbindEmail = (store) -> store.setIn ['page', 'accounts', 'emailAddress'], null exports.unbindMobile = (store) -> store.setIn ['page', 'accounts', 'phoneNumber'], null exports.unbind = (store, refer) -> store.updateIn ['page', 'accounts', 'unions'], (bindings) -> bindings.filterNot (binding) -> ...
CoffeeScript
jianliaoim/talk-os
talk-account/client/updater/account.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/updater/account.coffee
1
10
jianliaoim/talk-os:talk-account/client/updater/account.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.unbindEmail = (store) -> store.setIn ['page', 'accounts', 'emailAddress'], null exports.unbindMobile = (store) -> store.setIn ['page', 'accounts', 'phoneNumber'], null exports.unbind = (store, refer) -> store.updateIn ['page', 'accounts', 'unions'...
exports.unbindEmail = function(store) { return store.setIn(['page', 'accounts', 'emailAddress'], null); }; exports.unbindMobile = function(store) { return store.setIn(['page', 'accounts', 'phoneNumber'], null); }; exports.unbind = function(store, refer) { return store.updateIn(['page', 'accounts', 'unions'], fu...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-account/client/updater/account.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/updater/account.coffee
1
10
jianliaoim/talk-os:talk-account/client/updater/account.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.unbindEmail = function(store) { return store.setIn(['page', 'accounts', 'emailAddress'], null); }; exports.unbindMobile = function(store) { return store.setIn(['page', 'accounts', 'phoneNumber'], null); }; exports.unbind = function(store, refer) { r...
exports.unbindEmail = (store) -> store.setIn ['page', 'accounts', 'emailAddress'], null exports.unbindMobile = (store) -> store.setIn ['page', 'accounts', 'phoneNumber'], null exports.unbind = (store, refer) -> store.updateIn ['page', 'accounts', 'unions'], (bindings) -> bindings.filterNot (binding) -> ...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-account/client/updater/account.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/updater/account.coffee
1
10
jianliaoim/talk-os:talk-account/client/updater/account.coffee:1:completion
completion
exports.unbindEmail = (store) -> store.setIn ['page', 'accounts', 'emailAddress'], null exports.unbindMobile = (store) -> store.setIn ['page', 'accounts', 'phoneNumber'], null
exports.unbind = (store, refer) -> store.updateIn ['page', 'accounts', 'unions'], (bindings) -> bindings.filterNot (binding) -> binding.get('refer') is refer
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-account/client/updater/account.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/updater/account.coffee
1
10
jianliaoim/talk-os:talk-api2x/server/util/array.coffee:1:raw_corpus
raw_corpus
_ = require 'lodash' module.exports = # Pick random elements of array arrRandom: (arr, num = 1) -> arr = _.clone arr _arr = [] for i in [0...num] break unless arr.length _arr.push arr.splice(Math.floor(Math.random() * arr.length), 1)[0] return _arr arrHorizon: (candidates) -> conc...
CoffeeScript
jianliaoim/talk-os
talk-api2x/server/util/array.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/util/array.coffee
1
31
jianliaoim/talk-os:talk-api2x/server/util/array.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript _ = require 'lodash' module.exports = # Pick random elements of array arrRandom: (arr, num = 1) -> arr = _.clone arr _arr = [] for i in [0...num] break unless arr.length _arr.push arr.splice(Math.floor(Math.random() * arr.length), 1)[...
var _; _ = require('lodash'); module.exports = { // Pick random elements of array arrRandom: function(arr, num = 1) { var _arr, i, j, ref; arr = _.clone(arr); _arr = []; for (i = j = 0, ref = num; (0 <= ref ? j < ref : j > ref); i = 0 <= ref ? ++j : --j) { if (!arr.length) { break; ...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-api2x/server/util/array.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/util/array.coffee
1
31
jianliaoim/talk-os:talk-api2x/server/util/array.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var _; _ = require('lodash'); module.exports = { // Pick random elements of array arrRandom: function(arr, num = 1) { var _arr, i, j, ref; arr = _.clone(arr); _arr = []; for (i = j = 0, ref = num; (0 <= ref ? j < ref : j > ref); i = 0 <= ref ?...
_ = require 'lodash' module.exports = # Pick random elements of array arrRandom: (arr, num = 1) -> arr = _.clone arr _arr = [] for i in [0...num] break unless arr.length _arr.push arr.splice(Math.floor(Math.random() * arr.length), 1)[0] return _arr arrHorizon: (candidates) -> conc...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-api2x/server/util/array.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/util/array.coffee
1
31
jianliaoim/talk-os:talk-api2x/server/util/array.coffee:1:completion
completion
_ = require 'lodash' module.exports = # Pick random elements of array arrRandom: (arr, num = 1) -> arr = _.clone arr _arr = [] for i in [0...num] break unless arr.length _arr.push arr.splice(Math.floor(Math.random() * arr.length), 1)[0] return _arr arrHorizon: (candidates) -> conc...
pinyins.push(word) for pinyins in concatPinyins _expand = (word) -> cloneConcatPinyins = [] return concatPinyins = [[word]] unless concatPinyins.length cloneConcatPinyins.push pinyins.slice(0, pinyins.length - 1).concat(word) for pinyins in concatPinyins concatPinyins = concatPinyins.concat...
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-api2x/server/util/array.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/util/array.coffee
1
31
meltingice/psd.js:lib/psd/layer_info/nested_section_divider.coffee:1:raw_corpus
raw_corpus
LayerInfo = require '../layer_info.coffee' # Not 100% sure what the purpose of this key is, but it seems to exist # whenever the lsct key doesn't. Parsing this like a layer section # divider seems to solve a lot of parsing issues with folders. # # See https://github.com/layervault/psd.rb/issues/38 module.exports = cla...
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/nested_section_divider.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/layer_info/nested_section_divider.coffee
1
22
meltingice/psd.js:lib/psd/layer_info/nested_section_divider.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript LayerInfo = require '../layer_info.coffee' # Not 100% sure what the purpose of this key is, but it seems to exist # whenever the lsct key doesn't. Parsing this like a layer section # divider seems to solve a lot of parsing issues with folders. # # See https://gi...
var LayerInfo, NestedSectionDivider; LayerInfo = require('../layer_info.coffee'); // Not 100% sure what the purpose of this key is, but it seems to exist // whenever the lsct key doesn't. Parsing this like a layer section // divider seems to solve a lot of parsing issues with folders. // See https://github.com/layer...
CoffeeScript
JavaScript
meltingice/psd.js
lib/psd/layer_info/nested_section_divider.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/layer_info/nested_section_divider.coffee
1
22
meltingice/psd.js:lib/psd/layer_info/nested_section_divider.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var LayerInfo, NestedSectionDivider; LayerInfo = require('../layer_info.coffee'); // Not 100% sure what the purpose of this key is, but it seems to exist // whenever the lsct key doesn't. Parsing this like a layer section // divider seems to solve a lot of parsin...
LayerInfo = require '../layer_info.coffee' # Not 100% sure what the purpose of this key is, but it seems to exist # whenever the lsct key doesn't. Parsing this like a layer section # divider seems to solve a lot of parsing issues with folders. # # See https://github.com/layervault/psd.rb/issues/38 module.exports = cla...
JavaScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/nested_section_divider.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/layer_info/nested_section_divider.coffee
1
22
meltingice/psd.js:lib/psd/layer_info/nested_section_divider.coffee:1:completion
completion
LayerInfo = require '../layer_info.coffee' # Not 100% sure what the purpose of this key is, but it seems to exist # whenever the lsct key doesn't. Parsing this like a layer section # divider seems to solve a lot of parsing issues with folders. # # See https://github.com/layervault/psd.rb/issues/38 module.exports = cla...
super(layer, length) @isFolder = false @isHidden = false parse: -> code = @file.readInt() switch code when 1, 2 then @isFolder = true when 3 then @isHidden = true
CoffeeScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/nested_section_divider.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/layer_info/nested_section_divider.coffee
1
22
meltingice/psd.js:lib/psd/layer_info/nested_section_divider.coffee:1:raw_corpus
raw_corpus
LayerInfo = require '../layer_info.coffee' module.exports = class NestedSectionDivider extends LayerInfo @shouldParse: (key) -> key is 'lsdk' constructor: (layer, length) -> super(layer, length) @isFolder = false @isHidden = false parse: -> code = @file.readInt() switch code when 1,...
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/nested_section_divider.coffee
MIT
eb9ad819e1aa18c6a60b3b0049e8bad781f73e06
2,846
https://github.com/meltingice/psd.js/blob/eb9ad819e1aa18c6a60b3b0049e8bad781f73e06/lib/psd/layer_info/nested_section_divider.coffee
1
17
meltingice/psd.js:lib/psd/layer_info/nested_section_divider.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript LayerInfo = require '../layer_info.coffee' module.exports = class NestedSectionDivider extends LayerInfo @shouldParse: (key) -> key is 'lsdk' constructor: (layer, length) -> super(layer, length) @isFolder = false @isHidden = false parse: -> ...
var LayerInfo, NestedSectionDivider; LayerInfo = require('../layer_info.coffee'); module.exports = NestedSectionDivider = class NestedSectionDivider extends LayerInfo { static shouldParse(key) { return key === 'lsdk'; } constructor(layer, length) { super(layer, length); this.isFolder = false; t...
CoffeeScript
JavaScript
meltingice/psd.js
lib/psd/layer_info/nested_section_divider.coffee
MIT
eb9ad819e1aa18c6a60b3b0049e8bad781f73e06
2,846
https://github.com/meltingice/psd.js/blob/eb9ad819e1aa18c6a60b3b0049e8bad781f73e06/lib/psd/layer_info/nested_section_divider.coffee
1
17
meltingice/psd.js:lib/psd/layer_info/nested_section_divider.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var LayerInfo, NestedSectionDivider; LayerInfo = require('../layer_info.coffee'); module.exports = NestedSectionDivider = class NestedSectionDivider extends LayerInfo { static shouldParse(key) { return key === 'lsdk'; } constructor(layer, length) { ...
LayerInfo = require '../layer_info.coffee' module.exports = class NestedSectionDivider extends LayerInfo @shouldParse: (key) -> key is 'lsdk' constructor: (layer, length) -> super(layer, length) @isFolder = false @isHidden = false parse: -> code = @file.readInt() switch code when 1,...
JavaScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/nested_section_divider.coffee
MIT
eb9ad819e1aa18c6a60b3b0049e8bad781f73e06
2,846
https://github.com/meltingice/psd.js/blob/eb9ad819e1aa18c6a60b3b0049e8bad781f73e06/lib/psd/layer_info/nested_section_divider.coffee
1
17
meltingice/psd.js:lib/psd/layer_info/nested_section_divider.coffee:1:completion
completion
LayerInfo = require '../layer_info.coffee' module.exports = class NestedSectionDivider extends LayerInfo @shouldParse: (key) -> key is 'lsdk' constructor: (layer, length) -> super(layer, length)
@isFolder = false @isHidden = false parse: -> code = @file.readInt() switch code when 1, 2 then @isFolder = true when 3 then @isHidden = true
CoffeeScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/nested_section_divider.coffee
MIT
eb9ad819e1aa18c6a60b3b0049e8bad781f73e06
2,846
https://github.com/meltingice/psd.js/blob/eb9ad819e1aa18c6a60b3b0049e8bad781f73e06/lib/psd/layer_info/nested_section_divider.coffee
1
17
elving/swag:src/swag.collections.coffee:1:raw_corpus
raw_corpus
Swag.addHelper 'first', (array, count) -> count = parseFloat count unless Utils.isUndefined count if Utils.isUndefined(count) then array[0] else array.slice 0, count , 'array' Swag.addHelper 'withFirst', (array, count, options) -> count = parseFloat count unless Utils.isUndefined count if Utils.isUndef...
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
e9c8788dfc9f640038c00eaafe33f4137ff5f465
675
https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.collections.coffee
1
46
elving/swag:src/swag.collections.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript Swag.addHelper 'first', (array, count) -> count = parseFloat count unless Utils.isUndefined count if Utils.isUndefined(count) then array[0] else array.slice 0, count , 'array' Swag.addHelper 'withFirst', (array, count, options) -> count = parseFloat ...
Swag.addHelper('first', function(array, count) { if (!Utils.isUndefined(count)) { count = parseFloat(count); } if (Utils.isUndefined(count)) { return array[0]; } else { return array.slice(0, count); } }, 'array'); Swag.addHelper('withFirst', function(array, count, options) { var item, result; ...
CoffeeScript
JavaScript
elving/swag
src/swag.collections.coffee
MIT
e9c8788dfc9f640038c00eaafe33f4137ff5f465
675
https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.collections.coffee
1
46
elving/swag:src/swag.collections.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript Swag.addHelper('first', function(array, count) { if (!Utils.isUndefined(count)) { count = parseFloat(count); } if (Utils.isUndefined(count)) { return array[0]; } else { return array.slice(0, count); } }, 'array'); Swag.addHelper('withFirst', ...
Swag.addHelper 'first', (array, count) -> count = parseFloat count unless Utils.isUndefined count if Utils.isUndefined(count) then array[0] else array.slice 0, count , 'array' Swag.addHelper 'withFirst', (array, count, options) -> count = parseFloat count unless Utils.isUndefined count if Utils.isUndef...
JavaScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
e9c8788dfc9f640038c00eaafe33f4137ff5f465
675
https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.collections.coffee
1
46
elving/swag:src/swag.collections.coffee:1:completion
completion
Swag.addHelper 'first', (array, count) -> count = parseFloat count unless Utils.isUndefined count if Utils.isUndefined(count) then array[0] else array.slice 0, count , 'array' Swag.addHelper 'withFirst', (array, count, options) -> count = parseFloat count unless Utils.isUndefined count if Utils.isUndef...
count = parseFloat count unless Utils.isUndefined count if Utils.isUndefined count options = count options.fn array[array.length - 1] else array = array.slice -count result = '' for item of array then result += options.fn array[item] result , 'array' Swag.addHelp...
CoffeeScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
e9c8788dfc9f640038c00eaafe33f4137ff5f465
675
https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.collections.coffee
1
46
elving/swag:src/swag.collections.coffee:2:raw_corpus
raw_corpus
Swag.addHelper 'before', (array, count) -> count = parseFloat count unless Utils.isUndefined count array.slice 0, -count , ['array', 'number'] Swag.addHelper 'withBefore', (array, count, options) -> count = parseFloat count unless Utils.isUndefined count array = array.slice 0, -count result = '' ...
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
e9c8788dfc9f640038c00eaafe33f4137ff5f465
675
https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.collections.coffee
48
88
elving/swag:src/swag.collections.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript Swag.addHelper 'before', (array, count) -> count = parseFloat count unless Utils.isUndefined count array.slice 0, -count , ['array', 'number'] Swag.addHelper 'withBefore', (array, count, options) -> count = parseFloat count unless Utils.isUndefined c...
Swag.addHelper('before', function(array, count) { if (!Utils.isUndefined(count)) { count = parseFloat(count); } return array.slice(0, -count); }, ['array', 'number']); Swag.addHelper('withBefore', function(array, count, options) { var item, result; if (!Utils.isUndefined(count)) { count = parseFloat(...
CoffeeScript
JavaScript
elving/swag
src/swag.collections.coffee
MIT
e9c8788dfc9f640038c00eaafe33f4137ff5f465
675
https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.collections.coffee
48
88
elving/swag:src/swag.collections.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript Swag.addHelper('before', function(array, count) { if (!Utils.isUndefined(count)) { count = parseFloat(count); } return array.slice(0, -count); }, ['array', 'number']); Swag.addHelper('withBefore', function(array, count, options) { var item, result; i...
Swag.addHelper 'before', (array, count) -> count = parseFloat count unless Utils.isUndefined count array.slice 0, -count , ['array', 'number'] Swag.addHelper 'withBefore', (array, count, options) -> count = parseFloat count unless Utils.isUndefined count array = array.slice 0, -count result = '' ...
JavaScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
e9c8788dfc9f640038c00eaafe33f4137ff5f465
675
https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.collections.coffee
48
88
elving/swag:src/swag.collections.coffee:2:completion
completion
Swag.addHelper 'before', (array, count) -> count = parseFloat count unless Utils.isUndefined count array.slice 0, -count , ['array', 'number'] Swag.addHelper 'withBefore', (array, count, options) -> count = parseFloat count unless Utils.isUndefined count array = array.slice 0, -count result = '' ...
else array.sort (a, b) -> a[field] > b[field] , 'array' Swag.addHelper 'withSort', (array, field, options) -> result = '' if Utils.isUndefined field options = field array = array.sort() result += options.fn(item) for item in array else array = array.sort (a, b) -> a...
CoffeeScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
e9c8788dfc9f640038c00eaafe33f4137ff5f465
675
https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.collections.coffee
48
88
elving/swag:src/swag.collections.coffee:3:raw_corpus
raw_corpus
Swag.addHelper 'lengthEqual', (array, length, options) -> length = parseFloat length unless Utils.isUndefined length if array.length is length then options.fn this else options.inverse this , ['array', 'number'] Swag.addHelper 'empty', (array, options) -> if not array or array.length <= 0 then options.fn t...
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
e9c8788dfc9f640038c00eaafe33f4137ff5f465
675
https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.collections.coffee
90
123
elving/swag:src/swag.collections.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript Swag.addHelper 'lengthEqual', (array, length, options) -> length = parseFloat length unless Utils.isUndefined length if array.length is length then options.fn this else options.inverse this , ['array', 'number'] Swag.addHelper 'empty', (array, options) -...
var indexOf = [].indexOf; Swag.addHelper('lengthEqual', function(array, length, options) { if (!Utils.isUndefined(length)) { length = parseFloat(length); } if (array.length === length) { return options.fn(this); } else { return options.inverse(this); } }, ['array', 'number']); Swag.addHelper('em...
CoffeeScript
JavaScript
elving/swag
src/swag.collections.coffee
MIT
e9c8788dfc9f640038c00eaafe33f4137ff5f465
675
https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.collections.coffee
90
123
elving/swag:src/swag.collections.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var indexOf = [].indexOf; Swag.addHelper('lengthEqual', function(array, length, options) { if (!Utils.isUndefined(length)) { length = parseFloat(length); } if (array.length === length) { return options.fn(this); } else { return options.inverse(...
Swag.addHelper 'lengthEqual', (array, length, options) -> length = parseFloat length unless Utils.isUndefined length if array.length is length then options.fn this else options.inverse this , ['array', 'number'] Swag.addHelper 'empty', (array, options) -> if not array or array.length <= 0 then options.fn t...
JavaScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
e9c8788dfc9f640038c00eaafe33f4137ff5f465
675
https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.collections.coffee
90
123
elving/swag:src/swag.collections.coffee:3:completion
completion
Swag.addHelper 'lengthEqual', (array, length, options) -> length = parseFloat length unless Utils.isUndefined length if array.length is length then options.fn this else options.inverse this , ['array', 'number'] Swag.addHelper 'empty', (array, options) -> if not array or array.length <= 0 then options.fn t...
Swag.addHelper 'eachIndex', (array, options) -> result = '' for value, index in array result += options.fn item: value, index: index result , 'array' Swag.addHelper 'eachProperty', (obj, options) -> result = '' for key, value of obj result += options.fn key: key, value: value ...
CoffeeScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
e9c8788dfc9f640038c00eaafe33f4137ff5f465
675
https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.collections.coffee
90
123
elving/swag:src/swag.collections.coffee:1:raw_corpus
raw_corpus
Swag.addHelper 'first', (array, count) -> array = Utils.result array count = parseFloat Utils.result count unless Utils.isUndefined count if Utils.isUndefined(count) then array[0] else array.slice 0, count , 'array' Swag.addHelper 'withFirst', (array, count, options) -> array = Utils.result array c...
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
1dab7399e1ac6127c7b2cde8d518f46c85838801
675
https://github.com/elving/swag/blob/1dab7399e1ac6127c7b2cde8d518f46c85838801/src/swag.collections.coffee
1
43
elving/swag:src/swag.collections.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript Swag.addHelper 'first', (array, count) -> array = Utils.result array count = parseFloat Utils.result count unless Utils.isUndefined count if Utils.isUndefined(count) then array[0] else array.slice 0, count , 'array' Swag.addHelper 'withFirst', (array...
Swag.addHelper('first', function(array, count) { array = Utils.result(array); if (!Utils.isUndefined(count)) { count = parseFloat(Utils.result(count)); } if (Utils.isUndefined(count)) { return array[0]; } else { return array.slice(0, count); } }, 'array'); Swag.addHelper('withFirst', function(a...
CoffeeScript
JavaScript
elving/swag
src/swag.collections.coffee
MIT
1dab7399e1ac6127c7b2cde8d518f46c85838801
675
https://github.com/elving/swag/blob/1dab7399e1ac6127c7b2cde8d518f46c85838801/src/swag.collections.coffee
1
43
elving/swag:src/swag.collections.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript Swag.addHelper('first', function(array, count) { array = Utils.result(array); if (!Utils.isUndefined(count)) { count = parseFloat(Utils.result(count)); } if (Utils.isUndefined(count)) { return array[0]; } else { return array.slice(0, count); ...
Swag.addHelper 'first', (array, count) -> array = Utils.result array count = parseFloat Utils.result count unless Utils.isUndefined count if Utils.isUndefined(count) then array[0] else array.slice 0, count , 'array' Swag.addHelper 'withFirst', (array, count, options) -> array = Utils.result array c...
JavaScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
1dab7399e1ac6127c7b2cde8d518f46c85838801
675
https://github.com/elving/swag/blob/1dab7399e1ac6127c7b2cde8d518f46c85838801/src/swag.collections.coffee
1
43
elving/swag:src/swag.collections.coffee:1:completion
completion
Swag.addHelper 'first', (array, count) -> array = Utils.result array count = parseFloat Utils.result count unless Utils.isUndefined count if Utils.isUndefined(count) then array[0] else array.slice 0, count , 'array' Swag.addHelper 'withFirst', (array, count, options) -> array = Utils.result array c...
count = parseFloat Utils.result count unless Utils.isUndefined count if Utils.isUndefined(count) then array[array.length - 1] else array.slice -count , 'array' Swag.addHelper 'withLast', (array, count, options) -> array = Utils.result array count = parseFloat Utils.result count unless Utils.isUndefined cou...
CoffeeScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
1dab7399e1ac6127c7b2cde8d518f46c85838801
675
https://github.com/elving/swag/blob/1dab7399e1ac6127c7b2cde8d518f46c85838801/src/swag.collections.coffee
1
43
elving/swag:src/swag.collections.coffee:2:raw_corpus
raw_corpus
Swag.addHelper 'withAfter', (array, count, options) -> array = Utils.result array count = parseFloat Utils.result count unless Utils.isUndefined count array = array.slice count result = '' for item of array then result += options.fn array[item] result , ['array', 'number'] Swag.addHelper 'befor...
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
1dab7399e1ac6127c7b2cde8d518f46c85838801
675
https://github.com/elving/swag/blob/1dab7399e1ac6127c7b2cde8d518f46c85838801/src/swag.collections.coffee
45
86
elving/swag:src/swag.collections.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript Swag.addHelper 'withAfter', (array, count, options) -> array = Utils.result array count = parseFloat Utils.result count unless Utils.isUndefined count array = array.slice count result = '' for item of array then result += options.fn array[item...
Swag.addHelper('withAfter', function(array, count, options) { var item, result; array = Utils.result(array); if (!Utils.isUndefined(count)) { count = parseFloat(Utils.result(count)); } array = array.slice(count); result = ''; for (item in array) { result += options.fn(array[item]); } return re...
CoffeeScript
JavaScript
elving/swag
src/swag.collections.coffee
MIT
1dab7399e1ac6127c7b2cde8d518f46c85838801
675
https://github.com/elving/swag/blob/1dab7399e1ac6127c7b2cde8d518f46c85838801/src/swag.collections.coffee
45
86
elving/swag:src/swag.collections.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript Swag.addHelper('withAfter', function(array, count, options) { var item, result; array = Utils.result(array); if (!Utils.isUndefined(count)) { count = parseFloat(Utils.result(count)); } array = array.slice(count); result = ''; for (item in array) {...
Swag.addHelper 'withAfter', (array, count, options) -> array = Utils.result array count = parseFloat Utils.result count unless Utils.isUndefined count array = array.slice count result = '' for item of array then result += options.fn array[item] result , ['array', 'number'] Swag.addHelper 'befor...
JavaScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
1dab7399e1ac6127c7b2cde8d518f46c85838801
675
https://github.com/elving/swag/blob/1dab7399e1ac6127c7b2cde8d518f46c85838801/src/swag.collections.coffee
45
86
elving/swag:src/swag.collections.coffee:2:completion
completion
Swag.addHelper 'withAfter', (array, count, options) -> array = Utils.result array count = parseFloat Utils.result count unless Utils.isUndefined count array = array.slice count result = '' for item of array then result += options.fn array[item] result , ['array', 'number'] Swag.addHelper 'befor...
result , ['array', 'number'] Swag.addHelper 'join', (array, separator) -> array = Utils.result array separator = Utils.result separator unless Utils.isUndefined separator array.join if Utils.isUndefined(separator) then ' ' else separator , 'array' Swag.addHelper 'sort', (array, field) -> array = Utils...
CoffeeScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
1dab7399e1ac6127c7b2cde8d518f46c85838801
675
https://github.com/elving/swag/blob/1dab7399e1ac6127c7b2cde8d518f46c85838801/src/swag.collections.coffee
45
86
elving/swag:src/swag.collections.coffee:3:raw_corpus
raw_corpus
if Utils.isUndefined field options = field array = array.sort() result += options.fn(item) for item in array else field = Utils.result field array = array.sort (a, b) -> a[field] > b[field] result += options.fn(array[item]) for item of array result , 'array' Swa...
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
1dab7399e1ac6127c7b2cde8d518f46c85838801
675
https://github.com/elving/swag/blob/1dab7399e1ac6127c7b2cde8d518f46c85838801/src/swag.collections.coffee
88
129
elving/swag:src/swag.collections.coffee:3:completion
completion
if Utils.isUndefined field options = field array = array.sort() result += options.fn(item) for item in array else field = Utils.result field array = array.sort (a, b) -> a[field] > b[field] result += options.fn(array[item]) for item of array result , 'array' Swa...
, ['array', 'number'] Swag.addHelper 'empty', (array, options) -> array = Utils.result array if not array or array.length <= 0 then options.fn this else options.inverse this , 'safe:array' Swag.addHelper 'any', (array, options) -> array = Utils.result array if array and array.length > 0 then options.f...
CoffeeScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
1dab7399e1ac6127c7b2cde8d518f46c85838801
675
https://github.com/elving/swag/blob/1dab7399e1ac6127c7b2cde8d518f46c85838801/src/swag.collections.coffee
88
129
elving/swag:src/swag.collections.coffee:4:raw_corpus
raw_corpus
for value, index in array result += options.fn item: value, index: index result , 'array' Swag.addHelper 'eachProperty', (obj, options) -> obj = Utils.result obj result = '' for key, value of obj result += options.fn key: key, value: value result , 'object'
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
1dab7399e1ac6127c7b2cde8d518f46c85838801
675
https://github.com/elving/swag/blob/1dab7399e1ac6127c7b2cde8d518f46c85838801/src/swag.collections.coffee
131
145
elving/swag:src/swag.collections.coffee:4:completion
completion
for value, index in array result += options.fn item: value, index: index result , 'array' Swag.addHelper 'eachProperty', (obj, options) ->
obj = Utils.result obj result = '' for key, value of obj result += options.fn key: key, value: value result , 'object'
CoffeeScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
1dab7399e1ac6127c7b2cde8d518f46c85838801
675
https://github.com/elving/swag/blob/1dab7399e1ac6127c7b2cde8d518f46c85838801/src/swag.collections.coffee
131
145
elving/swag:src/swag.collections.coffee:1:raw_corpus
raw_corpus
Swag.addHelper 'first', (array, count) -> unless Utils.isUndefined array array = Utils.result array count = parseFloat Utils.result count unless Utils.isUndefined count if Utils.isUndefined(count) then array[0] else array.slice 0, count else Utils.err '{{first}} takes at least on...
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
f3be26ec359ce14eb0a45596c591b7a777e4719c
675
https://github.com/elving/swag/blob/f3be26ec359ce14eb0a45596c591b7a777e4719c/src/swag.collections.coffee
1
45
elving/swag:src/swag.collections.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript Swag.addHelper 'first', (array, count) -> unless Utils.isUndefined array array = Utils.result array count = parseFloat Utils.result count unless Utils.isUndefined count if Utils.isUndefined(count) then array[0] else array.slice 0, coun...
Swag.addHelper('first', function(array, count) { if (!Utils.isUndefined(array)) { array = Utils.result(array); if (!Utils.isUndefined(count)) { count = parseFloat(Utils.result(count)); } if (Utils.isUndefined(count)) { return array[0]; } else { return array.slice(0, count); }...
CoffeeScript
JavaScript
elving/swag
src/swag.collections.coffee
MIT
f3be26ec359ce14eb0a45596c591b7a777e4719c
675
https://github.com/elving/swag/blob/f3be26ec359ce14eb0a45596c591b7a777e4719c/src/swag.collections.coffee
1
45
elving/swag:src/swag.collections.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript Swag.addHelper('first', function(array, count) { if (!Utils.isUndefined(array)) { array = Utils.result(array); if (!Utils.isUndefined(count)) { count = parseFloat(Utils.result(count)); } if (Utils.isUndefined(count)) { return array[0];...
Swag.addHelper 'first', (array, count) -> unless Utils.isUndefined array array = Utils.result array count = parseFloat Utils.result count unless Utils.isUndefined count if Utils.isUndefined(count) then array[0] else array.slice 0, count else Utils.err '{{first}} takes at least on...
JavaScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
f3be26ec359ce14eb0a45596c591b7a777e4719c
675
https://github.com/elving/swag/blob/f3be26ec359ce14eb0a45596c591b7a777e4719c/src/swag.collections.coffee
1
45
elving/swag:src/swag.collections.coffee:1:completion
completion
Swag.addHelper 'first', (array, count) -> unless Utils.isUndefined array array = Utils.result array count = parseFloat Utils.result count unless Utils.isUndefined count if Utils.isUndefined(count) then array[0] else array.slice 0, count else Utils.err '{{first}} takes at least on...
Swag.addHelper 'last', (array, count) -> unless Utils.isUndefined array array = Utils.result array count = parseFloat Utils.result count unless Utils.isUndefined count if Utils.isUndefined(count) then array[array.length - 1] else array.slice -count else Utils.err '{{last}} takes ...
CoffeeScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
f3be26ec359ce14eb0a45596c591b7a777e4719c
675
https://github.com/elving/swag/blob/f3be26ec359ce14eb0a45596c591b7a777e4719c/src/swag.collections.coffee
1
45
elving/swag:src/swag.collections.coffee:2:raw_corpus
raw_corpus
Swag.addHelper 'after', (array, count) -> unless (Utils.isUndefined array) and (Utils.isUndefined count) array = Utils.result array count = parseFloat Utils.result count unless Utils.isUndefined count array.slice count else Utils.err '{{after}} takes two arguments (array, number)...
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
f3be26ec359ce14eb0a45596c591b7a777e4719c
675
https://github.com/elving/swag/blob/f3be26ec359ce14eb0a45596c591b7a777e4719c/src/swag.collections.coffee
47
91
elving/swag:src/swag.collections.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript Swag.addHelper 'after', (array, count) -> unless (Utils.isUndefined array) and (Utils.isUndefined count) array = Utils.result array count = parseFloat Utils.result count unless Utils.isUndefined count array.slice count else ...
Swag.addHelper('after', function(array, count) { if (!((Utils.isUndefined(array)) && (Utils.isUndefined(count)))) { array = Utils.result(array); if (!Utils.isUndefined(count)) { count = parseFloat(Utils.result(count)); } return array.slice(count); } else { return Utils.err('{{after}} takes...
CoffeeScript
JavaScript
elving/swag
src/swag.collections.coffee
MIT
f3be26ec359ce14eb0a45596c591b7a777e4719c
675
https://github.com/elving/swag/blob/f3be26ec359ce14eb0a45596c591b7a777e4719c/src/swag.collections.coffee
47
91
elving/swag:src/swag.collections.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript Swag.addHelper('after', function(array, count) { if (!((Utils.isUndefined(array)) && (Utils.isUndefined(count)))) { array = Utils.result(array); if (!Utils.isUndefined(count)) { count = parseFloat(Utils.result(count)); } return array.slice(c...
Swag.addHelper 'after', (array, count) -> unless (Utils.isUndefined array) and (Utils.isUndefined count) array = Utils.result array count = parseFloat Utils.result count unless Utils.isUndefined count array.slice count else Utils.err '{{after}} takes two arguments (array, number)...
JavaScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
f3be26ec359ce14eb0a45596c591b7a777e4719c
675
https://github.com/elving/swag/blob/f3be26ec359ce14eb0a45596c591b7a777e4719c/src/swag.collections.coffee
47
91
elving/swag:src/swag.collections.coffee:2:completion
completion
Swag.addHelper 'after', (array, count) -> unless (Utils.isUndefined array) and (Utils.isUndefined count) array = Utils.result array count = parseFloat Utils.result count unless Utils.isUndefined count array.slice count else Utils.err '{{after}} takes two arguments (array, number)...
count = parseFloat Utils.result count unless Utils.isUndefined count array.slice 0, -count else Utils.err '{{before}} takes two arguments (array, number).' Swag.addHelper 'withBefore', (array, count, options) -> unless (Utils.isUndefined array) and (Utils.isUndefined count) array = Util...
CoffeeScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
f3be26ec359ce14eb0a45596c591b7a777e4719c
675
https://github.com/elving/swag/blob/f3be26ec359ce14eb0a45596c591b7a777e4719c/src/swag.collections.coffee
47
91
elving/swag:src/swag.collections.coffee:3:raw_corpus
raw_corpus
Swag.addHelper 'sort', (array, field) -> unless Utils.isUndefined array array = Utils.result array if Utils.isUndefined field array.sort() else field = Utils.result field array.sort (a, b) -> a[field] > b[field] else Utils.err '{{sort}} takes a...
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
f3be26ec359ce14eb0a45596c591b7a777e4719c
675
https://github.com/elving/swag/blob/f3be26ec359ce14eb0a45596c591b7a777e4719c/src/swag.collections.coffee
93
135
elving/swag:src/swag.collections.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript Swag.addHelper 'sort', (array, field) -> unless Utils.isUndefined array array = Utils.result array if Utils.isUndefined field array.sort() else field = Utils.result field array.sort (a, b) -> a[field...
Swag.addHelper('sort', function(array, field) { if (!Utils.isUndefined(array)) { array = Utils.result(array); if (Utils.isUndefined(field)) { return array.sort(); } else { field = Utils.result(field); return array.sort(function(a, b) { return a[field] > b[field]; }); } ...
CoffeeScript
JavaScript
elving/swag
src/swag.collections.coffee
MIT
f3be26ec359ce14eb0a45596c591b7a777e4719c
675
https://github.com/elving/swag/blob/f3be26ec359ce14eb0a45596c591b7a777e4719c/src/swag.collections.coffee
93
135
elving/swag:src/swag.collections.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript Swag.addHelper('sort', function(array, field) { if (!Utils.isUndefined(array)) { array = Utils.result(array); if (Utils.isUndefined(field)) { return array.sort(); } else { field = Utils.result(field); return array.sort(function(a, b)...
Swag.addHelper 'sort', (array, field) -> unless Utils.isUndefined array array = Utils.result array if Utils.isUndefined field array.sort() else field = Utils.result field array.sort (a, b) -> a[field] > b[field] else Utils.err '{{sort}} takes a...
JavaScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
f3be26ec359ce14eb0a45596c591b7a777e4719c
675
https://github.com/elving/swag/blob/f3be26ec359ce14eb0a45596c591b7a777e4719c/src/swag.collections.coffee
93
135
elving/swag:src/swag.collections.coffee:3:completion
completion
Swag.addHelper 'sort', (array, field) -> unless Utils.isUndefined array array = Utils.result array if Utils.isUndefined field array.sort() else field = Utils.result field array.sort (a, b) -> a[field] > b[field] else Utils.err '{{sort}} takes a...
field = Utils.result field array = array.sort (a, b) -> a[field] > b[field] result += options.fn(array[item]) for item of array result else Utils.err '{{withSort}} takes at least one argument (array).' Swag.addHelper 'length', (array) -> unless Utils.isUndefined array ...
CoffeeScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
f3be26ec359ce14eb0a45596c591b7a777e4719c
675
https://github.com/elving/swag/blob/f3be26ec359ce14eb0a45596c591b7a777e4719c/src/swag.collections.coffee
93
135
elving/swag:src/swag.collections.coffee:4:raw_corpus
raw_corpus
Swag.addHelper 'empty', (array, options) -> unless Utils.isHandlebarsSpecific array array = Utils.result array if not array or array.length <= 0 then options.fn this else options.inverse this else Utils.err '{{empty}} takes one argument (array).' Swag.addHelper 'any', (array, options) -...
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
f3be26ec359ce14eb0a45596c591b7a777e4719c
675
https://github.com/elving/swag/blob/f3be26ec359ce14eb0a45596c591b7a777e4719c/src/swag.collections.coffee
137
177
elving/swag:src/swag.collections.coffee:4:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript Swag.addHelper 'empty', (array, options) -> unless Utils.isHandlebarsSpecific array array = Utils.result array if not array or array.length <= 0 then options.fn this else options.inverse this else Utils.err '{{empty}} takes one arg...
var indexOf = [].indexOf; Swag.addHelper('empty', function(array, options) { if (!Utils.isHandlebarsSpecific(array)) { array = Utils.result(array); if (!array || array.length <= 0) { return options.fn(this); } else { return options.inverse(this); } } else { return Utils.err('{{empty...
CoffeeScript
JavaScript
elving/swag
src/swag.collections.coffee
MIT
f3be26ec359ce14eb0a45596c591b7a777e4719c
675
https://github.com/elving/swag/blob/f3be26ec359ce14eb0a45596c591b7a777e4719c/src/swag.collections.coffee
137
177
elving/swag:src/swag.collections.coffee:4:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var indexOf = [].indexOf; Swag.addHelper('empty', function(array, options) { if (!Utils.isHandlebarsSpecific(array)) { array = Utils.result(array); if (!array || array.length <= 0) { return options.fn(this); } else { return options.invers...
Swag.addHelper 'empty', (array, options) -> unless Utils.isHandlebarsSpecific array array = Utils.result array if not array or array.length <= 0 then options.fn this else options.inverse this else Utils.err '{{empty}} takes one argument (array).' Swag.addHelper 'any', (array, options) -...
JavaScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
f3be26ec359ce14eb0a45596c591b7a777e4719c
675
https://github.com/elving/swag/blob/f3be26ec359ce14eb0a45596c591b7a777e4719c/src/swag.collections.coffee
137
177
elving/swag:src/swag.collections.coffee:4:completion
completion
Swag.addHelper 'empty', (array, options) -> unless Utils.isHandlebarsSpecific array array = Utils.result array if not array or array.length <= 0 then options.fn this else options.inverse this else Utils.err '{{empty}} takes one argument (array).' Swag.addHelper 'any', (array, options) -...
Utils.err '{{inArray}} takes two arguments (array, string|number).' Swag.addHelper 'eachIndex', (array, options) -> unless Utils.isUndefined array array = Utils.result array result = '' for value, index in array result += options.fn item: value, index: index result ...
CoffeeScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
f3be26ec359ce14eb0a45596c591b7a777e4719c
675
https://github.com/elving/swag/blob/f3be26ec359ce14eb0a45596c591b7a777e4719c/src/swag.collections.coffee
137
177
elving/swag:src/swag.collections.coffee:4:raw_corpus
raw_corpus
Swag.addHelper 'empty', (array, options) -> unless Utils.isUndefined array array = Utils.result array if array.length <= 0 then options.fn this else options.inverse this else Utils.err '{{empty}} takes one argument (array).' Swag.addHelper 'any', (array, options) -> unless Utils.isU...
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
3a5249a04c2d7c27acb8834dc3e31ae0f56ccfd1
675
https://github.com/elving/swag/blob/3a5249a04c2d7c27acb8834dc3e31ae0f56ccfd1/src/swag.collections.coffee
137
177
elving/swag:src/swag.collections.coffee:4:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript Swag.addHelper 'empty', (array, options) -> unless Utils.isUndefined array array = Utils.result array if array.length <= 0 then options.fn this else options.inverse this else Utils.err '{{empty}} takes one argument (array).' Swag....
var indexOf = [].indexOf; Swag.addHelper('empty', function(array, options) { if (!Utils.isUndefined(array)) { array = Utils.result(array); if (array.length <= 0) { return options.fn(this); } else { return options.inverse(this); } } else { return Utils.err('{{empty}} takes one argume...
CoffeeScript
JavaScript
elving/swag
src/swag.collections.coffee
MIT
3a5249a04c2d7c27acb8834dc3e31ae0f56ccfd1
675
https://github.com/elving/swag/blob/3a5249a04c2d7c27acb8834dc3e31ae0f56ccfd1/src/swag.collections.coffee
137
177
elving/swag:src/swag.collections.coffee:4:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var indexOf = [].indexOf; Swag.addHelper('empty', function(array, options) { if (!Utils.isUndefined(array)) { array = Utils.result(array); if (array.length <= 0) { return options.fn(this); } else { return options.inverse(this); } } ...
Swag.addHelper 'empty', (array, options) -> unless Utils.isUndefined array array = Utils.result array if array.length <= 0 then options.fn this else options.inverse this else Utils.err '{{empty}} takes one argument (array).' Swag.addHelper 'any', (array, options) -> unless Utils.isU...
JavaScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
3a5249a04c2d7c27acb8834dc3e31ae0f56ccfd1
675
https://github.com/elving/swag/blob/3a5249a04c2d7c27acb8834dc3e31ae0f56ccfd1/src/swag.collections.coffee
137
177
elving/swag:src/swag.collections.coffee:4:completion
completion
Swag.addHelper 'empty', (array, options) -> unless Utils.isUndefined array array = Utils.result array if array.length <= 0 then options.fn this else options.inverse this else Utils.err '{{empty}} takes one argument (array).' Swag.addHelper 'any', (array, options) -> unless Utils.isU...
Utils.err '{{inArray}} takes two arguments (array, string|number).' Swag.addHelper 'eachIndex', (array, options) -> unless Utils.isUndefined array array = Utils.result array result = '' for value, index in array result += options.fn item: value, index: index result ...
CoffeeScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
3a5249a04c2d7c27acb8834dc3e31ae0f56ccfd1
675
https://github.com/elving/swag/blob/3a5249a04c2d7c27acb8834dc3e31ae0f56ccfd1/src/swag.collections.coffee
137
177
elving/swag:src/swag.collections.coffee:1:raw_corpus
raw_corpus
Swag.addHelper 'first', (array, count) -> if Utils.isUndefined(count) then array[0] else array.slice 0, count Swag.addHelper 'withFirst', (array, count, options) -> if Utils.isUndefined count options = count options.fn array[0] else array = array.slice 0, count result = '' ...
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
f17d2de491f4ec174ae77b59461eb8c9f823302c
675
https://github.com/elving/swag/blob/f17d2de491f4ec174ae77b59461eb8c9f823302c/src/swag.collections.coffee
1
43
elving/swag:src/swag.collections.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript Swag.addHelper 'first', (array, count) -> if Utils.isUndefined(count) then array[0] else array.slice 0, count Swag.addHelper 'withFirst', (array, count, options) -> if Utils.isUndefined count options = count options.fn array[0] else ...
Swag.addHelper('first', function(array, count) { if (Utils.isUndefined(count)) { return array[0]; } else { return array.slice(0, count); } }); Swag.addHelper('withFirst', function(array, count, options) { var item, result; if (Utils.isUndefined(count)) { options = count; return options.fn(arr...
CoffeeScript
JavaScript
elving/swag
src/swag.collections.coffee
MIT
f17d2de491f4ec174ae77b59461eb8c9f823302c
675
https://github.com/elving/swag/blob/f17d2de491f4ec174ae77b59461eb8c9f823302c/src/swag.collections.coffee
1
43
elving/swag:src/swag.collections.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript Swag.addHelper('first', function(array, count) { if (Utils.isUndefined(count)) { return array[0]; } else { return array.slice(0, count); } }); Swag.addHelper('withFirst', function(array, count, options) { var item, result; if (Utils.isUndefined(c...
Swag.addHelper 'first', (array, count) -> if Utils.isUndefined(count) then array[0] else array.slice 0, count Swag.addHelper 'withFirst', (array, count, options) -> if Utils.isUndefined count options = count options.fn array[0] else array = array.slice 0, count result = '' ...
JavaScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
f17d2de491f4ec174ae77b59461eb8c9f823302c
675
https://github.com/elving/swag/blob/f17d2de491f4ec174ae77b59461eb8c9f823302c/src/swag.collections.coffee
1
43
elving/swag:src/swag.collections.coffee:1:completion
completion
Swag.addHelper 'first', (array, count) -> if Utils.isUndefined(count) then array[0] else array.slice 0, count Swag.addHelper 'withFirst', (array, count, options) -> if Utils.isUndefined count options = count options.fn array[0] else array = array.slice 0, count result = '' ...
array = array.slice -count result = '' for item of array then result += options.fn array[item] result Swag.addHelper 'after', (array, count) -> array.slice count Swag.addHelper 'withAfter', (array, count, options) -> array = array.slice count result = '' for item of array then ...
CoffeeScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
f17d2de491f4ec174ae77b59461eb8c9f823302c
675
https://github.com/elving/swag/blob/f17d2de491f4ec174ae77b59461eb8c9f823302c/src/swag.collections.coffee
1
43
elving/swag:src/swag.collections.coffee:2:raw_corpus
raw_corpus
Swag.addHelper 'join', (array, separator) -> array.join if Utils.isUndefined(separator) then ' ' else separator Swag.addHelper 'sort', (array, field) -> if Utils.isUndefined field array.sort() else array.sort (a, b) -> a[field] > b[field] Swag.addHelper 'withSort', (array, field, options) ...
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
f17d2de491f4ec174ae77b59461eb8c9f823302c
675
https://github.com/elving/swag/blob/f17d2de491f4ec174ae77b59461eb8c9f823302c/src/swag.collections.coffee
45
83
elving/swag:src/swag.collections.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript Swag.addHelper 'join', (array, separator) -> array.join if Utils.isUndefined(separator) then ' ' else separator Swag.addHelper 'sort', (array, field) -> if Utils.isUndefined field array.sort() else array.sort (a, b) -> a[field] > b[fi...
var indexOf = [].indexOf; Swag.addHelper('join', function(array, separator) { return array.join(Utils.isUndefined(separator) ? ' ' : separator); }); Swag.addHelper('sort', function(array, field) { if (Utils.isUndefined(field)) { return array.sort(); } else { return array.sort(function(a, b) { retu...
CoffeeScript
JavaScript
elving/swag
src/swag.collections.coffee
MIT
f17d2de491f4ec174ae77b59461eb8c9f823302c
675
https://github.com/elving/swag/blob/f17d2de491f4ec174ae77b59461eb8c9f823302c/src/swag.collections.coffee
45
83
elving/swag:src/swag.collections.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var indexOf = [].indexOf; Swag.addHelper('join', function(array, separator) { return array.join(Utils.isUndefined(separator) ? ' ' : separator); }); Swag.addHelper('sort', function(array, field) { if (Utils.isUndefined(field)) { return array.sort(); } e...
Swag.addHelper 'join', (array, separator) -> array.join if Utils.isUndefined(separator) then ' ' else separator Swag.addHelper 'sort', (array, field) -> if Utils.isUndefined field array.sort() else array.sort (a, b) -> a[field] > b[field] Swag.addHelper 'withSort', (array, field, options) ...
JavaScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
f17d2de491f4ec174ae77b59461eb8c9f823302c
675
https://github.com/elving/swag/blob/f17d2de491f4ec174ae77b59461eb8c9f823302c/src/swag.collections.coffee
45
83
elving/swag:src/swag.collections.coffee:2:completion
completion
Swag.addHelper 'join', (array, separator) -> array.join if Utils.isUndefined(separator) then ' ' else separator Swag.addHelper 'sort', (array, field) -> if Utils.isUndefined field array.sort() else array.sort (a, b) -> a[field] > b[field] Swag.addHelper 'withSort', (array, field, options) ...
result Swag.addHelper 'length', (array) -> array.length Swag.addHelper 'lengthEqual', (array, length, options) -> if array.length is length then options.fn(@) else options.inverse(@) Swag.addHelper 'empty', (array, options) -> if array.length <= 0 then options.fn(@) else options.inverse(@) Swag.addHelpe...
CoffeeScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
f17d2de491f4ec174ae77b59461eb8c9f823302c
675
https://github.com/elving/swag/blob/f17d2de491f4ec174ae77b59461eb8c9f823302c/src/swag.collections.coffee
45
83
elving/swag:src/swag.collections.coffee:3:raw_corpus
raw_corpus
for value, index in array result += options.fn item: value, index: index result Swag.addHelper 'eachProperty', (obj, options) -> result = '' for key, value of obj result += options.fn key: key, value: value result
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
f17d2de491f4ec174ae77b59461eb8c9f823302c
675
https://github.com/elving/swag/blob/f17d2de491f4ec174ae77b59461eb8c9f823302c/src/swag.collections.coffee
85
96
elving/swag:src/swag.collections.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript for value, index in array result += options.fn item: value, index: index result Swag.addHelper 'eachProperty', (obj, options) -> result = '' for key, value of obj result += options.fn key: key, value: value result ```
var i, index, len, value; for (index = i = 0, len = array.length; i < len; index = ++i) { value = array[index]; result += options.fn({ item: value, index: index }); } result; Swag.addHelper('eachProperty', function(obj, options) { var key, result; result = ''; for (key in obj) { value = obj[k...
CoffeeScript
JavaScript
elving/swag
src/swag.collections.coffee
MIT
f17d2de491f4ec174ae77b59461eb8c9f823302c
675
https://github.com/elving/swag/blob/f17d2de491f4ec174ae77b59461eb8c9f823302c/src/swag.collections.coffee
85
96
elving/swag:src/swag.collections.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var i, index, len, value; for (index = i = 0, len = array.length; i < len; index = ++i) { value = array[index]; result += options.fn({ item: value, index: index }); } result; Swag.addHelper('eachProperty', function(obj, options) { var key, result...
for value, index in array result += options.fn item: value, index: index result Swag.addHelper 'eachProperty', (obj, options) -> result = '' for key, value of obj result += options.fn key: key, value: value result
JavaScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
f17d2de491f4ec174ae77b59461eb8c9f823302c
675
https://github.com/elving/swag/blob/f17d2de491f4ec174ae77b59461eb8c9f823302c/src/swag.collections.coffee
85
96
elving/swag:src/swag.collections.coffee:3:completion
completion
for value, index in array result += options.fn item: value, index: index result Swag.addHelper 'eachProperty', (obj, options) ->
result = '' for key, value of obj result += options.fn key: key, value: value result
CoffeeScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
f17d2de491f4ec174ae77b59461eb8c9f823302c
675
https://github.com/elving/swag/blob/f17d2de491f4ec174ae77b59461eb8c9f823302c/src/swag.collections.coffee
85
96
elving/swag:src/swag.collections.coffee:1:raw_corpus
raw_corpus
Swag.registerHelper 'first', (array, count) -> if Utils.isUndefined(count) then array[0] else array.slice 0, count Swag.registerHelper 'withFirst', (array, count, options) -> if Utils.isUndefined count options = count options.fn array[0] else array = array.slice 0, count res...
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
65fa361b1dbaa9c28ca8dbf5cad24d741f96ff17
675
https://github.com/elving/swag/blob/65fa361b1dbaa9c28ca8dbf5cad24d741f96ff17/src/swag.collections.coffee
1
43
elving/swag:src/swag.collections.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript Swag.registerHelper 'first', (array, count) -> if Utils.isUndefined(count) then array[0] else array.slice 0, count Swag.registerHelper 'withFirst', (array, count, options) -> if Utils.isUndefined count options = count options.fn array[0] ...
Swag.registerHelper('first', function(array, count) { if (Utils.isUndefined(count)) { return array[0]; } else { return array.slice(0, count); } }); Swag.registerHelper('withFirst', function(array, count, options) { var item, result; if (Utils.isUndefined(count)) { options = count; return opti...
CoffeeScript
JavaScript
elving/swag
src/swag.collections.coffee
MIT
65fa361b1dbaa9c28ca8dbf5cad24d741f96ff17
675
https://github.com/elving/swag/blob/65fa361b1dbaa9c28ca8dbf5cad24d741f96ff17/src/swag.collections.coffee
1
43
elving/swag:src/swag.collections.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript Swag.registerHelper('first', function(array, count) { if (Utils.isUndefined(count)) { return array[0]; } else { return array.slice(0, count); } }); Swag.registerHelper('withFirst', function(array, count, options) { var item, result; if (Utils.isU...
Swag.registerHelper 'first', (array, count) -> if Utils.isUndefined(count) then array[0] else array.slice 0, count Swag.registerHelper 'withFirst', (array, count, options) -> if Utils.isUndefined count options = count options.fn array[0] else array = array.slice 0, count res...
JavaScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
65fa361b1dbaa9c28ca8dbf5cad24d741f96ff17
675
https://github.com/elving/swag/blob/65fa361b1dbaa9c28ca8dbf5cad24d741f96ff17/src/swag.collections.coffee
1
43
elving/swag:src/swag.collections.coffee:1:completion
completion
Swag.registerHelper 'first', (array, count) -> if Utils.isUndefined(count) then array[0] else array.slice 0, count Swag.registerHelper 'withFirst', (array, count, options) -> if Utils.isUndefined count options = count options.fn array[0] else array = array.slice 0, count res...
array = array.slice -count result = '' for item of array then result += options.fn array[item] result Swag.registerHelper 'after', (array, count) -> array.slice count Swag.registerHelper 'withAfter', (array, count, options) -> array = array.slice count result = '' for item of a...
CoffeeScript
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
65fa361b1dbaa9c28ca8dbf5cad24d741f96ff17
675
https://github.com/elving/swag/blob/65fa361b1dbaa9c28ca8dbf5cad24d741f96ff17/src/swag.collections.coffee
1
43
elving/swag:src/swag.collections.coffee:2:raw_corpus
raw_corpus
Swag.registerHelper 'join', (array, separator) -> array.join if Utils.isUndefined(separator) then ' ' else separator Swag.registerHelper 'sort', (array, field) -> if Utils.isUndefined field array.sort() else array.sort (a, b) -> a[field] > b[field] Swag.registerHelper 'withSort', (array, f...
CoffeeScript
elving/swag
src/swag.collections.coffee
MIT
65fa361b1dbaa9c28ca8dbf5cad24d741f96ff17
675
https://github.com/elving/swag/blob/65fa361b1dbaa9c28ca8dbf5cad24d741f96ff17/src/swag.collections.coffee
45
83