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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ichord/At.js:spec/javascripts/atwho.spec.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "filter data after data_refactor", ->
names = callbacks.data_refactor.call(controller, fixtures["names"])
names = callbacks.filter.call(controller, "jo", fixtures["names"])
expect(names).toContain("Joshua")
it "request data from remote b... | it("filter data after data_refactor", function() {
var names;
names = callbacks.data_refactor.call(controller, fixtures["names"]);
names = callbacks.filter.call(controller, "jo", fixtures["names"]);
return expect(names).toContain("Joshua");
});
it("request data from remote by ajax", function() {
var names, r... | CoffeeScript | JavaScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | 322f24a56f14dd9ee372612363745bcd52c5e774 | 5,250 | https://github.com/ichord/At.js/blob/322f24a56f14dd9ee372612363745bcd52c5e774/spec/javascripts/atwho.spec.coffee | 44 | 83 |
ichord/At.js:spec/javascripts/atwho.spec.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("filter data after data_refactor", function() {
var names;
names = callbacks.data_refactor.call(controller, fixtures["names"]);
names = callbacks.filter.call(controller, "jo", fixtures["names"]);
return expect(names).toContain("Joshua");
});
it("request... | it "filter data after data_refactor", ->
names = callbacks.data_refactor.call(controller, fixtures["names"])
names = callbacks.filter.call(controller, "jo", fixtures["names"])
expect(names).toContain("Joshua")
it "request data from remote by ajax", ->
jasmine.Ajax.useMock()
render_ca... | JavaScript | CoffeeScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | 322f24a56f14dd9ee372612363745bcd52c5e774 | 5,250 | https://github.com/ichord/At.js/blob/322f24a56f14dd9ee372612363745bcd52c5e774/spec/javascripts/atwho.spec.coffee | 44 | 83 |
ichord/At.js:spec/javascripts/atwho.spec.coffee:2:completion | completion | it "filter data after data_refactor", ->
names = callbacks.data_refactor.call(controller, fixtures["names"])
names = callbacks.filter.call(controller, "jo", fixtures["names"])
expect(names).toContain("Joshua")
it "request data from remote by ajax", ->
jasmine.Ajax.useMock()
render_ca... | expect(names).toContain({"name":'Jacob'})
it "can sort the data", ->
names = callbacks.data_refactor.call(controller, fixtures["names"])
names = callbacks.sorter.call(controller, "e", names, "name")
expect(names).toContain({ name : 'Ethan', order : 0 })
it "can eval temple", ->
map = {... | CoffeeScript | CoffeeScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | 322f24a56f14dd9ee372612363745bcd52c5e774 | 5,250 | https://github.com/ichord/At.js/blob/322f24a56f14dd9ee372612363745bcd52c5e774/spec/javascripts/atwho.spec.coffee | 44 | 83 |
ichord/At.js:spec/javascripts/atwho.spec.coffee:3:raw_corpus | raw_corpus | it "can insert the text which be choosed", ->
spyOn(callbacks, "selector").andCallThrough()
trigger_atwho()
expect(callbacks.selector).toHaveBeenCalled()
# FIXME: it work but, the $inputor fixture have be reset back.
# expect(controller.$inputor).toHaveText(/Jacob/)
describe "settings"... | CoffeeScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | 322f24a56f14dd9ee372612363745bcd52c5e774 | 5,250 | https://github.com/ichord/At.js/blob/322f24a56f14dd9ee372612363745bcd52c5e774/spec/javascripts/atwho.spec.coffee | 85 | 124 | ||
ichord/At.js:spec/javascripts/atwho.spec.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "can insert the text which be choosed", ->
spyOn(callbacks, "selector").andCallThrough()
trigger_atwho()
expect(callbacks.selector).toHaveBeenCalled()
# FIXME: it work but, the $inputor fixture have be reset back.
# expect(contro... | it("can insert the text which be choosed", function() {
spyOn(callbacks, "selector").andCallThrough();
trigger_atwho();
return expect(callbacks.selector).toHaveBeenCalled();
});
// FIXME: it work but, the $inputor fixture have be reset back.
// expect(controller.$inputor).toHaveText(/Jacob/)
describe("settings",... | CoffeeScript | JavaScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | 322f24a56f14dd9ee372612363745bcd52c5e774 | 5,250 | https://github.com/ichord/At.js/blob/322f24a56f14dd9ee372612363745bcd52c5e774/spec/javascripts/atwho.spec.coffee | 85 | 124 |
ichord/At.js:spec/javascripts/atwho.spec.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("can insert the text which be choosed", function() {
spyOn(callbacks, "selector").andCallThrough();
trigger_atwho();
return expect(callbacks.selector).toHaveBeenCalled();
});
// FIXME: it work but, the $inputor fixture have be reset back.
// expect(contro... | it "can insert the text which be choosed", ->
spyOn(callbacks, "selector").andCallThrough()
trigger_atwho()
expect(callbacks.selector).toHaveBeenCalled()
# FIXME: it work but, the $inputor fixture have be reset back.
# expect(controller.$inputor).toHaveText(/Jacob/)
describe "settings"... | JavaScript | CoffeeScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | 322f24a56f14dd9ee372612363745bcd52c5e774 | 5,250 | https://github.com/ichord/At.js/blob/322f24a56f14dd9ee372612363745bcd52c5e774/spec/javascripts/atwho.spec.coffee | 85 | 124 |
ichord/At.js:spec/javascripts/atwho.spec.coffee:3:completion | completion | it "can insert the text which be choosed", ->
spyOn(callbacks, "selector").andCallThrough()
trigger_atwho()
expect(callbacks.selector).toHaveBeenCalled()
# FIXME: it work but, the $inputor fixture have be reset back.
# expect(controller.$inputor).toHaveText(/Jacob/)
describe "settings"... | $inputor.atWho "@", limit: 3
expect(controller.settings["@"].limit).toBe(3)
it "update callbacks", ->
filter = jasmine.createSpy("filter")
spyOn(callbacks, "filter")
$inputor.atWho "@",
callbacks:
filter: filter
trigger_atwho()
expect(filter).toHaveBeenCalled(... | CoffeeScript | CoffeeScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | 322f24a56f14dd9ee372612363745bcd52c5e774 | 5,250 | https://github.com/ichord/At.js/blob/322f24a56f14dd9ee372612363745bcd52c5e774/spec/javascripts/atwho.spec.coffee | 85 | 124 |
ichord/At.js:spec/javascripts/atwho.spec.coffee:4:raw_corpus | raw_corpus | mostRecentAjaxRequest().response status: 200
expect(callbacks.remote_filter).toHaveBeenCalled()
describe "events", ->
it "trigger esc", ->
it "trigger up", ->
it "trigger down", ->
it "trigger tab or enter", -> | CoffeeScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | 322f24a56f14dd9ee372612363745bcd52c5e774 | 5,250 | https://github.com/ichord/At.js/blob/322f24a56f14dd9ee372612363745bcd52c5e774/spec/javascripts/atwho.spec.coffee | 126 | 138 | ||
ichord/At.js:spec/javascripts/atwho.spec.coffee:4:completion | completion | mostRecentAjaxRequest().response status: 200
expect(callbacks.remote_filter).toHaveBeenCalled()
describe "events", -> | it "trigger esc", ->
it "trigger up", ->
it "trigger down", ->
it "trigger tab or enter", -> | CoffeeScript | CoffeeScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | 322f24a56f14dd9ee372612363745bcd52c5e774 | 5,250 | https://github.com/ichord/At.js/blob/322f24a56f14dd9ee372612363745bcd52c5e774/spec/javascripts/atwho.spec.coffee | 126 | 138 |
ichord/At.js:spec/javascripts/atwho.spec.coffee:1:raw_corpus | raw_corpus | describe "jquery.atWho", ->
$inputor = null
fixtures = null
beforeEach ->
loadFixtures("inputors.html")
fixtures = loadJSONFixtures("data.json")["data.json"]
$inputor = $("#inputor").atWho "@",
data: fixtures["names"]
it "should be defined", ->
expect($.fn.atWho).toBeDefined()
descri... | CoffeeScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | 8e55c3f9b17939e0c9afe83ca9cf47a4bbaaa90e | 5,250 | https://github.com/ichord/At.js/blob/8e55c3f9b17939e0c9afe83ca9cf47a4bbaaa90e/spec/javascripts/atwho.spec.coffee | 1 | 41 | ||
ichord/At.js:spec/javascripts/atwho.spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe "jquery.atWho", ->
$inputor = null
fixtures = null
beforeEach ->
loadFixtures("inputors.html")
fixtures = loadJSONFixtures("data.json")["data.json"]
$inputor = $("#inputor").atWho "@",
data: fixtures["names"]
it "should be de... | describe("jquery.atWho", function() {
var $inputor, fixtures;
$inputor = null;
fixtures = null;
beforeEach(function() {
loadFixtures("inputors.html");
fixtures = loadJSONFixtures("data.json")["data.json"];
return $inputor = $("#inputor").atWho("@", {
data: fixtures["names"]
});
});
it(... | CoffeeScript | JavaScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | 8e55c3f9b17939e0c9afe83ca9cf47a4bbaaa90e | 5,250 | https://github.com/ichord/At.js/blob/8e55c3f9b17939e0c9afe83ca9cf47a4bbaaa90e/spec/javascripts/atwho.spec.coffee | 1 | 41 |
ichord/At.js:spec/javascripts/atwho.spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe("jquery.atWho", function() {
var $inputor, fixtures;
$inputor = null;
fixtures = null;
beforeEach(function() {
loadFixtures("inputors.html");
fixtures = loadJSONFixtures("data.json")["data.json"];
return $inputor = $("#inputor").atWho("... | describe "jquery.atWho", ->
$inputor = null
fixtures = null
beforeEach ->
loadFixtures("inputors.html")
fixtures = loadJSONFixtures("data.json")["data.json"]
$inputor = $("#inputor").atWho "@",
data: fixtures["names"]
it "should be defined", ->
expect($.fn.atWho).toBeDefined()
descri... | JavaScript | CoffeeScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | 8e55c3f9b17939e0c9afe83ca9cf47a4bbaaa90e | 5,250 | https://github.com/ichord/At.js/blob/8e55c3f9b17939e0c9afe83ca9cf47a4bbaaa90e/spec/javascripts/atwho.spec.coffee | 1 | 41 |
ichord/At.js:spec/javascripts/atwho.spec.coffee:1:completion | completion | describe "jquery.atWho", ->
$inputor = null
fixtures = null
beforeEach ->
loadFixtures("inputors.html")
fixtures = loadJSONFixtures("data.json")["data.json"]
$inputor = $("#inputor").atWho "@",
data: fixtures["names"]
it "should be defined", ->
expect($.fn.atWho).toBeDefined()
descri... | text = $.trim $inputor.text()
callbacks = $.fn.atWho.default.callbacks
controller = $inputor.data("AtWho")
it "refactor the data", ->
items = callbacks.data_refactor.call(controller, fixtures["names"])
expect(items).toContain({"name":"Jacob"})
expect(items).toContain({"name":"Isabella... | CoffeeScript | CoffeeScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | 8e55c3f9b17939e0c9afe83ca9cf47a4bbaaa90e | 5,250 | https://github.com/ichord/At.js/blob/8e55c3f9b17939e0c9afe83ca9cf47a4bbaaa90e/spec/javascripts/atwho.spec.coffee | 1 | 41 |
ichord/At.js:spec/javascripts/atwho.spec.coffee:2:raw_corpus | raw_corpus | it "request data from remote by ajax", ->
jasmine.Ajax.useMock()
render_callback = jasmine.createSpy("render_view")
callbacks.remote_filter({}, "/", render_callback)
request = mostRecentAjaxRequest()
# response_data = ["Jacob", "Joshua", "Jayden"]
response_data = [{"name":"Jacob"},... | CoffeeScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | 8e55c3f9b17939e0c9afe83ca9cf47a4bbaaa90e | 5,250 | https://github.com/ichord/At.js/blob/8e55c3f9b17939e0c9afe83ca9cf47a4bbaaa90e/spec/javascripts/atwho.spec.coffee | 43 | 86 | ||
ichord/At.js:spec/javascripts/atwho.spec.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "request data from remote by ajax", ->
jasmine.Ajax.useMock()
render_callback = jasmine.createSpy("render_view")
callbacks.remote_filter({}, "/", render_callback)
request = mostRecentAjaxRequest()
# response_data = ["Jacob", "Jo... | it("request data from remote by ajax", function() {
var names, render_callback, request, response_data;
jasmine.Ajax.useMock();
render_callback = jasmine.createSpy("render_view");
callbacks.remote_filter({}, "/", render_callback);
request = mostRecentAjaxRequest();
// response_data = ["Jacob", "Joshua", "Ja... | CoffeeScript | JavaScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | 8e55c3f9b17939e0c9afe83ca9cf47a4bbaaa90e | 5,250 | https://github.com/ichord/At.js/blob/8e55c3f9b17939e0c9afe83ca9cf47a4bbaaa90e/spec/javascripts/atwho.spec.coffee | 43 | 86 |
ichord/At.js:spec/javascripts/atwho.spec.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("request data from remote by ajax", function() {
var names, render_callback, request, response_data;
jasmine.Ajax.useMock();
render_callback = jasmine.createSpy("render_view");
callbacks.remote_filter({}, "/", render_callback);
request = mostRecentAjax... | it "request data from remote by ajax", ->
jasmine.Ajax.useMock()
render_callback = jasmine.createSpy("render_view")
callbacks.remote_filter({}, "/", render_callback)
request = mostRecentAjaxRequest()
# response_data = ["Jacob", "Joshua", "Jayden"]
response_data = [{"name":"Jacob"},... | JavaScript | CoffeeScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | 8e55c3f9b17939e0c9afe83ca9cf47a4bbaaa90e | 5,250 | https://github.com/ichord/At.js/blob/8e55c3f9b17939e0c9afe83ca9cf47a4bbaaa90e/spec/javascripts/atwho.spec.coffee | 43 | 86 |
ichord/At.js:spec/javascripts/atwho.spec.coffee:2:completion | completion | it "request data from remote by ajax", ->
jasmine.Ajax.useMock()
render_callback = jasmine.createSpy("render_view")
callbacks.remote_filter({}, "/", render_callback)
request = mostRecentAjaxRequest()
# response_data = ["Jacob", "Joshua", "Jayden"]
response_data = [{"name":"Jacob"},... | it "can evl temple", ->
map = {name: "username", nick: "nick_name"}
tpl = '<li data-value="${name}">${nick}</li>'
html = '<li data-value="username">nick_name</li>'
result = callbacks.tpl_eval.call(controller, tpl, map)
expect(result).toBe(html)
it "can highlight the query", ->
... | CoffeeScript | CoffeeScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | 8e55c3f9b17939e0c9afe83ca9cf47a4bbaaa90e | 5,250 | https://github.com/ichord/At.js/blob/8e55c3f9b17939e0c9afe83ca9cf47a4bbaaa90e/spec/javascripts/atwho.spec.coffee | 43 | 86 |
ichord/At.js:spec/javascripts/atwho.spec.coffee:3:raw_corpus | raw_corpus | expect(callbacks.selector).toHaveBeenCalled()
# FIXME: it work but, the $inputor fixture have be reset back.
# expect(controller.$inputor).toHaveText(/Jacob/)
describe "Mirror", ->
it "TODO", ->
expect(true).not.toBe(false) | CoffeeScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | 8e55c3f9b17939e0c9afe83ca9cf47a4bbaaa90e | 5,250 | https://github.com/ichord/At.js/blob/8e55c3f9b17939e0c9afe83ca9cf47a4bbaaa90e/spec/javascripts/atwho.spec.coffee | 88 | 94 | ||
ichord/At.js:spec/javascripts/atwho.spec.coffee:3:completion | completion | expect(callbacks.selector).toHaveBeenCalled()
# FIXME: it work but, the $inputor fixture have be reset back.
# expect(controller.$inputor).toHaveText(/Jacob/) | describe "Mirror", ->
it "TODO", ->
expect(true).not.toBe(false) | CoffeeScript | CoffeeScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | 8e55c3f9b17939e0c9afe83ca9cf47a4bbaaa90e | 5,250 | https://github.com/ichord/At.js/blob/8e55c3f9b17939e0c9afe83ca9cf47a4bbaaa90e/spec/javascripts/atwho.spec.coffee | 88 | 94 |
ichord/At.js:spec/javascripts/atwho.spec.coffee:1:raw_corpus | raw_corpus | describe "jquery.atWho", ->
callbacks = null
controller = null
text = null
fixtures = null
beforeEach ->
loadFixtures("inputors.html")
$inputor = $("#inputor")
fixtures = loadJSONFixtures("data.json")["data.json"]
text = $.trim $inputor.text()
callbacks = $.fn.atWho.default.callbacks
... | CoffeeScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | b0f115c592a42f5d622247f384e896c989edc3be | 5,250 | https://github.com/ichord/At.js/blob/b0f115c592a42f5d622247f384e896c989edc3be/spec/javascripts/atwho.spec.coffee | 1 | 39 | ||
ichord/At.js:spec/javascripts/atwho.spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe "jquery.atWho", ->
callbacks = null
controller = null
text = null
fixtures = null
beforeEach ->
loadFixtures("inputors.html")
$inputor = $("#inputor")
fixtures = loadJSONFixtures("data.json")["data.json"]
text = $.trim $input... | describe("jquery.atWho", function() {
var callbacks, controller, fixtures, text;
callbacks = null;
controller = null;
text = null;
fixtures = null;
beforeEach(function() {
var $inputor;
loadFixtures("inputors.html");
$inputor = $("#inputor");
fixtures = loadJSONFixtures("data.json")["data.js... | CoffeeScript | JavaScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | b0f115c592a42f5d622247f384e896c989edc3be | 5,250 | https://github.com/ichord/At.js/blob/b0f115c592a42f5d622247f384e896c989edc3be/spec/javascripts/atwho.spec.coffee | 1 | 39 |
ichord/At.js:spec/javascripts/atwho.spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe("jquery.atWho", function() {
var callbacks, controller, fixtures, text;
callbacks = null;
controller = null;
text = null;
fixtures = null;
beforeEach(function() {
var $inputor;
loadFixtures("inputors.html");
$inputor = $("#inputor")... | describe "jquery.atWho", ->
callbacks = null
controller = null
text = null
fixtures = null
beforeEach ->
loadFixtures("inputors.html")
$inputor = $("#inputor")
fixtures = loadJSONFixtures("data.json")["data.json"]
text = $.trim $inputor.text()
callbacks = $.fn.atWho.default.callbacks
... | JavaScript | CoffeeScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | b0f115c592a42f5d622247f384e896c989edc3be | 5,250 | https://github.com/ichord/At.js/blob/b0f115c592a42f5d622247f384e896c989edc3be/spec/javascripts/atwho.spec.coffee | 1 | 39 |
ichord/At.js:spec/javascripts/atwho.spec.coffee:1:completion | completion | describe "jquery.atWho", ->
callbacks = null
controller = null
text = null
fixtures = null
beforeEach ->
loadFixtures("inputors.html")
$inputor = $("#inputor")
fixtures = loadJSONFixtures("data.json")["data.json"]
text = $.trim $inputor.text()
callbacks = $.fn.atWho.default.callbacks
... | describe "default callbacks work", ->
it "refactor the data", ->
items = callbacks.data_refactor.call(controller, fixtures["names"])
expect(items).toContain({"name":"Jacob"})
expect(items).toContain({"name":"Isabella"})
it "should match the key word following @", ->
query = callbacks.m... | CoffeeScript | CoffeeScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | b0f115c592a42f5d622247f384e896c989edc3be | 5,250 | https://github.com/ichord/At.js/blob/b0f115c592a42f5d622247f384e896c989edc3be/spec/javascripts/atwho.spec.coffee | 1 | 39 |
ichord/At.js:spec/javascripts/atwho.spec.coffee:2:raw_corpus | raw_corpus | it "request data from remote by ajax", ->
jasmine.Ajax.useMock()
render_callback = jasmine.createSpy("render_view")
callbacks.remote_filter({}, "/", render_callback)
request = mostRecentAjaxRequest()
# response_data = ["Jacob", "Joshua", "Jayden"]
response_data = [{"name":"Jacob"},... | CoffeeScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | b0f115c592a42f5d622247f384e896c989edc3be | 5,250 | https://github.com/ichord/At.js/blob/b0f115c592a42f5d622247f384e896c989edc3be/spec/javascripts/atwho.spec.coffee | 41 | 81 | ||
ichord/At.js:spec/javascripts/atwho.spec.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it "request data from remote by ajax", ->
jasmine.Ajax.useMock()
render_callback = jasmine.createSpy("render_view")
callbacks.remote_filter({}, "/", render_callback)
request = mostRecentAjaxRequest()
# response_data = ["Jacob", "Jo... | it("request data from remote by ajax", function() {
var names, render_callback, request, response_data;
jasmine.Ajax.useMock();
render_callback = jasmine.createSpy("render_view");
callbacks.remote_filter({}, "/", render_callback);
request = mostRecentAjaxRequest();
// response_data = ["Jacob", "Joshua", "Ja... | CoffeeScript | JavaScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | b0f115c592a42f5d622247f384e896c989edc3be | 5,250 | https://github.com/ichord/At.js/blob/b0f115c592a42f5d622247f384e896c989edc3be/spec/javascripts/atwho.spec.coffee | 41 | 81 |
ichord/At.js:spec/javascripts/atwho.spec.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it("request data from remote by ajax", function() {
var names, render_callback, request, response_data;
jasmine.Ajax.useMock();
render_callback = jasmine.createSpy("render_view");
callbacks.remote_filter({}, "/", render_callback);
request = mostRecentAjax... | it "request data from remote by ajax", ->
jasmine.Ajax.useMock()
render_callback = jasmine.createSpy("render_view")
callbacks.remote_filter({}, "/", render_callback)
request = mostRecentAjaxRequest()
# response_data = ["Jacob", "Joshua", "Jayden"]
response_data = [{"name":"Jacob"},... | JavaScript | CoffeeScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | b0f115c592a42f5d622247f384e896c989edc3be | 5,250 | https://github.com/ichord/At.js/blob/b0f115c592a42f5d622247f384e896c989edc3be/spec/javascripts/atwho.spec.coffee | 41 | 81 |
ichord/At.js:spec/javascripts/atwho.spec.coffee:2:completion | completion | it "request data from remote by ajax", ->
jasmine.Ajax.useMock()
render_callback = jasmine.createSpy("render_view")
callbacks.remote_filter({}, "/", render_callback)
request = mostRecentAjaxRequest()
# response_data = ["Jacob", "Joshua", "Jayden"]
response_data = [{"name":"Jacob"},... | expect(names).toContain({ name : 'Ethan', order : 0 })
it "can evl temple", ->
map = {name: "username", nick: "nick_name"}
tpl = '<li data-value="${name}">${nick}</li>'
html = '<li data-value="username">nick_name</li>'
result = callbacks.tpl_eval.call(controller, tpl, map)
expect(res... | CoffeeScript | CoffeeScript | ichord/At.js | spec/javascripts/atwho.spec.coffee | MIT | b0f115c592a42f5d622247f384e896c989edc3be | 5,250 | https://github.com/ichord/At.js/blob/b0f115c592a42f5d622247f384e896c989edc3be/spec/javascripts/atwho.spec.coffee | 41 | 81 |
oozcitak/xmlbuilder-js:test/issues/93.coffee:1:raw_corpus | raw_corpus | suite 'Tests specific to issues:', ->
test 'Issue #93 (Auto-generating arrays)', ->
obj =
root:
Title:
'@lang': 'eng'
'#text': 'Show Title'
Cast: [
{
'@role': 'Host'
'#text': 'Interview Person'
... | CoffeeScript | oozcitak/xmlbuilder-js | test/issues/93.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/93.coffee | 1 | 47 | ||
oozcitak/xmlbuilder-js:test/issues/93.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
suite 'Tests specific to issues:', ->
test 'Issue #93 (Auto-generating arrays)', ->
obj =
root:
Title:
'@lang': 'eng'
'#text': 'Show Title'
Cast: [
{
'@role'... | suite('Tests specific to issues:', function() {
return test('Issue #93 (Auto-generating arrays)', function() {
var obj;
obj = {
root: {
Title: {
'@lang': 'eng',
'#text': 'Show Title'
},
Cast: [
{
'@role': 'Host',
'#text': 'Int... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | test/issues/93.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/93.coffee | 1 | 47 |
oozcitak/xmlbuilder-js:test/issues/93.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
suite('Tests specific to issues:', function() {
return test('Issue #93 (Auto-generating arrays)', function() {
var obj;
obj = {
root: {
Title: {
'@lang': 'eng',
'#text': 'Show Title'
},
Cast: [
{... | suite 'Tests specific to issues:', ->
test 'Issue #93 (Auto-generating arrays)', ->
obj =
root:
Title:
'@lang': 'eng'
'#text': 'Show Title'
Cast: [
{
'@role': 'Host'
'#text': 'Interview Person'
... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | test/issues/93.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/93.coffee | 1 | 47 |
oozcitak/xmlbuilder-js:test/issues/93.coffee:1:completion | completion | suite 'Tests specific to issues:', ->
test 'Issue #93 (Auto-generating arrays)', ->
obj =
root:
Title:
'@lang': 'eng'
'#text': 'Show Title'
Cast: [
{
'@role': 'Host'
'#text': 'Interview Person'
... | {
'@lang': 'eng'
'@type': 'C34'
'#text': 'Family'
}
{
'@lang': 'eng'
'@type': 'B23'
'#text': 'Topical'
}
]
eq(
xml(obj).end()
... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | test/issues/93.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/93.coffee | 1 | 47 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:1:raw_corpus | raw_corpus | _ = require "underscore"
module.exports = DeepEquality = {}
# cyclicDeepEqual compares two Javascript values. It is comfortable with values
# which have cyclic references between their parts. In this case, it will ensure
# that the two values have isomorphic reference graphs.
# Opts:
# checkPrototypes (defaul... | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/Util/DeepEquality.coffee | 1 | 50 | ||
cdglabs/apparatus:src/Util/DeepEquality.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require "underscore"
module.exports = DeepEquality = {}
# cyclicDeepEqual compares two Javascript values. It is comfortable with values
# which have cyclic references between their parts. In this case, it will ensure
# that the two values have isomorphic ... | var DeepEquality, _,
hasProp = {}.hasOwnProperty;
_ = require("underscore");
module.exports = DeepEquality = {};
// cyclicDeepEqual compares two Javascript values. It is comfortable with values
// which have cyclic references between their parts. In this case, it will ensure
// that the two values have isomorphic ... | CoffeeScript | JavaScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/Util/DeepEquality.coffee | 1 | 50 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var DeepEquality, _,
hasProp = {}.hasOwnProperty;
_ = require("underscore");
module.exports = DeepEquality = {};
// cyclicDeepEqual compares two Javascript values. It is comfortable with values
// which have cyclic references between their parts. In this case,... | _ = require "underscore"
module.exports = DeepEquality = {}
# cyclicDeepEqual compares two Javascript values. It is comfortable with values
# which have cyclic references between their parts. In this case, it will ensure
# that the two values have isomorphic reference graphs.
# Opts:
# checkPrototypes (defaul... | JavaScript | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/Util/DeepEquality.coffee | 1 | 50 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:1:completion | completion | _ = require "underscore"
module.exports = DeepEquality = {}
# cyclicDeepEqual compares two Javascript values. It is comfortable with values
# which have cyclic references between their parts. In this case, it will ensure
# that the two values have isomorphic reference graphs.
# Opts:
# checkPrototypes (defaul... | left = []
right = []
has = Object.prototype.hasOwnProperty
visit = (a, b) ->
if typeof a != 'object' || typeof b != 'object' || a == null || b == null
return a == b
for i in [0...left.length]
if (a == left[i])
return b == right[i]
if (b == right[i])
return a == left[i]
... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/Util/DeepEquality.coffee | 1 | 50 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:2:raw_corpus | raw_corpus | if opts.checkPrototypes
# NOTE: This is changed from StackOverflow version, to allow prototypes to
# be part of the maybe-isomorphic reference graphs rather than strictly
# equal to one another.
return false if !visit(Object.getPrototypeOf(a), Object.getPrototypeOf(b))
return true
return... | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/Util/DeepEquality.coffee | 51 | 59 | ||
cdglabs/apparatus:src/Util/DeepEquality.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if opts.checkPrototypes
# NOTE: This is changed from StackOverflow version, to allow prototypes to
# be part of the maybe-isomorphic reference graphs rather than strictly
# equal to one another.
return false if !visit(Object.getPrototypeOf... | if (opts.checkPrototypes) {
if (!visit(Object.getPrototypeOf(a), Object.getPrototypeOf(b))) {
// NOTE: This is changed from StackOverflow version, to allow prototypes to
// be part of the maybe-isomorphic reference graphs rather than strictly
// equal to one another.
return false;
}
}
return true;
... | CoffeeScript | JavaScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/Util/DeepEquality.coffee | 51 | 59 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (opts.checkPrototypes) {
if (!visit(Object.getPrototypeOf(a), Object.getPrototypeOf(b))) {
// NOTE: This is changed from StackOverflow version, to allow prototypes to
// be part of the maybe-isomorphic reference graphs rather than strictly
// equal... | if opts.checkPrototypes
# NOTE: This is changed from StackOverflow version, to allow prototypes to
# be part of the maybe-isomorphic reference graphs rather than strictly
# equal to one another.
return false if !visit(Object.getPrototypeOf(a), Object.getPrototypeOf(b))
return true
return... | JavaScript | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/Util/DeepEquality.coffee | 51 | 59 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:2:completion | completion | if opts.checkPrototypes
# NOTE: This is changed from StackOverflow version, to allow prototypes to
# be part of the maybe-isomorphic reference graphs rather than strictly
# equal to one another. | return false if !visit(Object.getPrototypeOf(a), Object.getPrototypeOf(b))
return true
return visit(a, b) | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/Util/DeepEquality.coffee | 51 | 59 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:1:raw_corpus | raw_corpus | _ = require "underscore"
module.exports = DeepEquality = {}
# cyclicDeepEqual compares two Javascript values. It is comfortable with values
# which have cyclic references between their parts. In this case, it will ensure
# that the two values have isomorphic reference graphs.
# Opts:
# checkPrototypes (defaul... | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | d95c09daa8fe79a466eeb9ef2a1b961a54cac73c | 1,052 | https://github.com/cdglabs/apparatus/blob/d95c09daa8fe79a466eeb9ef2a1b961a54cac73c/src/Util/DeepEquality.coffee | 1 | 50 | ||
cdglabs/apparatus:src/Util/DeepEquality.coffee:1:completion | completion | _ = require "underscore"
module.exports = DeepEquality = {}
# cyclicDeepEqual compares two Javascript values. It is comfortable with values
# which have cyclic references between their parts. In this case, it will ensure
# that the two values have isomorphic reference graphs.
# Opts:
# checkPrototypes (defaul... | visit = (a, b) ->
if typeof a != 'object' || typeof b != 'object' || a == null || b == null
return a == b
for i in [0...left.length]
if (a == left[i])
return b == right[i]
if (b == right[i])
return a == left[i]
for own k of a
if !has.call(b, k)
return false
... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | d95c09daa8fe79a466eeb9ef2a1b961a54cac73c | 1,052 | https://github.com/cdglabs/apparatus/blob/d95c09daa8fe79a466eeb9ef2a1b961a54cac73c/src/Util/DeepEquality.coffee | 1 | 50 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:2:raw_corpus | raw_corpus | # NOTE: This is changed from StackOverflow version, to allow prototypes to
# be part of the maybe-isomorphic reference graphs rather than strictly
# equal to one another.
if !visit(Object.getPrototypeOf(a), Object.getPrototypeOf(b))
return false
return true
return visit(a, b) | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | d95c09daa8fe79a466eeb9ef2a1b961a54cac73c | 1,052 | https://github.com/cdglabs/apparatus/blob/d95c09daa8fe79a466eeb9ef2a1b961a54cac73c/src/Util/DeepEquality.coffee | 51 | 59 | ||
cdglabs/apparatus:src/Util/DeepEquality.coffee:2:completion | completion | # NOTE: This is changed from StackOverflow version, to allow prototypes to
# be part of the maybe-isomorphic reference graphs rather than strictly
# equal to one another.
if !visit(Object.getPrototypeOf(a), Object.getPrototypeOf(b)) | return false
return true
return visit(a, b) | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | d95c09daa8fe79a466eeb9ef2a1b961a54cac73c | 1,052 | https://github.com/cdglabs/apparatus/blob/d95c09daa8fe79a466eeb9ef2a1b961a54cac73c/src/Util/DeepEquality.coffee | 51 | 59 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:1:raw_corpus | raw_corpus | _ = require "underscore"
module.exports = DeepEquality = {}
# cyclicDeepEqual compares two Javascript values. It is comfortable with values
# which have cyclic references between their parts. In this case, it will ensure
# that the two values have isomorphic reference graphs.
# Opts:
# checkPrototypes (defaul... | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | 2fcce2ee0684e0d6e69992a7562e8d185dc0a5e3 | 1,052 | https://github.com/cdglabs/apparatus/blob/2fcce2ee0684e0d6e69992a7562e8d185dc0a5e3/src/Util/DeepEquality.coffee | 1 | 50 | ||
cdglabs/apparatus:src/Util/DeepEquality.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require "underscore"
module.exports = DeepEquality = {}
# cyclicDeepEqual compares two Javascript values. It is comfortable with values
# which have cyclic references between their parts. In this case, it will ensure
# that the two values have isomorphic ... | var DeepEquality, _,
hasProp = {}.hasOwnProperty;
_ = require("underscore");
module.exports = DeepEquality = {};
// cyclicDeepEqual compares two Javascript values. It is comfortable with values
// which have cyclic references between their parts. In this case, it will ensure
// that the two values have isomorphic ... | CoffeeScript | JavaScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | 2fcce2ee0684e0d6e69992a7562e8d185dc0a5e3 | 1,052 | https://github.com/cdglabs/apparatus/blob/2fcce2ee0684e0d6e69992a7562e8d185dc0a5e3/src/Util/DeepEquality.coffee | 1 | 50 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var DeepEquality, _,
hasProp = {}.hasOwnProperty;
_ = require("underscore");
module.exports = DeepEquality = {};
// cyclicDeepEqual compares two Javascript values. It is comfortable with values
// which have cyclic references between their parts. In this case,... | _ = require "underscore"
module.exports = DeepEquality = {}
# cyclicDeepEqual compares two Javascript values. It is comfortable with values
# which have cyclic references between their parts. In this case, it will ensure
# that the two values have isomorphic reference graphs.
# Opts:
# checkPrototypes (defaul... | JavaScript | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | 2fcce2ee0684e0d6e69992a7562e8d185dc0a5e3 | 1,052 | https://github.com/cdglabs/apparatus/blob/2fcce2ee0684e0d6e69992a7562e8d185dc0a5e3/src/Util/DeepEquality.coffee | 1 | 50 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:1:completion | completion | _ = require "underscore"
module.exports = DeepEquality = {}
# cyclicDeepEqual compares two Javascript values. It is comfortable with values
# which have cyclic references between their parts. In this case, it will ensure
# that the two values have isomorphic reference graphs.
# Opts:
# checkPrototypes (defaul... | if (a == left[i])
return b == right[i]
if (b == right[i])
return a == left[i]
for own k of a
if !has.call(b, k)
return false
for own k of b
if !has.call(a, k)
return false
left.push(a)
right.push(b)
for own k of a
if !visit(a[k], b[k])
... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | 2fcce2ee0684e0d6e69992a7562e8d185dc0a5e3 | 1,052 | https://github.com/cdglabs/apparatus/blob/2fcce2ee0684e0d6e69992a7562e8d185dc0a5e3/src/Util/DeepEquality.coffee | 1 | 50 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:2:raw_corpus | raw_corpus | DeepEquality.cyclicDeepEqual = (a, b, opts) ->
# PLAN:
# Recursively check that each piece of a matches a corresponding piece of b.
# checkPartsEqual should do real work for each part aPart of a only once. This
# is possible with the following strategy:
# * The first time checkPartsEqual is called on aPart, ... | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | bd0552c5f6f0d24bd0532ff4f790778ad486969c | 1,052 | https://github.com/cdglabs/apparatus/blob/bd0552c5f6f0d24bd0532ff4f790778ad486969c/src/Util/DeepEquality.coffee | 20 | 51 | ||
cdglabs/apparatus:src/Util/DeepEquality.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
DeepEquality.cyclicDeepEqual = (a, b, opts) ->
# PLAN:
# Recursively check that each piece of a matches a corresponding piece of b.
# checkPartsEqual should do real work for each part aPart of a only once. This
# is possible with the following strategy:
... | DeepEquality.cyclicDeepEqual = function(a, b, opts) {
var context;
// PLAN:
// Recursively check that each piece of a matches a corresponding piece of b.
// checkPartsEqual should do real work for each part aPart of a only once. This
// is possible with the following strategy:
// * The first time checkPart... | CoffeeScript | JavaScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | bd0552c5f6f0d24bd0532ff4f790778ad486969c | 1,052 | https://github.com/cdglabs/apparatus/blob/bd0552c5f6f0d24bd0532ff4f790778ad486969c/src/Util/DeepEquality.coffee | 20 | 51 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
DeepEquality.cyclicDeepEqual = function(a, b, opts) {
var context;
// PLAN:
// Recursively check that each piece of a matches a corresponding piece of b.
// checkPartsEqual should do real work for each part aPart of a only once. This
// is possible with t... | DeepEquality.cyclicDeepEqual = (a, b, opts) ->
# PLAN:
# Recursively check that each piece of a matches a corresponding piece of b.
# checkPartsEqual should do real work for each part aPart of a only once. This
# is possible with the following strategy:
# * The first time checkPartsEqual is called on aPart, ... | JavaScript | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | bd0552c5f6f0d24bd0532ff4f790778ad486969c | 1,052 | https://github.com/cdglabs/apparatus/blob/bd0552c5f6f0d24bd0532ff4f790778ad486969c/src/Util/DeepEquality.coffee | 20 | 51 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:2:completion | completion | DeepEquality.cyclicDeepEqual = (a, b, opts) ->
# PLAN:
# Recursively check that each piece of a matches a corresponding piece of b.
# checkPartsEqual should do real work for each part aPart of a only once. This
# is possible with the following strategy:
# * The first time checkPartsEqual is called on aPart, ... | opts ?= {}
_.defaults(opts, {
log: false,
checkPrototypes: true,
})
context = {
aParts: _extractParts(a, opts),
bParts: _extractParts(b, opts),
aPartToBPart: [],
}
if context.log then console.log 'aParts', context.aParts
if context.log then console.log 'bParts', context.bParts
retur... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | bd0552c5f6f0d24bd0532ff4f790778ad486969c | 1,052 | https://github.com/cdglabs/apparatus/blob/bd0552c5f6f0d24bd0532ff4f790778ad486969c/src/Util/DeepEquality.coffee | 20 | 51 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:3:raw_corpus | raw_corpus | _extractParts = (value, opts, toReturn = []) ->
{checkPrototypes} = opts
if _.isArray(value)
if toReturn.indexOf(value) != -1
return
toReturn.push(value)
for subValue in value
_extractParts(subValue, opts, toReturn)
else if _.isObject(value)
if toReturn.indexOf(value) != -1
retu... | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | bd0552c5f6f0d24bd0532ff4f790778ad486969c | 1,052 | https://github.com/cdglabs/apparatus/blob/bd0552c5f6f0d24bd0532ff4f790778ad486969c/src/Util/DeepEquality.coffee | 54 | 76 | ||
cdglabs/apparatus:src/Util/DeepEquality.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_extractParts = (value, opts, toReturn = []) ->
{checkPrototypes} = opts
if _.isArray(value)
if toReturn.indexOf(value) != -1
return
toReturn.push(value)
for subValue in value
_extractParts(subValue, opts, toReturn)
else if _.isObje... | var _extractParts;
_extractParts = function(value, opts, toReturn = []) {
var checkPrototypes, i, key, len, subValue, valuePrototype;
({checkPrototypes} = opts);
if (_.isArray(value)) {
if (toReturn.indexOf(value) !== -1) {
return;
}
toReturn.push(value);
for (i = 0, len = value.length; i <... | CoffeeScript | JavaScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | bd0552c5f6f0d24bd0532ff4f790778ad486969c | 1,052 | https://github.com/cdglabs/apparatus/blob/bd0552c5f6f0d24bd0532ff4f790778ad486969c/src/Util/DeepEquality.coffee | 54 | 76 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _extractParts;
_extractParts = function(value, opts, toReturn = []) {
var checkPrototypes, i, key, len, subValue, valuePrototype;
({checkPrototypes} = opts);
if (_.isArray(value)) {
if (toReturn.indexOf(value) !== -1) {
return;
}
toRetu... | _extractParts = (value, opts, toReturn = []) ->
{checkPrototypes} = opts
if _.isArray(value)
if toReturn.indexOf(value) != -1
return
toReturn.push(value)
for subValue in value
_extractParts(subValue, opts, toReturn)
else if _.isObject(value)
if toReturn.indexOf(value) != -1
retu... | JavaScript | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | bd0552c5f6f0d24bd0532ff4f790778ad486969c | 1,052 | https://github.com/cdglabs/apparatus/blob/bd0552c5f6f0d24bd0532ff4f790778ad486969c/src/Util/DeepEquality.coffee | 54 | 76 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:3:completion | completion | _extractParts = (value, opts, toReturn = []) ->
{checkPrototypes} = opts
if _.isArray(value)
if toReturn.indexOf(value) != -1
return
toReturn.push(value)
for subValue in value
_extractParts(subValue, opts, toReturn)
else if _.isObject(value)
if toReturn.indexOf(value) != -1 | return
toReturn.push(value)
for key, subValue of value
_extractParts(subValue, opts, toReturn)
if checkPrototypes
valuePrototype = Object.getPrototypeOf(value)
if valuePrototype != Object.prototype
_extractParts(valuePrototype, opts, toReturn)
return toReturn
# For this helper,... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | bd0552c5f6f0d24bd0532ff4f790778ad486969c | 1,052 | https://github.com/cdglabs/apparatus/blob/bd0552c5f6f0d24bd0532ff4f790778ad486969c/src/Util/DeepEquality.coffee | 54 | 76 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:4:raw_corpus | raw_corpus | _checkValuesEqual = (aValue, bValue, opts, context) ->
{log} = opts
{aParts, bParts, aPartToBPart} = context
if log then console.log 'checkValuesEqual', aValue, bValue
if _.isArray(aValue) or _.isObject(aValue)
return _checkPartsEqual(aValue, bValue, opts, context)
else
return aValue == bValue
# For... | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | bd0552c5f6f0d24bd0532ff4f790778ad486969c | 1,052 | https://github.com/cdglabs/apparatus/blob/bd0552c5f6f0d24bd0532ff4f790778ad486969c/src/Util/DeepEquality.coffee | 77 | 87 | ||
cdglabs/apparatus:src/Util/DeepEquality.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_checkValuesEqual = (aValue, bValue, opts, context) ->
{log} = opts
{aParts, bParts, aPartToBPart} = context
if log then console.log 'checkValuesEqual', aValue, bValue
if _.isArray(aValue) or _.isObject(aValue)
return _checkPartsEqual(aValue, bValue,... | var _checkValuesEqual;
_checkValuesEqual = function(aValue, bValue, opts, context) {
var aPartToBPart, aParts, bParts, log;
({log} = opts);
({aParts, bParts, aPartToBPart} = context);
if (log) {
console.log('checkValuesEqual', aValue, bValue);
}
if (_.isArray(aValue) || _.isObject(aValue)) {
return... | CoffeeScript | JavaScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | bd0552c5f6f0d24bd0532ff4f790778ad486969c | 1,052 | https://github.com/cdglabs/apparatus/blob/bd0552c5f6f0d24bd0532ff4f790778ad486969c/src/Util/DeepEquality.coffee | 77 | 87 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _checkValuesEqual;
_checkValuesEqual = function(aValue, bValue, opts, context) {
var aPartToBPart, aParts, bParts, log;
({log} = opts);
({aParts, bParts, aPartToBPart} = context);
if (log) {
console.log('checkValuesEqual', aValue, bValue);
}
if... | _checkValuesEqual = (aValue, bValue, opts, context) ->
{log} = opts
{aParts, bParts, aPartToBPart} = context
if log then console.log 'checkValuesEqual', aValue, bValue
if _.isArray(aValue) or _.isObject(aValue)
return _checkPartsEqual(aValue, bValue, opts, context)
else
return aValue == bValue
# For... | JavaScript | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | bd0552c5f6f0d24bd0532ff4f790778ad486969c | 1,052 | https://github.com/cdglabs/apparatus/blob/bd0552c5f6f0d24bd0532ff4f790778ad486969c/src/Util/DeepEquality.coffee | 77 | 87 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:4:completion | completion | _checkValuesEqual = (aValue, bValue, opts, context) ->
{log} = opts
{aParts, bParts, aPartToBPart} = context
if log then console.log 'checkValuesEqual', aValue, bValue | if _.isArray(aValue) or _.isObject(aValue)
return _checkPartsEqual(aValue, bValue, opts, context)
else
return aValue == bValue
# For this helper, aPart should be a part of a. | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | bd0552c5f6f0d24bd0532ff4f790778ad486969c | 1,052 | https://github.com/cdglabs/apparatus/blob/bd0552c5f6f0d24bd0532ff4f790778ad486969c/src/Util/DeepEquality.coffee | 77 | 87 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:5:raw_corpus | raw_corpus | _checkPartsEqual = (aPart, bPart, opts, context) ->
{log, checkPrototypes} = opts
{aParts, bParts, aPartToBPart} = context
if log then console.log 'checkPartsEqual', aPart, bPart
aPartIndex = aParts.indexOf(aPart)
if log then console.log ' aPartIndex', aPartIndex
bPartIndex = bParts.indexOf(bPart)
if ... | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | bd0552c5f6f0d24bd0532ff4f790778ad486969c | 1,052 | https://github.com/cdglabs/apparatus/blob/bd0552c5f6f0d24bd0532ff4f790778ad486969c/src/Util/DeepEquality.coffee | 88 | 137 | ||
cdglabs/apparatus:src/Util/DeepEquality.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_checkPartsEqual = (aPart, bPart, opts, context) ->
{log, checkPrototypes} = opts
{aParts, bParts, aPartToBPart} = context
if log then console.log 'checkPartsEqual', aPart, bPart
aPartIndex = aParts.indexOf(aPart)
if log then console.log ' aPartIndex... | var _checkPartsEqual,
hasProp = {}.hasOwnProperty;
_checkPartsEqual = function(aPart, bPart, opts, context) {
var aPartIndex, aPartProto, aPartToBPart, aParts, aSubValue, bPartIndex, bPartProto, bParts, checkPrototypes, i, j, key, len, log;
({log, checkPrototypes} = opts);
({aParts, bParts, aPartToBPart} = con... | CoffeeScript | JavaScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | bd0552c5f6f0d24bd0532ff4f790778ad486969c | 1,052 | https://github.com/cdglabs/apparatus/blob/bd0552c5f6f0d24bd0532ff4f790778ad486969c/src/Util/DeepEquality.coffee | 88 | 137 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _checkPartsEqual,
hasProp = {}.hasOwnProperty;
_checkPartsEqual = function(aPart, bPart, opts, context) {
var aPartIndex, aPartProto, aPartToBPart, aParts, aSubValue, bPartIndex, bPartProto, bParts, checkPrototypes, i, j, key, len, log;
({log, checkProto... | _checkPartsEqual = (aPart, bPart, opts, context) ->
{log, checkPrototypes} = opts
{aParts, bParts, aPartToBPart} = context
if log then console.log 'checkPartsEqual', aPart, bPart
aPartIndex = aParts.indexOf(aPart)
if log then console.log ' aPartIndex', aPartIndex
bPartIndex = bParts.indexOf(bPart)
if ... | JavaScript | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | bd0552c5f6f0d24bd0532ff4f790778ad486969c | 1,052 | https://github.com/cdglabs/apparatus/blob/bd0552c5f6f0d24bd0532ff4f790778ad486969c/src/Util/DeepEquality.coffee | 88 | 137 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:5:completion | completion | _checkPartsEqual = (aPart, bPart, opts, context) ->
{log, checkPrototypes} = opts
{aParts, bParts, aPartToBPart} = context
if log then console.log 'checkPartsEqual', aPart, bPart
aPartIndex = aParts.indexOf(aPart)
if log then console.log ' aPartIndex', aPartIndex
bPartIndex = bParts.indexOf(bPart)
if ... | return false
if aPart.length != bPart.length
return false
for aSubValue, i in aPart
if !_checkValuesEqual(aSubValue, bPart[i], opts, context)
return false
return true
else if _.isObject(aPart)
if !_.isObject(bPart)
return false
if _.keys(aPart).length != _.keys(bPart).len... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | bd0552c5f6f0d24bd0532ff4f790778ad486969c | 1,052 | https://github.com/cdglabs/apparatus/blob/bd0552c5f6f0d24bd0532ff4f790778ad486969c/src/Util/DeepEquality.coffee | 88 | 137 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:2:raw_corpus | raw_corpus | DeepEquality.cyclicDeepEqual = (a, b, opts) ->
# PLAN:
# Recursively check that each piece of a matches a corresponding piece of b.
# checkPartsEqual should do real work for each part aPart of a only once. This
# is possible with the following strategy:
# * The first time checkPartsEqual is called on aPart, ... | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | 2fc47d2104d9d6394dda284b4f2a7fccfa5aad0f | 1,052 | https://github.com/cdglabs/apparatus/blob/2fc47d2104d9d6394dda284b4f2a7fccfa5aad0f/src/Util/DeepEquality.coffee | 16 | 46 | ||
cdglabs/apparatus:src/Util/DeepEquality.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
DeepEquality.cyclicDeepEqual = (a, b, opts) ->
# PLAN:
# Recursively check that each piece of a matches a corresponding piece of b.
# checkPartsEqual should do real work for each part aPart of a only once. This
# is possible with the following strategy:
... | DeepEquality.cyclicDeepEqual = function(a, b, opts) {
var context;
// PLAN:
// Recursively check that each piece of a matches a corresponding piece of b.
// checkPartsEqual should do real work for each part aPart of a only once. This
// is possible with the following strategy:
// * The first time checkPart... | CoffeeScript | JavaScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | 2fc47d2104d9d6394dda284b4f2a7fccfa5aad0f | 1,052 | https://github.com/cdglabs/apparatus/blob/2fc47d2104d9d6394dda284b4f2a7fccfa5aad0f/src/Util/DeepEquality.coffee | 16 | 46 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
DeepEquality.cyclicDeepEqual = function(a, b, opts) {
var context;
// PLAN:
// Recursively check that each piece of a matches a corresponding piece of b.
// checkPartsEqual should do real work for each part aPart of a only once. This
// is possible with t... | DeepEquality.cyclicDeepEqual = (a, b, opts) ->
# PLAN:
# Recursively check that each piece of a matches a corresponding piece of b.
# checkPartsEqual should do real work for each part aPart of a only once. This
# is possible with the following strategy:
# * The first time checkPartsEqual is called on aPart, ... | JavaScript | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | 2fc47d2104d9d6394dda284b4f2a7fccfa5aad0f | 1,052 | https://github.com/cdglabs/apparatus/blob/2fc47d2104d9d6394dda284b4f2a7fccfa5aad0f/src/Util/DeepEquality.coffee | 16 | 46 |
cdglabs/apparatus:src/Util/DeepEquality.coffee:2:completion | completion | DeepEquality.cyclicDeepEqual = (a, b, opts) ->
# PLAN:
# Recursively check that each piece of a matches a corresponding piece of b.
# checkPartsEqual should do real work for each part aPart of a only once. This
# is possible with the following strategy:
# * The first time checkPartsEqual is called on aPart, ... | opts ?= {}
_.defaults(opts, {
log: false,
checkPrototypes: true,
})
context = {
aParts: _extractParts(a, opts),
bParts: _extractParts(b, opts),
aPartToBPart: [],
}
if context.log then console.log 'aParts', context.aParts
if context.log then console.log 'bParts', context.bParts
retur... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/Util/DeepEquality.coffee | MIT | 2fc47d2104d9d6394dda284b4f2a7fccfa5aad0f | 1,052 | https://github.com/cdglabs/apparatus/blob/2fc47d2104d9d6394dda284b4f2a7fccfa5aad0f/src/Util/DeepEquality.coffee | 16 | 46 |
meltingice/psd.js:lib/psd/lazy_execute.coffee:1:raw_corpus | raw_corpus | module.exports = class LazyExecute
constructor: (@obj, @file) ->
@startPos = @file.tell()
@loaded = false
@loadMethod = null
@loadArgs = []
@passthru = []
# This describes the method that we want to run at object instantiation. Typically this
# will skip over the data that we will parse on-de... | CoffeeScript | meltingice/psd.js | lib/psd/lazy_execute.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/lazy_execute.coffee | 26 | 75 | ||
meltingice/psd.js:lib/psd/lazy_execute.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = class LazyExecute
constructor: (@obj, @file) ->
@startPos = @file.tell()
@loaded = false
@loadMethod = null
@loadArgs = []
@passthru = []
# This describes the method that we want to run at object instantiation. Typically ... | var LazyExecute,
indexOf = [].indexOf;
module.exports = LazyExecute = class LazyExecute {
constructor(obj, file) {
this.obj = obj;
this.file = file;
this.startPos = this.file.tell();
this.loaded = false;
this.loadMethod = null;
this.loadArgs = [];
this.passthru = [];
}
// This desc... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/lazy_execute.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/lazy_execute.coffee | 26 | 75 |
meltingice/psd.js:lib/psd/lazy_execute.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var LazyExecute,
indexOf = [].indexOf;
module.exports = LazyExecute = class LazyExecute {
constructor(obj, file) {
this.obj = obj;
this.file = file;
this.startPos = this.file.tell();
this.loaded = false;
this.loadMethod = null;
this.loa... | module.exports = class LazyExecute
constructor: (@obj, @file) ->
@startPos = @file.tell()
@loaded = false
@loadMethod = null
@loadArgs = []
@passthru = []
# This describes the method that we want to run at object instantiation. Typically this
# will skip over the data that we will parse on-de... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/lazy_execute.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/lazy_execute.coffee | 26 | 75 |
meltingice/psd.js:lib/psd/lazy_execute.coffee:1:completion | completion | module.exports = class LazyExecute
constructor: (@obj, @file) ->
@startPos = @file.tell()
@loaded = false
@loadMethod = null
@loadArgs = []
@passthru = []
# This describes the method that we want to run at object instantiation. Typically this
# will skip over the data that we will parse on-de... | # optimize usage.
#
# The arguments are a list of method/property names we don't want to trigger on-demand parsing.
ignore: (args...) ->
@passthru.concat args
return @
# This is called once all of the paramters of the proxy have been set up, i.e. now, later, and skip.
# This defines all items on the ... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/lazy_execute.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/lazy_execute.coffee | 26 | 75 |
meltingice/psd.js:lib/psd/lazy_execute.coffee:2:raw_corpus | raw_corpus | # 3. Calls the load method, which was defined with `later()`.
# 4. Jumps back to the original file position.
# 5. Sets the `@loaded` flag to true so we know this object has been parsed.
load: ->
origPos = @file.tell()
@file.seek @startPos
@obj[@loadMethod].apply(@obj, @loadArgs)
@file.seek origP... | CoffeeScript | meltingice/psd.js | lib/psd/lazy_execute.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/lazy_execute.coffee | 76 | 86 | ||
meltingice/psd.js:lib/psd/lazy_execute.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# 3. Calls the load method, which was defined with `later()`.
# 4. Jumps back to the original file position.
# 5. Sets the `@loaded` flag to true so we know this object has been parsed.
load: ->
origPos = @file.tell()
@file.seek @startPos
@obj[... | // 3. Calls the load method, which was defined with `later()`.
// 4. Jumps back to the original file position.
// 5. Sets the `@loaded` flag to true so we know this object has been parsed.
({
load: function() {
var origPos;
origPos = this.file.tell();
this.file.seek(this.startPos);
this.obj[this.loadM... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/lazy_execute.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/lazy_execute.coffee | 76 | 86 |
meltingice/psd.js:lib/psd/lazy_execute.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// 3. Calls the load method, which was defined with `later()`.
// 4. Jumps back to the original file position.
// 5. Sets the `@loaded` flag to true so we know this object has been parsed.
({
load: function() {
var origPos;
origPos = this.file.tell();
... | # 3. Calls the load method, which was defined with `later()`.
# 4. Jumps back to the original file position.
# 5. Sets the `@loaded` flag to true so we know this object has been parsed.
load: ->
origPos = @file.tell()
@file.seek @startPos
@obj[@loadMethod].apply(@obj, @loadArgs)
@file.seek origP... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/lazy_execute.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/lazy_execute.coffee | 76 | 86 |
meltingice/psd.js:lib/psd/lazy_execute.coffee:2:completion | completion | # 3. Calls the load method, which was defined with `later()`.
# 4. Jumps back to the original file position.
# 5. Sets the `@loaded` flag to true so we know this object has been parsed.
load: ->
origPos = @file.tell() | @file.seek @startPos
@obj[@loadMethod].apply(@obj, @loadArgs)
@file.seek origPos
@loaded = true | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/lazy_execute.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/lazy_execute.coffee | 76 | 86 |
meltingice/psd.js:lib/psd/lazy_execute.coffee:1:raw_corpus | raw_corpus | module.exports = class LazyExecute
constructor: (@obj, @file) ->
@startPos = @file.tell()
@loaded = false
@loadMethod = null
@loadArgs = []
@passthru = []
now: (method, args...) ->
@obj[method].apply(@obj, args)
return @
later: (method, args...) ->
@loadMethod = method
@loadA... | CoffeeScript | meltingice/psd.js | lib/psd/lazy_execute.coffee | MIT | 545c754fa8b304ba319fec938aee75743d9a6c00 | 2,846 | https://github.com/meltingice/psd.js/blob/545c754fa8b304ba319fec938aee75743d9a6c00/lib/psd/lazy_execute.coffee | 1 | 39 | ||
meltingice/psd.js:lib/psd/lazy_execute.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = class LazyExecute
constructor: (@obj, @file) ->
@startPos = @file.tell()
@loaded = false
@loadMethod = null
@loadArgs = []
@passthru = []
now: (method, args...) ->
@obj[method].apply(@obj, args)
return @
later:... | var LazyExecute,
indexOf = [].indexOf;
module.exports = LazyExecute = class LazyExecute {
constructor(obj, file) {
this.obj = obj;
this.file = file;
this.startPos = this.file.tell();
this.loaded = false;
this.loadMethod = null;
this.loadArgs = [];
this.passthru = [];
}
now(method, ... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/lazy_execute.coffee | MIT | 545c754fa8b304ba319fec938aee75743d9a6c00 | 2,846 | https://github.com/meltingice/psd.js/blob/545c754fa8b304ba319fec938aee75743d9a6c00/lib/psd/lazy_execute.coffee | 1 | 39 |
meltingice/psd.js:lib/psd/lazy_execute.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var LazyExecute,
indexOf = [].indexOf;
module.exports = LazyExecute = class LazyExecute {
constructor(obj, file) {
this.obj = obj;
this.file = file;
this.startPos = this.file.tell();
this.loaded = false;
this.loadMethod = null;
this.loa... | module.exports = class LazyExecute
constructor: (@obj, @file) ->
@startPos = @file.tell()
@loaded = false
@loadMethod = null
@loadArgs = []
@passthru = []
now: (method, args...) ->
@obj[method].apply(@obj, args)
return @
later: (method, args...) ->
@loadMethod = method
@loadA... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/lazy_execute.coffee | MIT | 545c754fa8b304ba319fec938aee75743d9a6c00 | 2,846 | https://github.com/meltingice/psd.js/blob/545c754fa8b304ba319fec938aee75743d9a6c00/lib/psd/lazy_execute.coffee | 1 | 39 |
meltingice/psd.js:lib/psd/lazy_execute.coffee:1:completion | completion | module.exports = class LazyExecute
constructor: (@obj, @file) ->
@startPos = @file.tell()
@loaded = false
@loadMethod = null
@loadArgs = []
@passthru = []
now: (method, args...) ->
@obj[method].apply(@obj, args)
return @
later: (method, args...) ->
@loadMethod = method
@loadA... | return @
get: ->
for key, val of @obj then do (key, val) =>
return if @[key]?
Object.defineProperty @, key,
get: ->
@load() if not @loaded and not (key in @passthru)
@obj[key]
@
load: ->
origPos = @file.tell()
@file.seek @startPos
@obj[@loadMethod].app... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/lazy_execute.coffee | MIT | 545c754fa8b304ba319fec938aee75743d9a6c00 | 2,846 | https://github.com/meltingice/psd.js/blob/545c754fa8b304ba319fec938aee75743d9a6c00/lib/psd/lazy_execute.coffee | 1 | 39 |
meltingice/psd.js:lib/psd/lazy_execute.coffee:1:raw_corpus | raw_corpus | module.exports = class LazyExecute
constructor: (@obj, @file) ->
@startPos = @file.tell()
@loaded = false
@loadMethod = null
@loadArgs = []
@passthru = []
now: (method, args...) ->
@obj[method].apply(@obj, args)
return @
later: (method, args...) ->
@loadMethod = method
@loadA... | CoffeeScript | meltingice/psd.js | lib/psd/lazy_execute.coffee | MIT | 969ddd48118b35cd134364eb7793fce4bf4dd162 | 2,846 | https://github.com/meltingice/psd.js/blob/969ddd48118b35cd134364eb7793fce4bf4dd162/lib/psd/lazy_execute.coffee | 1 | 39 | ||
meltingice/psd.js:lib/psd/lazy_execute.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = class LazyExecute
constructor: (@obj, @file) ->
@startPos = @file.tell()
@loaded = false
@loadMethod = null
@loadArgs = []
@passthru = []
now: (method, args...) ->
@obj[method].apply(@obj, args)
return @
later:... | var LazyExecute,
hasProp = {}.hasOwnProperty,
indexOf = [].indexOf;
module.exports = LazyExecute = class LazyExecute {
constructor(obj, file) {
this.obj = obj;
this.file = file;
this.startPos = this.file.tell();
this.loaded = false;
this.loadMethod = null;
this.loadArgs = [];
this.pas... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/lazy_execute.coffee | MIT | 969ddd48118b35cd134364eb7793fce4bf4dd162 | 2,846 | https://github.com/meltingice/psd.js/blob/969ddd48118b35cd134364eb7793fce4bf4dd162/lib/psd/lazy_execute.coffee | 1 | 39 |
meltingice/psd.js:lib/psd/lazy_execute.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var LazyExecute,
hasProp = {}.hasOwnProperty,
indexOf = [].indexOf;
module.exports = LazyExecute = class LazyExecute {
constructor(obj, file) {
this.obj = obj;
this.file = file;
this.startPos = this.file.tell();
this.loaded = false;
this.... | module.exports = class LazyExecute
constructor: (@obj, @file) ->
@startPos = @file.tell()
@loaded = false
@loadMethod = null
@loadArgs = []
@passthru = []
now: (method, args...) ->
@obj[method].apply(@obj, args)
return @
later: (method, args...) ->
@loadMethod = method
@loadA... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/lazy_execute.coffee | MIT | 969ddd48118b35cd134364eb7793fce4bf4dd162 | 2,846 | https://github.com/meltingice/psd.js/blob/969ddd48118b35cd134364eb7793fce4bf4dd162/lib/psd/lazy_execute.coffee | 1 | 39 |
meltingice/psd.js:lib/psd/lazy_execute.coffee:1:completion | completion | module.exports = class LazyExecute
constructor: (@obj, @file) ->
@startPos = @file.tell()
@loaded = false
@loadMethod = null
@loadArgs = []
@passthru = []
now: (method, args...) ->
@obj[method].apply(@obj, args)
return @
later: (method, args...) ->
@loadMethod = method
@loadA... | return @
get: ->
for own key, val of @obj then do (key, val) =>
return if @[key]?
Object.defineProperty @, key,
get: ->
@load() if not @loaded and not (key in @passthru)
@obj[key]
@
load: ->
origPos = @file.tell()
@file.seek @startPos
@obj[@loadMethod]... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/lazy_execute.coffee | MIT | 969ddd48118b35cd134364eb7793fce4bf4dd162 | 2,846 | https://github.com/meltingice/psd.js/blob/969ddd48118b35cd134364eb7793fce4bf4dd162/lib/psd/lazy_execute.coffee | 1 | 39 |
jrcryer/grunt-pagespeed:tasks/lib/config.coffee:1:raw_corpus | raw_corpus | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict';
exports.init = (grunt) ->
exports = {}
config = {}
DEFAULT_THRESHOLD = 70
key = ->
config["key"] if config["key"]
nokey ... | CoffeeScript | jrcryer/grunt-pagespeed | tasks/lib/config.coffee | MIT | 89804738ab895209b737fdc8a336e502b36aea6b | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/89804738ab895209b737fdc8a336e502b36aea6b/tasks/lib/config.coffee | 1 | 50 | ||
jrcryer/grunt-pagespeed:tasks/lib/config.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict';
exports.init = (grunt) ->
exports = {}
config = {}
DEFAULT_THRESHOLD = 70... | // grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
exports.init = function(grunt) {
var DEFAULT_THRESHOLD, config, exports, key, locale, nokey, paths, strategy, threshold, url, urls;
export... | CoffeeScript | JavaScript | jrcryer/grunt-pagespeed | tasks/lib/config.coffee | MIT | 89804738ab895209b737fdc8a336e502b36aea6b | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/89804738ab895209b737fdc8a336e502b36aea6b/tasks/lib/config.coffee | 1 | 50 |
jrcryer/grunt-pagespeed:tasks/lib/config.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
exports.init = function(grunt) {
var DEFAULT_THRESHOLD, config, exports, key, locale,... | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict';
exports.init = (grunt) ->
exports = {}
config = {}
DEFAULT_THRESHOLD = 70
key = ->
config["key"] if config["key"]
nokey ... | JavaScript | CoffeeScript | jrcryer/grunt-pagespeed | tasks/lib/config.coffee | MIT | 89804738ab895209b737fdc8a336e502b36aea6b | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/89804738ab895209b737fdc8a336e502b36aea6b/tasks/lib/config.coffee | 1 | 50 |
jrcryer/grunt-pagespeed:tasks/lib/config.coffee:1:completion | completion | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict';
exports.init = (grunt) ->
exports = {}
config = {}
DEFAULT_THRESHOLD = 70
key = ->
config["key"] if config["key"]
nokey ... | urls = ->
return config["urls"] if config["urls"]
[] unless config["urls"]
paths = ->
return config["paths"] if config["paths"]
[''] unless config["paths"]
locale = ->
grunt.fatal("Locale key is mandatory") unless config["locale"]
config["locale"] if config["locale"]
strategy = ->
c... | CoffeeScript | CoffeeScript | jrcryer/grunt-pagespeed | tasks/lib/config.coffee | MIT | 89804738ab895209b737fdc8a336e502b36aea6b | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/89804738ab895209b737fdc8a336e502b36aea6b/tasks/lib/config.coffee | 1 | 50 |
jrcryer/grunt-pagespeed:tasks/lib/config.coffee:2:raw_corpus | raw_corpus | params = for index, path of paths()
param = {}
param["key"] = key() if config["key"]
param["nokey"] = nokey() if config["nokey"]
param["url"] = url() + path
param["locale"] = locale()
param["strategy"] = strategy()
param["threshold"] = threshold()
param
params
exp... | CoffeeScript | jrcryer/grunt-pagespeed | tasks/lib/config.coffee | MIT | 89804738ab895209b737fdc8a336e502b36aea6b | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/89804738ab895209b737fdc8a336e502b36aea6b/tasks/lib/config.coffee | 51 | 66 | ||
jrcryer/grunt-pagespeed:tasks/lib/config.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
params = for index, path of paths()
param = {}
param["key"] = key() if config["key"]
param["nokey"] = nokey() if config["nokey"]
param["url"] = url() + path
param["locale"] = locale()
param["strategy"] = strategy()
param[... | var index, param, params, path;
params = (function() {
var ref, results;
ref = paths();
results = [];
for (index in ref) {
path = ref[index];
param = {};
if (config["key"]) {
param["key"] = key();
}
if (config["nokey"]) {
param["nokey"] = nokey();
}
param["url"] = url() ... | CoffeeScript | JavaScript | jrcryer/grunt-pagespeed | tasks/lib/config.coffee | MIT | 89804738ab895209b737fdc8a336e502b36aea6b | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/89804738ab895209b737fdc8a336e502b36aea6b/tasks/lib/config.coffee | 51 | 66 |
jrcryer/grunt-pagespeed:tasks/lib/config.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var index, param, params, path;
params = (function() {
var ref, results;
ref = paths();
results = [];
for (index in ref) {
path = ref[index];
param = {};
if (config["key"]) {
param["key"] = key();
}
if (config["nokey"]) {
pa... | params = for index, path of paths()
param = {}
param["key"] = key() if config["key"]
param["nokey"] = nokey() if config["nokey"]
param["url"] = url() + path
param["locale"] = locale()
param["strategy"] = strategy()
param["threshold"] = threshold()
param
params
exp... | JavaScript | CoffeeScript | jrcryer/grunt-pagespeed | tasks/lib/config.coffee | MIT | 89804738ab895209b737fdc8a336e502b36aea6b | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/89804738ab895209b737fdc8a336e502b36aea6b/tasks/lib/config.coffee | 51 | 66 |
jrcryer/grunt-pagespeed:tasks/lib/config.coffee:2:completion | completion | params = for index, path of paths()
param = {}
param["key"] = key() if config["key"]
param["nokey"] = nokey() if config["nokey"]
param["url"] = url() + path
param["locale"] = locale()
param["strategy"] = strategy()
param["threshold"] = threshold() | param
params
exports.threshold = threshold
return exports | CoffeeScript | CoffeeScript | jrcryer/grunt-pagespeed | tasks/lib/config.coffee | MIT | 89804738ab895209b737fdc8a336e502b36aea6b | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/89804738ab895209b737fdc8a336e502b36aea6b/tasks/lib/config.coffee | 51 | 66 |
jrcryer/grunt-pagespeed:tasks/lib/config.coffee:1:raw_corpus | raw_corpus | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict';
exports.init = (grunt) ->
exports = {}
config = {}
DEFAULT_THRESHOLD = 70
key = ->
grunt.fatal("API key is mandatory") unle... | CoffeeScript | jrcryer/grunt-pagespeed | tasks/lib/config.coffee | MIT | 0656f7f816984227f3fa13002d5e47ca2e92bf02 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/0656f7f816984227f3fa13002d5e47ca2e92bf02/tasks/lib/config.coffee | 1 | 50 | ||
jrcryer/grunt-pagespeed:tasks/lib/config.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict';
exports.init = (grunt) ->
exports = {}
config = {}
DEFAULT_THRESHOLD = 70... | // grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
exports.init = function(grunt) {
var DEFAULT_THRESHOLD, config, exports, key, locale, paths, strategy, threshold, url, urls;
exports = {};... | CoffeeScript | JavaScript | jrcryer/grunt-pagespeed | tasks/lib/config.coffee | MIT | 0656f7f816984227f3fa13002d5e47ca2e92bf02 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/0656f7f816984227f3fa13002d5e47ca2e92bf02/tasks/lib/config.coffee | 1 | 50 |
jrcryer/grunt-pagespeed:tasks/lib/config.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
exports.init = function(grunt) {
var DEFAULT_THRESHOLD, config, exports, key, locale,... | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict';
exports.init = (grunt) ->
exports = {}
config = {}
DEFAULT_THRESHOLD = 70
key = ->
grunt.fatal("API key is mandatory") unle... | JavaScript | CoffeeScript | jrcryer/grunt-pagespeed | tasks/lib/config.coffee | MIT | 0656f7f816984227f3fa13002d5e47ca2e92bf02 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/0656f7f816984227f3fa13002d5e47ca2e92bf02/tasks/lib/config.coffee | 1 | 50 |
jrcryer/grunt-pagespeed:tasks/lib/config.coffee:1:completion | completion | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict';
exports.init = (grunt) ->
exports = {}
config = {}
DEFAULT_THRESHOLD = 70
key = ->
grunt.fatal("API key is mandatory") unle... | [] unless config["urls"]
paths = ->
return config["paths"] if config["paths"]
[''] unless config["paths"]
locale = ->
grunt.fatal("Locale key is mandatory") unless config["locale"]
config["locale"] if config["locale"]
strategy = ->
config["strategy"] if config["strategy"]
threshold = ->
... | CoffeeScript | CoffeeScript | jrcryer/grunt-pagespeed | tasks/lib/config.coffee | MIT | 0656f7f816984227f3fa13002d5e47ca2e92bf02 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/0656f7f816984227f3fa13002d5e47ca2e92bf02/tasks/lib/config.coffee | 1 | 50 |
jrcryer/grunt-pagespeed:tasks/lib/config.coffee:2:raw_corpus | raw_corpus | param["strategy"] = strategy()
param["threshold"] = threshold()
param
params
exports.threshold = threshold
return exports | CoffeeScript | jrcryer/grunt-pagespeed | tasks/lib/config.coffee | MIT | 0656f7f816984227f3fa13002d5e47ca2e92bf02 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/0656f7f816984227f3fa13002d5e47ca2e92bf02/tasks/lib/config.coffee | 51 | 60 | ||
jrcryer/grunt-pagespeed:tasks/lib/config.coffee:2:completion | completion | param["strategy"] = strategy()
param["threshold"] = threshold()
param
params | exports.threshold = threshold
return exports | CoffeeScript | CoffeeScript | jrcryer/grunt-pagespeed | tasks/lib/config.coffee | MIT | 0656f7f816984227f3fa13002d5e47ca2e92bf02 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/0656f7f816984227f3fa13002d5e47ca2e92bf02/tasks/lib/config.coffee | 51 | 60 |
jrcryer/grunt-pagespeed:tasks/lib/config.coffee:1:raw_corpus | raw_corpus | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict';
exports.init = (grunt) ->
exports = {}
config = {}
DEFAULT_THRESHOLD = 70
key = ->
grunt.fatal("API key is mandatory") unle... | CoffeeScript | jrcryer/grunt-pagespeed | tasks/lib/config.coffee | MIT | 57a0c4ea5823c5a5e6da03de61709ea0027c20d0 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/57a0c4ea5823c5a5e6da03de61709ea0027c20d0/tasks/lib/config.coffee | 1 | 50 | ||
jrcryer/grunt-pagespeed:tasks/lib/config.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict';
exports.init = (grunt) ->
exports = {}
config = {}
DEFAULT_THRESHOLD = 70... | // grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
exports.init = function(grunt) {
var DEFAULT_THRESHOLD, config, exports, key, locale, paths, strategy, url, urls;
exports = {};
config =... | CoffeeScript | JavaScript | jrcryer/grunt-pagespeed | tasks/lib/config.coffee | MIT | 57a0c4ea5823c5a5e6da03de61709ea0027c20d0 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/57a0c4ea5823c5a5e6da03de61709ea0027c20d0/tasks/lib/config.coffee | 1 | 50 |
jrcryer/grunt-pagespeed:tasks/lib/config.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// grunt-pagespeed
// http://www.jamescryer.com/grunt-pagespeed
// Copyright (c) 2013 James Cryer
// http://www.jamescryer.com
// Licensed under the MIT license.
'use strict';
exports.init = function(grunt) {
var DEFAULT_THRESHOLD, config, exports, key, locale,... | #
# grunt-pagespeed
# http://www.jamescryer.com/grunt-pagespeed
#
# Copyright (c) 2013 James Cryer
# http://www.jamescryer.com
# Licensed under the MIT license.
#
'use strict';
exports.init = (grunt) ->
exports = {}
config = {}
DEFAULT_THRESHOLD = 70
key = ->
grunt.fatal("API key is mandatory") unle... | JavaScript | CoffeeScript | jrcryer/grunt-pagespeed | tasks/lib/config.coffee | MIT | 57a0c4ea5823c5a5e6da03de61709ea0027c20d0 | 459 | https://github.com/jrcryer/grunt-pagespeed/blob/57a0c4ea5823c5a5e6da03de61709ea0027c20d0/tasks/lib/config.coffee | 1 | 50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.