commit stringlengths 40 40 | subject stringlengths 1 3.25k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | old_contents stringlengths 0 26.3k | lang stringclasses 3
values | proba float64 0 1 | diff stringlengths 0 7.82k |
|---|---|---|---|---|---|---|---|
28fe6d7d4dce77b1ddfee0cb6726b66e42932eca | Fix compatibility with git <2.7 and Netlify [Fixes #8] | src/helpers/git.js | src/helpers/git.js | import url from 'url';
import child from 'child_process';
function exec(cmd, options) {
return new Promise((resolve, reject) => {
child.exec(cmd, { cwd: options.path }, (err, stdout, stderr) => {
if (err) {
reject(err);
} else {
resolve(stdout.trim());
}
});
});
}
functio... | JavaScript | 0 | @@ -628,29 +628,38 @@
git
-remote get-url
+config --get remote.
origin
+.url
%60, o
|
32c84a82a23ee043ac2213ed274ec84350753c27 | Update spec-bundle.js | spec-bundle.js | spec-bundle.js |
require('core-js');
require('zone.js/dist/zone-microtask.js');
// require('zone.js/dist/long-stack-trace-zone.js');
require('zone.js/dist/jasmine-patch.js');
var testContext = require.context('./app', true, /\.spec\.ts/);
function requireAll(requireContext) {
return requireContext.keys().map(requireContext);
}
v... | JavaScript | 0 | @@ -45,18 +45,8 @@
zone
--microtask
.js'
|
22581247661fdf7e3b6d9e209fac5824db9b5a03 | move right padding for clear to render, otherwise popup position wrong | src/inputs/text.js | src/inputs/text.js | /**
Text input
@class text
@extends abstractinput
@final
@example
<a href="#" id="username" data-type="text" data-pk="1">awesome</a>
<script>
$(function(){
$('#username').editable({
url: '/post',
title: 'Enter username'
});
});
</script>
**/
(function ($) {
var Text = function (options) {
... | JavaScript | 0.000041 | @@ -1192,46 +1192,60 @@
ear)
-.parent().css('position', 'relative');
+%0A .css('padding-right', 25)
%0A
@@ -1256,27 +1256,27 @@
-this.$input
+
.keyup($
@@ -1306,17 +1306,108 @@
, this))
-;
+%0A .parent().css('position', 'relative');%0A ... |
38bd34d409e2727b6f1c86bcce903bd98c124d46 | Remove unnecesary timeout | src/js/Calendar.js | src/js/Calendar.js | /* global google,require,RegionView,HostView,Utils, */
var Calendar = (function () {
"use strict";
var container;
var events = {};
var regions = {};
var options = {};
var timeline = {};
/*****************************************************************
* C O N S T... | JavaScript | 0.998723 | @@ -2599,35 +2599,24 @@
ts;%0A
-setTimeout(
updateEvents
@@ -2621,15 +2621,8 @@
ts()
-, 4000)
;%0A
@@ -3358,19 +3358,8 @@
-setTimeout(
upda
@@ -3373,14 +3373,8 @@
ns()
-,3000)
;%0A
|
f9a8a70cba8f3ac00543241a1a6b7a18506f22db | Correct default for rawChildren | src/js/TreeNode.js | src/js/TreeNode.js | import classNames from 'classnames';
import React from 'react';
import nodeShape from './nodeShape';
class TreeNode extends React.Component {
static propTypes = {
checked: React.PropTypes.number.isRequired,
expanded: React.PropTypes.bool.isRequired,
label: React.PropTypes.string.isRequired,
optimisticToggle:... | JavaScript | 0.000001 | @@ -722,17 +722,12 @@
en:
-undefined
+null
,%0A%09%7D
|
f5c0a0f2e8206b824620b62e2f5b0cdac4d08331 | set debounce to 2 seconds for accounts | src/js/accounts.js | src/js/accounts.js | console.log('accounts.js');
/**
* A single account the user has authorized
*/
window.Account = Backbone.Model.extend({
url: 'https://alpha-api.app.net/stream/0/users/me',
initialize: function() {
// _.bindAll(this);
},
parse: function(response) {
return response.data;
}
});
/**
* Collecti... | JavaScript | 0 | @@ -2428,9 +2428,9 @@
%7D,
-5
+2
000)
|
07cd1e5de704816df7ec15f95816b1c88841ce7e | Fix tests | src/js/app.spec.js | src/js/app.spec.js | import test from 'tape';
import app from './app';
test('App()', (t) => {
const should = 'Should return greeting';
const actual = app('me');
const expected = 'Hello me!';
t.equal(actual, expected, should);
t.end();
});
| JavaScript | 0.000003 | @@ -22,157 +22,177 @@
e';%0A
-import app from './app';%0A%0Atest('App()', (t) =%3E %7B%0A const should = 'Should return greeting';%0A const actual = app('me');%0A const expected = 'Hello me!
+%0Atest('No tests initiated yet', (t) =%3E %7B%0A const should = 'No tests initiated yet';%0A const actual = 'No tests ini... |
3e5dde05493219faec9694cdf76ebce25c475835 | add API to get radian values from theme values sppecified in degrees | src/js/core/lib.js | src/js/core/lib.js |
import { Color, FileLoader, EventDispatcher } from '../Three';
import { x18n } from '../3rdParty/x18n';
import { lang_en } from './default-lang';
import { defaultTheme } from './defaultTheme';
const environment = new Map();
const themeColors = new Map();
// setup default language
x18n.register( 'en', lang_en );
x18... | JavaScript | 0 | @@ -37,16 +37,31 @@
spatcher
+, Math as _Math
%7D from
@@ -1891,24 +1891,132 @@
alue;%0A%0A%0A%7D;%0A%0A
+Cfg.themeAngle = function getThemeAngle ( name ) %7B%0A%0A%09return _Math.degToRad( Cfg.themeValue ( name ) );%0A%0A%7D;%0A%0A
Cfg.treeValu
|
71fd14452b4e6f584e937c17666f4e669ac8bd25 | Fix total when the entered amount is blank | src/js/tabs/usd.js | src/js/tabs/usd.js | var util = require('util'),
Tab = require('../client/tab').Tab;
var UsdTab = function ()
{
Tab.call(this);
};
util.inherits(UsdTab, Tab);
UsdTab.prototype.tabName = 'usd';
UsdTab.prototype.mainMenu = 'fund';
UsdTab.prototype.angularDeps = Tab.prototype.angularDeps.concat(['qr']);
UsdTab.prototype.generateHtm... | JavaScript | 0.000084 | @@ -611,29 +611,114 @@
if
+
(!$
-scope.usdA
+id.loginStatus) return $id.goId();%0A%0A%0A $scope.calculate = function(amount) %7B%0A if(!a
mount)%7B%0A
@@ -713,16 +713,18 @@
mount)%7B%0A
+
@@ -739,32 +739,34 @@
ee = 0;%0A
+
$scope.total = 0
@@ -771,109 +771,37 @@
0;%0A
... |
224f841c47fece2683057b1f756d8cd7e51fd12e | USD Fund: usernameProposal should be the username | src/js/tabs/usd.js | src/js/tabs/usd.js | var util = require('util'),
Tab = require('../client/tab').Tab;
var UsdTab = function ()
{
Tab.call(this);
};
util.inherits(UsdTab, Tab);
UsdTab.prototype.tabName = 'usd';
UsdTab.prototype.mainMenu = 'fund';
UsdTab.prototype.angularDeps = Tab.prototype.angularDeps.concat(['qr']);
UsdTab.prototype.generateHtm... | JavaScript | 0.997925 | @@ -2617,59 +2617,39 @@
l: $
-id.account, // TODO use ripple name when applicable
+scope.userCredentials.username,
%0A
|
c139da56bb7f1c95132f1e5a7c1f1e48da5978f0 | Fix server.listen argument | express-server/server.js | express-server/server.js | var config = require('./config');
var express = require('express'),
logger = require('morgan'),
cookieParser = require('cookie-parser'),
bodyParser = require('body-parser'),
mongoose = require('mongoose'),
http = require('http'),
swaggerUi = require('swagger-ui-express');
var app = express();... | JavaScript | 0.000002 | @@ -1580,14 +1580,8 @@
ort,
- () =%3E
con
@@ -1589,17 +1589,17 @@
ole.log(
-%60
+'
API runn
@@ -1619,10 +1619,12 @@
ost:
-$%7B
+' +
conf
@@ -1634,10 +1634,8 @@
port
-%7D%60
));%0A
|
0e7be718a56356540b102d9196868f358c69d0ed | Update number.js | lib/assets/javascripts/do/helpers/number.js | lib/assets/javascripts/do/helpers/number.js | // head = document.querySelector('head');
// math = document.createElement('script');
// math.src = 'https://rawgit.com/home-labs/do-rails/master/lib/assets/javascripts/do/helpers/math.js';
// head.appendChild(math);
// Para futuras implementações, como retorno de fatores primos de determinado valor, podemos usar um... | JavaScript | 0.000006 | @@ -174,20 +174,22 @@
helpers/
-math
+number
.js';%0A%0A/
|
ce1fdc238cda36e2d274c075abb4fafba0051de4 | Format RAM device size with base-2 unit | pkg/systemd/hw-detect.js | pkg/systemd/hw-detect.js | /*
* This file is part of Cockpit.
*
* Copyright (C) 2018 Red Hat, Inc.
*
* Cockpit is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any l... | JavaScript | 0 | @@ -2939,16 +2939,22 @@
morySize
+, 1024
);%0A
|
2a180ba552c5532dc6aad55b7257079f209bd7e5 | Enable custom header comments | tasks/sass_compile_imports.js | tasks/sass_compile_imports.js | /*
* grunt-sass-compile-imports
* https://github.com/bmds/grunt-sass-compile-imports
*
* Copyright (c) 2014 Barney Scott
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
grunt.registerMultiTask('sass_compile_imports', 'Create an import file by scanning a directory for SA... | JavaScript | 0 | @@ -347,48 +347,160 @@
-var importFiles = %5B%0A // Header%0A
+%0A var files = this.filesSrc;%0A var options = this.options(%7B%0A quiet: false,%0A replace: false,%0A header: %5B%0A
@@ -501,24 +501,27 @@
%0A
+
'// This fil
@@ -556,24... |
83a702e0b6a0ebc224eeedefa44d90bc64c8ce0d | Use live API URL | assets/js/ja-jobs.js | assets/js/ja-jobs.js | (function(window) {
var numberOfJobs = 4;
var path = '/jobs?include=company,category,hourly-pay'
var pageParam = '&page' + encodeURIComponent('[') + 'size' + encodeURIComponent(']') + '=' + numberOfJobs;
// var filterParam = '&filter' + encodeURIComponent('[') + 'hidden' + encodeURIComponent(']') + '=true';
v... | JavaScript | 0.000001 | @@ -439,24 +439,27 @@
e/api/v1';%0A
+ //
var baseURL
|
2d0b5ed96e2b173670e3c1ee9630624d08107588 | Remove page reload in pwa.js. | assets/js/src/pwa.js | assets/js/src/pwa.js | /* eslint no-console:off */
(function setupSW() {
'use strict'
if ('serviceWorker' in navigator) {
window.addEventListener('load', function () {
navigator.serviceWorker.register('/sw.js').then(function (registration) { // eslint-disable-line compat/compat
console.log('ServiceWorker registration ... | JavaScript | 0.000004 | @@ -363,540 +363,8 @@
pe)%0A
- registration.onupdatefound = function () %7B%0A var installingWorker = registration.installing%0A installingWorker.onstatechange = function () %7B%0A switch (installingWorker.state) %7B%0A case 'installed':%0A if (navigator.... |
e7241c1a1a173b73245d2a094aa8959220d0982d | Update db.js | src/db.js | src/db.js | const mysql = require('mysql')
const connection = mysql.createConnection({
host : process.env.db_host,
user : process.env.db_user,
password : process.env.db_password,
database : process.env.db_name
})
function start() {
connection.connect()
}
function end() {
connection.end()
}
function query(sql, par... | JavaScript | 0.000001 | @@ -1484,32 +1484,59 @@
e.account_id = ?
+ and e.restaurant_id = r.id
;'%0A%09query(sql, p
@@ -5363,8 +5363,9 @@
teItem%0A%7D
+%0A
|
42dfa7640cda80b620aeb3df3a3251fc39c9e10e | Drop CommonJS. Correctly declare dependencies | src/hx.js | src/hx.js | (function(window, document, $, ko) {
(function(factory) {
// Support three module loading scenarios
if (typeof require === "function" && typeof exports === "object" && typeof module === "object") {
// [1] CommonJS/Node.js
factory(module["exports"] || exports);
} else ... | JavaScript | 0.00002 | @@ -23,15 +23,8 @@
ment
-, $, ko
) %7B%0A
@@ -60,258 +60,8 @@
-// Support three module loading scenarios%0A if (typeof require === %22function%22 && typeof exports === %22object%22 && typeof module === %22object%22) %7B%0A // %5B1%5D CommonJS/Node.js%0A factory(module%5B%22exports%2... |
ff1168a2e59b269486ef587018d4705dd80c75f7 | Update install / use to follow provide/inject key model. | src/v3.js | src/v3.js | import {reactive} from 'vue';
import Auth from './auth.js';
// NOTE: Create pseudo Vue object for Vue 2 backwards compatibility.
function Vue (obj) {
var data = obj.data();
this.state = reactive(data.state);
}
Auth.prototype.install = function (app) {
app.auth = this;
app.config.globalPropertie... | JavaScript | 0 | @@ -1,12 +1,41 @@
+import %7Binject %7D from 'vue'%0A
import %7Breac
@@ -68,16 +68,18 @@
uth
+
from './
@@ -89,16 +89,41 @@
h.js';%0A%0A
+const authKey = 'auth';%0A%0A
// NOTE:
@@ -313,16 +313,21 @@
ion (app
+, key
) %7B%0A
@@ -330,27 +330,45 @@
app.
-auth =
+provide(key %7C%7C authKey,
this
+... |
b092219e596163b07c0429b282a88c321f089d31 | remove debug | ui/tournament/src/sound.js | ui/tournament/src/sound.js | var countDownTimeout;
function doCountDown(seconds) {
console.log(seconds);
return function() {
$.sound['countDown' + seconds]();
if (seconds > 0) countDownTimeout = setTimeout(
doCountDown(seconds - 1),
1000);
};
}
module.exports = {
end: function(data) {
if (!data.me) return;
if ... | JavaScript | 0.000002 | @@ -52,32 +52,8 @@
) %7B%0A
- console.log(seconds);%0A
re
|
868bf4f0eafc0600687303096f9a83e787506123 | Remove a print statement. | js/server/modules/org/arangodb/cluster/dispatcher.js | js/server/modules/org/arangodb/cluster/dispatcher.js | /*jslint indent: 2, nomen: true, maxlen: 120, sloppy: true, vars: true, white: true, plusplus: true, stupid: true */
/*global module, require, exports, ArangoAgency, SYS_TEST_PORT */
////////////////////////////////////////////////////////////////////////////////
/// @brief Cluster startup functionality by dispatchers... | JavaScript | 0.000682 | @@ -2117,57 +2117,8 @@
%7D%0A
- print(%22dispatcher called, myname is %22,myname);%0A
va
@@ -2850,37 +2850,8 @@
h%22;%0A
- print(%22sending %22,url);%0A
|
515f51078424b6ed54033f3e892cbd346d5ad3a6 | Make formatting a little less unbearable | enable-text-selection.js | enable-text-selection.js | // Note: Should be coverted to a bookmarklet with http://ted.mielczarek.org/code/mozilla/bookmarklet.html
// because it properly ignores comments, unlike http://mrcoles.com/bookmarklet/
(function(){
function allowTextSelection(){
var styles='*,p,div{user-select:text !important;-moz-user-select:text !important;-webk... | JavaScript | 0.00142 | @@ -219,24 +219,25 @@
tSelection()
+
%7B%0A var styl
@@ -419,34 +419,36 @@
window.console
+
&&
+
console.log('all
@@ -462,24 +462,27 @@
election');%0A
+ %0A
var allowN
@@ -523,16 +523,19 @@
e;%0A %7D;%0A
+ %0A
window
@@ -534,34 +534,36 @@
window.console
+
&&
+
console.log('Ele
@@ -963,34 +9... |
180ebc9737f88bd494566e3c38b1a9b270ea0e6a | Update manifest.js | api/manifest.js | api/manifest.js | var config = require('./config');
var formatError = require('./src/lib/format-error');
var fetchKeystores = require('./src/lib/fetch-keystores');
var ioc = require('electrolyte');
ioc.use(ioc.dir('src/lib'));
ioc.use(ioc.dir('src/application'));
module.exports = Promise.all([
ioc.create('bookshelf'),
ioc.create('... | JavaScript | 0.000001 | @@ -1236,60 +1236,8 @@
: %7B%0A
- issuer : 'https://replaceme.synsit.es',%0A
|
7c7c09d841b1e75f04a5604eef3424cc4146aca0 | Add additional deepEqual() torture tests. | test/assertTheUnexpected.js | test/assertTheUnexpected.js | var assert = require('../lib/assertTheUnexpected');
var expect = require('unexpected');
describe('assertTheUnexpected', function () {
describe('deepEqual', function () {
it('should compare objects with loosely equal property (lhs)', function () {
expect(function () {
assert.deepEqual({ a: 1 }, { a:... | JavaScript | 0 | @@ -922,32 +922,820 @@
error');%0A %7D);
+%0A%0A it('should compare date and array', function () %7B%0A expect(function () %7B%0A assert.deepEqual(new Date(), %5B%5D);%0A %7D, 'not to error');%0A %7D);%0A%0A it('should compare date and object', function () %7B%0A expect(function () %7... |
d04d17337bc57241f789d3cde42befe5aa25967d | Fix path problem | test/bin/less-index.test.js | test/bin/less-index.test.js | const {resolve} = require('path');
const {execFile} = require('child_process');
const tape = require('tape-catch');
const curry = require('1-liners/curry');
const plus = require('1-liners/plus');
const spawn = require('tape-spawn');
const title = curry(plus)('The CLI tool: ');
const lessIndex = resolve(__dirname, '.... | JavaScript | 0.000128 | @@ -1735,16 +1735,17 @@
wn(is, %60
+%22
$%7BlessIn
@@ -1752,13 +1752,11 @@
dex%7D
+%22
a
-.js
%60, %7B
|
2ab7660cffcf34c380bc31c1512201da245d94bc | add list api | api/v1/event.js | api/v1/event.js | var express = require('express')
var router = express.Router()
var Event = require('../../models/event')
router.post('/create',function(req,res){
var e = new Event({
category: req.body.category,
action: req.body.action,
opt_label: req.body.opt_label,
opt_value: req.body.opt_value
... | JavaScript | 0.000751 | @@ -591,16 +591,21 @@
r.get('/
+view/
:id', fu
@@ -659,19 +659,31 @@
id,
-'-_id -__v'
+%7B_id: false,__v: false%7D
,fun
@@ -922,16 +922,22 @@
r.get('/
+events
', funct
@@ -954,41 +954,374 @@
s)%7B%0A
+%0A
-res.send('event index page');
+var page = req.query.page %7C%7C 1%0A var pageSize = req.query.pag... |
850d8d3e006672cbe7c4c967f9a633e4f6eac38b | refactor sni test | test/config-https-sni.test.js | test/config-https-sni.test.js | const assert = require('assert');
const fs = require('fs');
const tls = require('tls');
const path = require('path');
const config = require('../lib/config');
const testHelper = require('./common/routing.helper');
const testCases = [{
clientOptions: {
testTitle: 'should connect to a.example.com but fail to verif... | JavaScript | 0.002252 | @@ -3462,24 +3462,25 @@
%7D);%0A
+%0A
serv
@@ -3776,24 +3776,51 @@
le, () =%3E %7B%0A
+ beforeEach(() =%3E %7B%0A
server
@@ -3829,24 +3829,26 @@
ror = null;%0A
+
server
@@ -3858,24 +3858,35 @@
ult = null;%0A
+ %7D);%0A%0A
option
@@ -5006,16 +5006,17 @@
;%0A %7D)... |
4da5b4f7887fbdeab23a74150f9ff1dd0b6b667b | Clean backbone formatter test. | test/formatters/backbone.js | test/formatters/backbone.js | 'use strict';
var chai = require('chai');
var expect = chai.expect;
var Bookshelf = require('bookshelf');
var bookshelf = Bookshelf.initialize({
client: 'sqlite',
connection: {
filename: ':memory:'
},
pool: {
max: 1
}
});
var backboneFormatter = require('../../lib/formatters/backbone');
describe('... | JavaScript | 0 | @@ -67,17 +67,17 @@
t;%0A%0Avar
-B
+b
ookshelf
@@ -103,35 +103,8 @@
lf')
-;%0Avar bookshelf = Bookshelf
.ini
@@ -112,18 +112,16 @@
ialize(%7B
-%0A
client:
@@ -133,86 +133,13 @@
ite'
-,%0A connection: %7B%0A filename: ':memory:'%0A %7D,%0A pool: %7B%0A max: 1%0A %7D%0A
+
%7D);%0A
-%0A
var
|
838ef0b67962c2e1a7ec3dd29ecf0faa15e5ba04 | remove binary dump dep from lib.transactions test | test/lib.transactions.test.js | test/lib.transactions.test.js | import { expect } from 'chai';
import models, { Op } from '../server/models';
import * as utils from '../test/utils';
import * as tlib from '../server/lib/transactions';
describe('lib.transactions.test.js', () => {
const startDate = new Date("2017-02-01");
const endDate = new Date("2017-03-01");
let transactio... | JavaScript | 0 | @@ -1,12 +1,33 @@
+/* Test utilities */%0A
import %7B exp
@@ -56,88 +56,170 @@
ort
-models, %7B Op %7D from '../server/models';%0Aimport * as utils from '../test/utils';%0A
+* as utils from './utils';%0Aimport * as store from './features/support/stores';%0A%0A/* Support code */%0Aimport models from '../server/models... |
390e9fed3cad4462dc8193b6253c173ca914d931 | resolve bbc services path in test | test/lib/test-bbc-services.js | test/lib/test-bbc-services.js | /* globals describe, it, before */
"use strict";
var chai = require("chai"),
assert = chai.assert,
chaiAsPromised = require("chai-as-promised"),
sinon = require("sinon"),
EventEmitter = require('events').EventEmitter;
var utils = require("radiodan-client").utils;
chai.use(chaiAsPromised);
var BBCSe... | JavaScript | 0.000002 | @@ -341,16 +341,25 @@
/../lib/
+services/
bbc-serv
|
9b69d822680e1dd649e130b4dcac026c5d2cf08d | Update test to account for new buster wiring | test/node/unit/config-test.js | test/node/unit/config-test.js | var helper = require("../test-helper");
var buster = require("buster");
var configHelper = helper.require("config");
var testConfig = require("buster-configuration");
var assert = buster.assert;
var refute = buster.refute;
var version = testConfig.VERSION;
buster.assertions.add("isObject", {
assert: function (obje... | JavaScript | 0 | @@ -1230,9 +1230,9 @@
h, 3
-6
+7
);%0A
@@ -3417,32 +3417,105 @@
r-wiring.js%22));%0A
+ assert.isObject(rs.get(%22/buster/buster/browser-wiring.js%22));%0A
asse
|
9f419829a7eca267771bd80e0f58440355ef3c35 | Refactor { nsnjson.encoder.tests } | test/nsnjson.encoder.tests.js | test/nsnjson.encoder.tests.js | var assert = require("assert");
var Encoder = require('../src/nsnjson.encoder');
var Assets = require('./nsnjson.tests.assets');
describe('Encoder @ encode', function() {
function testEncoding(name, data, presentation) {
it(name, function() {
var actualPresentationMaybe = Encoder.encode(data);
ass... | JavaScript | 0.000002 | @@ -167,16 +167,17 @@
ion() %7B%0A
+%0A
functi
@@ -179,19 +179,21 @@
unction
-tes
+asser
tEncodin
@@ -530,19 +530,21 @@
%5D;%0A%0A
-tes
+asser
tEncodin
@@ -594,11 +594,12 @@
n);%0A %7D%0A
+%0A
%7D);
|
f4657da415974075949345633e1463aaa0329005 | fix test | test/proxy/httpserver.test.js | test/proxy/httpserver.test.js | var assert = require('assert');
var request = require('request');
var http = require('http');
var path = require('path');
var Proxy = require('../../src/index');
var testServer = require('./server');
describe('#http server', function(){
var proxy_server;
before(function () {
testServer.listen(61234);
... | JavaScript | 0.000002 | @@ -1278,21 +1278,25 @@
if(body
- ===
+.indexOf(
'http://
@@ -1321,16 +1321,24 @@
xy.pac')
+ !== -1)
%7B%0A
|
8352c68d5ddb08502470fa88dd5073209bf507cd | Use getAnnotationElements utility where not used in the test cases (#757) | test/specs/annotation.spec.js | test/specs/annotation.spec.js | describe('Annotation plugin', function() {
it('should emit console warning when unknown element type is used', function() {
const origWarn = console.warn;
console.warn = jasmine.createSpy('warn');
acquireChart({
type: 'line',
options: {
plugins: {
annotation: {
a... | JavaScript | 0 | @@ -3651,37 +3651,39 @@
%7D);%0A const
-state
+element
= window%5B'chart
@@ -3679,92 +3679,37 @@
ndow
-%5B'chartjs-plugin-annotation'%5D._getState(chart);%0A const element = state.elements
+.getAnnotationElements(chart)
%5B0%5D;
@@ -4405,37 +4405,39 @@
%7D);%0A const
-state
+element
= window%5B... |
2d34dad599136a883e42b0258bd9e38f570d6345 | Fix topojson-command-test on Linux. | test/topojson-command-test.js | test/topojson-command-test.js | var fs = require("fs"),
child = require("child_process"),
vows = require("vows"),
assert = require("./assert");
var suite = vows.describe("bin/topojson");
suite.addBatch({
"Polygons": testConversion(
"polygon",
"-- polygon=test/geojson/polygon-clockwise.json"
),
"Polygons with --no-force-cl... | JavaScript | 0 | @@ -3386,16 +3386,27 @@
options
+ + %22 %7C cat%22
, functi
|
036fc05e3f27bae575b5401e3bf2395bc3cd9ffd | Use `Modernizr.canvastext` instead of reinventing the wheel in the emoji feature detect. | feature-detects/emoji.js | feature-detects/emoji.js | Modernizr.addTest('emoji', function() {
var node = document.createElement('canvas');
if (!(node.getContext && node.getContext('2d'))) return false;
var ctx = node.getContext('2d');
ctx.textBaseline = "top";
ctx.font = "32px Arial";
ctx.fillText("😃", 0, 0);
return ctx.getImageData(16, 16, 1, 1).data[0] !=... | JavaScript | 0 | @@ -1,43 +1,200 @@
-Modernizr.addTest('emoji', function() %7B
+// Requires a Modernizr build with %60canvastest%60 included%0A// http://www.modernizr.com/download/#-canvas-canvastext%0AModernizr.addTest('emoji', function() %7B%0A if (!Modernizr.canvastext) return false;
%0A v
@@ -239,80 +239,15 @@
as')
-;%0A if (!... |
f01d2fd47f04b503ee61e8aa6066d21d511fff9f | complete the test coverage for librarySchedule.js | test/utils/librarySchedule.js | test/utils/librarySchedule.js | /*jshint expr: true*/
var rewire = require('rewire');
var nock = require('nock');
var librarySchedule = rewire('../../utils/librarySchedule.js');
var Code = require('code');
var Lab = require('lab');
var lab = exports.lab = Lab.script();
var expect = Code.expect;
var describe = lab.experiment;
var it = lab.test;
... | JavaScript | 0.000001 | @@ -3085,32 +3085,351 @@
e();%0A %7D);%0A%0A
+ librarySchedule.update(%7Blogger: mockLogger%7D);%0A %7D);%0A%0A it('should log an error if there is an HTTP error', function (done) %7B%0A var mockLogger = function (logMsg) %7B%0A expect(logMsg).to.equal('updateScheduleAsync error: Nock: Not ... |
f35e46ee6945fc8eac6b5a021c59d8ab2adbaa57 | Remove TODO | finder/static/js/demo.js | finder/static/js/demo.js | var geocoder = new google.maps.Geocoder(),
map,
marker,
featureGroup,
representativeTemplate = _.template( // @todo Replace this one underscore dependency.
'<div class="col-xs-6 col-sm-4 col-md-2 representative">' +
'<div class="avatar" style="background-image: url(<% if (photo_url) { %><%... | JavaScript | 0.000004 | @@ -123,30 +123,24 @@
//
-@todo Replace this one
+This is the only
und
|
f7ed204be71b6d1123740d4d58d2ac4729e28bf8 | fix members show normalizes when no notes object available | lib/modules/shows/normalizer/members.js | lib/modules/shows/normalizer/members.js | export default (shows = []) =>
shows.map(show => ({
id: show.id,
infos: {
note: show.notes.user,
...show.user
}
}));
| JavaScript | 0 | @@ -89,16 +89,17 @@
note:
+(
show.not
@@ -100,16 +100,23 @@
ow.notes
+ %7C%7C %7B%7D)
.user,%0A
|
48debf2720631f799f616553979a1cd9178300e3 | Allow guardians to be up to 80 years old. | evently/grdedit/loggedIn/after.js | evently/grdedit/loggedIn/after.js | function() {
$("#app_date").dateinput({
format: 'yyyy-mm-dd',
selectors: true,
min: -300,
max: 1,
speed: 100
});
$("#birth_date").dateinput({
format: 'yyyy-mm-dd',
selectors: true,
yearRange: [-70,-13],
speed: 100
});
$("#flight_confirmed_date").dateinput({
format: '... | JavaScript | 0 | @@ -227,17 +227,17 @@
ange: %5B-
-7
+8
0,-13%5D,%0A
|
ddd2307e6af6dcc3c4485b99e9fe1a01e817d663 | Fix cypress playlist test (there are 0 to begin with) xibosignage/xibo#1512 | cypress/integration/playlists_spec.js | cypress/integration/playlists_spec.js | describe('Playlists Admin', function () {
var testRun = Cypress._.random(0, 1e6);
beforeEach(function () {
cy.login();
});
it('should show a list of Playlists', function () {
cy.visit('/playlist/view');
cy.contains('Playlists');
cy.contains('Showing 1 to');
});
... | JavaScript | 0.000001 | @@ -269,46 +269,8 @@
s');
-%0A%0A cy.contains('Showing 1 to');
%0A
@@ -643,16 +643,54 @@
ylist');
+%0A%0A cy.contains('Showing 1 to');
%0A %7D);
|
22a071735269e7650b92a3b6ff782332ccc76c1b | Update 'go to' step to use Cucumber Expressions | lib/step_definitions/GeneralStepDefs.js | lib/step_definitions/GeneralStepDefs.js | var {defineSupportCode} = require('cucumber');
defineSupportCode(function({Given, When, Then, setWorldConstructor}) {
setWorldConstructor(require('../support/World').World);
Given('I am ready to test all this (covered by ready.spec.js)', function (callback) {
// Write code here that turns the phrase above int... | JavaScript | 0 | @@ -378,23 +378,20 @@
Given(
-/%5E
+'
I (
-?:
am on%7Cgo
@@ -399,32 +399,53 @@
to) the
-%22(%5B%5E%22%5D*)%22
+%7BpageName:stringInDoubleQuotes%7D
page
-$/
+'
, functi
|
176471fade0a62367cbf7facbba4db3b42050bd5 | add styles object to get lightbox working | src/Gallery.js | src/Gallery.js | import React from 'react';
import ReactDOM from 'react-dom';
import Lightbox from 'react-images';
import _ from 'lodash';
var Gallery = React.createClass({
displayName: 'Gallery',
getInitialState: function(){
return {
containerWidth: this.props.containerWidth
}
},
componentDidMount: funct... | JavaScript | 0 | @@ -3392,16 +3392,47 @@
%7D%0A
+%09console.log(this.props.data);%0A
%09return(
@@ -3926,17 +3926,16 @@
%7D%0A%0A%7D);%0A
-%0A
const st
@@ -3942,13 +3942,147 @@
yles
-=%7B%0A%0A%7D
+ = Lightbox.extendStyles(%7B%0A backdrop: %7B%0A backgroundColor: 'rgba(0,0,0,1)',%0A %7D,%0A dialog:%7B%0A ... |
95b10d1dbf19973c00253468ee175561347a1cd0 | Remove unused test in snapshot model | live/tests/unit/models/snapshot-test.js | live/tests/unit/models/snapshot-test.js | import {expect} from 'chai';
import {describe, it} from 'mocha';
import {setupModelTest} from 'ember-mocha';
describe('Snapshot', function() {
setupModelTest('snapshot', {
// Specify the other units that are required for this test.
needs: []
});
// Replace this with your real tests.
it('exists', funct... | JavaScript | 0 | @@ -176,128 +176,24 @@
-// Specify the other units that are required for this test.%0A needs: %5B%5D%0A %7D);%0A%0A // Replace this with your real tests.
+needs: %5B%5D%0A %7D);%0A
%0A i
@@ -255,41 +255,8 @@
();%0A
- // var store = this.store();%0A
|
2c915f0281f8475331025f992ad9098c79a01e1a | Fix getTime | src/Message.js | src/Message.js | /* eslint react-native/no-inline-styles: 0 */
import PropTypes from 'prop-types';
import React from 'react';
import { View, ViewPropTypes, StyleSheet } from 'react-native';
import Avatar from './Avatar';
import Bubble from './Bubble';
import SystemMessage from './SystemMessage';
import Day from './Day';
import { isS... | JavaScript | 0.000005 | @@ -998,34 +998,24 @@
xt.createdAt
-.getTime()
;%0A const
@@ -1075,18 +1075,8 @@
edAt
-.getTime()
;%0A
|
027ceb747fee5fd5099b556823855d410294dea0 | Check if we have pubsub instance before subscribing | src/OrbitDB.js | src/OrbitDB.js | 'use strict';
const EventEmitter = require('events').EventEmitter;
const Logger = require('logplease');
const logger = Logger.create("orbit-db", { color: Logger.Colors.Magenta });
const EventStore = require('orbit-db-eventstore');
const FeedStore = require('orbit-db-feedstore');
const KeyValueSto... | JavaScript | 0 | @@ -1949,16 +1949,32 @@
ubscribe
+ && this._pubsub
)%0A
|
3524def90e0491ae328db228e4d1c077e46c80ae | Disable removing node err on state changes | src/Overlay.js | src/Overlay.js | import React from 'react';
import ReactDOM from 'react-dom';
class Overlay extends React.Component {
constructor(props) {
super(props);
}
componentWillUnmount() {
this._unrenderOverlay();
if (this._overlayTarget) {
this.getContainerDOMNode()
.removeChild(this._overlayTarget);
thi... | JavaScript | 0.000001 | @@ -160,32 +160,44 @@
WillUnmount() %7B%0A
+ try %7B%0A
this._unrend
@@ -205,24 +205,42 @@
rOverlay();%0A
+ %7D catch(e) %7B%7D%0A
if (this
|
adbe127e763eb4c1a1cd475b9f19273b64dcc02f | Revert "Update bindonce" | app/assets/javascripts/shared/bindonce.min.js | app/assets/javascripts/shared/bindonce.min.js | !function(){"use strict";var e=angular.module("pasvaz.bindonce",[]);e.directive("bindonce",function(){var e=function(e){if(e&&0!==e.length){var t=angular.lowercase(""+e);e=!("f"===t||"0"===t||"false"===t||"no"===t||"n"===t||"[]"===t)}else e=!1;return e},t=parseInt((/msie (\d+)/.exec(angular.lowercase(navigator.userAgen... | JavaScript | 0 | @@ -2472,58 +2472,8 @@
ase%22
-disabled%22:r.element.prop(%22disabled%22,a);break;case%22
src%22
@@ -2853,30 +2853,16 @@
0%7D%7D;
-angular.extend(this,l)
+return l
%7D%5D,l
@@ -3681,58 +3681,8 @@
me:%22
-boDisabled%22,attribute:%22disabled%22%7D,%7BdirectiveName:%22
boVa
@@ -4775,5 +4775,4 @@
%7D();
-%0A
|
be1c12e2b04ad1c10e83ef9fc1dab2e8ea0e38e3 | replaced DGS string with Marketplace | app/plugins/transaction/transactions/goods.js | app/plugins/transaction/transactions/goods.js | // goods
(function () {
'use strict';
var module = angular.module('fim.base');
module.run(function (plugins, modals, $q, $rootScope, nxt) {
var plugin = plugins.get('transaction');
// Add Goods
plugin.add({
label: 'Devious Item',
id: 'dgsListing',
exclude: true,
execute: function (senderRS, a... | JavaScript | 0.999949 | @@ -447,27 +447,35 @@
: 'Create a
-DGS
+Marketplace
item with n
@@ -2188,27 +2188,35 @@
: 'Delete a
-DGS
+Marketplace
item with n
@@ -2794,11 +2794,19 @@
e a
-DGS
+Marketplace
ite
|
52edc25f3f65ef6265fcff27f404337f59fb5bb3 | Update angular-github-repo.js | javascript/angular-github-repo.js | javascript/angular-github-repo.js | /**
* GitHub Repository service and directive for AngularJS
* @version v0.0.1
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
'use strict';
angular.module('githubRepo', [])
.factory('GitHubRepo', function ($http, $q) {
var githubApi = 'https://api.github.com/repos/';
var github = 'htt... | JavaScript | 0.000004 | @@ -814,16 +814,17 @@
his.name
+;
%0A %7D%0A%0A
@@ -3258,12 +3258,13 @@
%7D;%0A %7D);
+%0A
|
40ede9ce6ea8978fca95e28200f34024c20226eb | Slideshow array is empty | javascript/directive/slideshow.js | javascript/directive/slideshow.js | /**
* Created by mallanic on 25/03/16.
*/
(function () {
'use strict';
angular.module('hos-framework')
.directive('slider', slider);
slider.$inject = ['$q', '$templateRequest', '$animate', '$compile', '$timeout', '$icon', '$onLoad', '$handle', '$media'];
function slider($q, $templateRequest, ... | JavaScript | 0.998621 | @@ -4212,24 +4212,124 @@
q.defer();%0A%0A
+ if (!Array.isArray($scope.slider))%0A $scope.slider = %5B%5D;%0A%0A
@@ -4413,16 +4413,23 @@
if (
+$scope.
slider.l
|
c3cc6340775814aa5a32a74daf83f215e1060cf2 | Stop drawing when window is hidden/closed | ro-tercera-component/RoComment.js | ro-tercera-component/RoComment.js | /*
* Copyright (C) 2012-2014 B3Partners B.V.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program... | JavaScript | 0.000001 | @@ -3905,16 +3905,17 @@
'hide',
+%0A
@@ -3910,32 +3910,245 @@
e',%0A
+listeners:%7B%0A hide:%7B%0A scope:this,%0A fn: function()%7B%0A this.vectorLayer.stopDrawing();%0A %7D%0A %7D%0A ... |
fde2e4930f0c7ae5eb50fba7890d4e1861cd3708 | fix MarkerSpec | test/geometry/MarkerSpec.js | test/geometry/MarkerSpec.js | describe('#Marker', function() {
var container;
var map;
var tile;
var center = new maptalks.Coordinate(118.846825, 32.046534);
var canvasContainer;
var layer;
beforeEach(function() {
var setups = commonSetupMap(center);
container = setups.container;
map = setups.ma... | JavaScript | 0 | @@ -2247,34 +2247,16 @@
kerFile:
- maptalks.prefix +
'images
@@ -5185,34 +5185,16 @@
erFile :
- maptalks.prefix +
'images
@@ -5941,26 +5941,8 @@
le :
- maptalks.prefix +
'im
|
49525c12c72e55ce90181eb6c9c6861a7a7e46a7 | update TileLayerSpec | test/layer/TileLayerSpec.js | test/layer/TileLayerSpec.js | describe('#TileLayer', function() {
var container;
var map;
var center = new Z.Coordinate(118.846825, 32.046534);
beforeEach(function () {
container = document.createElement('div');
container.style.width = '10px';
container.style.height = '10px';
document.body.appendChi... | JavaScript | 0 | @@ -741,72 +741,14 @@
late
-:%22http://t%7Bs%7D.tianditu.com/DataServer?T=vec_w&x=%7Bx%7D&y=%7By%7D&l=%7Bz%7D%22
+ : '#'
,%0A
@@ -776,17 +776,20 @@
ins:
- %5B1, 2, 3
+%5B'a','b','c'
%5D%0A
@@ -1674,71 +1674,11 @@
ate:
-%22http://t%7Bs%7D.tianditu.com/DataServer?T=vec_c&x=%7Bx%7D&y=%7By%7D&l=%7Bz%7D%22
+'#'
,%... |
b304485366645178c3beeb1c00648148b757b9cc | update tests fis-conf | tests/fisp-module/fis-conf.js | tests/fisp-module/fis-conf.js | fis.config.merge({
namespace: 'fisp-test',
deploy: {
test: {
//from参数省略,表示从发布后的根目录开始上传
//发布到当前项目的上一级的output目录中
to: '../output'
}
},
modules: {
preprocessor: {
tpl: 'fispadaptor'
}
},
// pack : {
// 'static/pk... | JavaScript | 0 | @@ -1,8 +1,75 @@
+fis.config.get('modules.preprocessor.tpl').unshift('fispadaptor')%0A%0A
fis.conf
@@ -260,95 +260,8 @@
%7D,%0A
- modules: %7B%0A preprocessor: %7B%0A tpl: 'fispadaptor'%0A %7D%0A %7D,%0A
|
8c9aeb1c3ba6a0b439f3ff86c01c95934e8e84d6 | Change appPath | app/memcing.js | app/memcing.js | /*
* Memcing
* Copyright (c) 2014 Fatih Cetinkaya (http://github.com/cmfatih/memcing)
* For the full copyright and license information, please view the LICENSE.txt file.
*/
// Init reqs
/* jslint node: true */
'use strict';
var utilex = require('utilex'),
fs = require('fs'),
init = require('./init')... | JavaScript | 0.000001 | @@ -279,24 +279,54 @@
uire('fs'),%0A
+ path = require('path'),%0A
init =
@@ -531,16 +531,26 @@
athSync(
+path.join(
__dirnam
@@ -554,17 +554,15 @@
name
- +
+,
'
-/
..
-/
'
+)
)%7D,%0A
|
647993597863fabf42d763995da49080b8531eef | missed a spot | test/providers/amplitude.js | test/providers/amplitude.js | describe('Amplitude', function () {
describe('initialize', function () {
this.timeout(10000);
it('should call ready and load library', function (done) {
expect(window.amplitude).to.be(undefined);
var spy = sinon.spy();
analytics.ready(spy);
analytics.initialize({ 'Amplitude' : tes... | JavaScript | 0.9988 | @@ -426,68 +426,8 @@
ed);
-%0A expect(window.amplitude.sendEvents).to.be(undefined);
%0A%0A
|
a6390969071c2764c181e2e79e497936c792adb3 | Allow to set components directly in application objects, instead of only through createComponent | application.js | application.js | /**
*
* Created by Freddy Snijder on 22/01/15.
*
*/
(function() {
//Add to Visionscapers namespace
var NS = window.__VI__ || window;
var _ = NS.utils;
var _l = NS.logger;
var Class = window.jsface.Class;
var NamedBase ... | JavaScript | 0 | @@ -6642,32 +6642,164 @@
nt;%0A %7D,%0A%0A
+ setComponent : function(componentName, component) %7B%0A this._MVCComponents%5BcomponentName%5D = component;%0A %7D,%0A%0A
getCompo
|
6a8f8a5c61d92aac03ea1043f2ac421693d0dbaf | remove background color function from statsTable | application.js | application.js | if (Meteor.isClient) {
WinChart = new Mongo.Collection("winChart");
HeroClasses = new Mongo.Collection("heroClasses");
function formatDate(date) {
var hours = date.getHours();
var minutes = date.getMinutes();
var ampm = hours >= 12 ? 'pm' : 'am';
hours = hours % 12;
hours = hours ? hours : 12... | JavaScript | 0.000001 | @@ -3621,622 +3621,8 @@
%7D,%0A
- getBackgroundColor: function(myClass, oppClass) %7B%0A var winCount = WinChart.find(%7BmyClass: myClass, oppClass: oppClass, result: %22Win%22%7D).count();%0A var lossCount = WinChart.find(%7BmyClass: myClass, oppClass: oppClass, result: %22Loss%22%7D).count();%0A v... |
aed4f12aa6d6702a457368b4158d7587883f04a6 | update Tip | src/Tip/Tip.js | src/Tip/Tip.js | /**
* @file Tip component
* @author liangxiaojun(liangxiaojun@derbysoft.com)
*/
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import TriggerPop from '../_TriggerPop';
import Theme from '../Theme';
import Position from '../_statics/Position';
impo... | JavaScript | 0 | @@ -1504,24 +1504,57 @@
e(Theme)),%0A%0A
+ parentEl: PropTypes.object,%0A%0A
/**%0A
@@ -2871,16 +2871,46 @@
.DARK,%0A%0A
+ parentEl: document.body,%0A%0A
visi
|
224cd8e51d184e4ed2f4ac79e11e35f3d9b87cd6 | Remove helpers with localStorage in browser tests | test/spec/upload.browser.js | test/spec/upload.browser.js | /* global FakeBlob tus */
var hasStorage = tus.canStoreURLs || true;
function expectLocalStorage(key, expectedValue) {
if (!hasStorage) {
// Do not evaluate expectations on localStorage in node processes
return;
}
expect(localStorage.getItem(key), expectedValue);
}
function setLocalStorage(key, value)... | JavaScript | 0 | @@ -24,617 +24,8 @@
*/%0A%0A
-var hasStorage = tus.canStoreURLs %7C%7C true;%0A%0Afunction expectLocalStorage(key, expectedValue) %7B%0A if (!hasStorage) %7B%0A // Do not evaluate expectations on localStorage in node processes%0A return;%0A %7D%0A%0A expect(localStorage.getItem(key), expectedValue);%0A%7D%0A%... |
2a18506468e0f0705760ef8f5bf207d1e0eee29b | Update JS behavior to use portable jQuery methods | Snippets/files/snippets.js | Snippets/files/snippets.js | // Copyright 2010 (c) John Reese
// Licensed under the MIT license
$(document).ready(function() {
var SnippetsLangArray = null;
/**
* Handle retrieving and storing language strings from the server.
*/
function SnippetsLang(str) {
if (SnippetsLangArray == null) {
xhr = $.ajax({
async: false,
... | JavaScript | 0 | @@ -61,17 +61,22 @@
icense%0A%0A
-$
+jQuery
(documen
@@ -89,24 +89,25 @@
dy(function(
+$
) %7B%0A%09%09var Sn
|
3ec3475761ac733d1ea672eb00211bf432dcbee6 | Fix bundling in aureliafile | aureliafile.js | aureliafile.js | var aurelia = require('aurelia-cli');
aurelia.command('bundle', {
js: {
"dist/app-bundle": {
modules: [
'*',
'aurelia-bootstrapper',
'aurelia-http-client',
'aurelia-router',
'aurelia-animator-css',
'... | JavaScript | 0.000008 | @@ -1120,19 +1120,20 @@
minify:
-tru
+fals
e%0A
@@ -1237,16 +1237,87 @@
/*.html'
+, 'jspm_packages/github/charlespockert/aurelia-bs-grid@0.0.1/**/*.html'
%5D,%0A
|
1b35b487bf37db2dc32c529a73675fec1322b79b | add desc | Algorithms/JS/graphs/dijkstrasShortestPath.js | Algorithms/JS/graphs/dijkstrasShortestPath.js | dijkstrasShortestPath.js
| JavaScript | 0.000001 | @@ -1,25 +1,1442 @@
-dijkstrasShortestPath.js
+// Dijkstra%E2%80%99s algorithm we generate a SPT (shortest path tree) with given source as root.%0A// We maintain two sets, one set contains vertices included in shortest path tree,%0A// other set includes vertices not yet included in shortest path tree.%0A// At every ste... |
e340bd765a9eb4584e8fda4a4e28ca4da651b556 | Improve DatePicker example | examples/datepicker/datepicker.js | examples/datepicker/datepicker.js | require("tabris-datepicker");
var page = tabris.create("Page", {topLevel: true, title: "DatePicker"});
tabris.create("DatePicker", {
layoutData: {left: 0, top: 0}
}).appendTo(page).on("select", function() {
console.log("date selected: " + this.get("date"));
}).on("change:date", function() {
console.log("date pr... | JavaScript | 0 | @@ -98,16 +98,33 @@
er%22%7D);%0A%0A
+var datePicker =
tabris.c
@@ -164,41 +164,33 @@
a: %7B
-left: 0, top: 0%7D%0A%7D).appendTo(page
+centerX: 0, centerY: 0%7D%0A%7D
).on
@@ -361,18 +361,267 @@
ate%22));%0A
-
%7D)
+.appendTo(page);%0A%0Atabris.create(%22Button%22, %7B%0A text: %22Set date to the beginning of t... |
8c7bbabaf97fdee233390c0c66c8cf0e28258a06 | Fix course type selector test | test/components/overview/course_type_selector.spec.js | test/components/overview/course_type_selector.spec.js | import '../../testHelper';
import React from 'react';
import ReactTestUtils, { Simulate } from 'react-addons-test-utils';
import sinon from 'sinon';
import CourseTypeSelector from '../../../app/assets/javascripts/components/overview/course_type_selector.jsx';
describe('CourseTypeSelector', () => {
const course = {
... | JavaScript | 0.000002 | @@ -745,37 +745,32 @@
e: Classroom
+
Program
-Course
');%0A %7D);%0A%0A
|
61fd70d122f97a60b314b9efabee82923a85634f | Add explanation and reference to 'link' plugin on github | plugins/autoid/plugin.js | plugins/autoid/plugin.js | 'use strict';
(function () {
var EVENT_NAMES = {
ALL_IDS_COMPLETE: 'allIdsComplete',
ID_ADDED: 'idAdded',
ID_RETAINED: 'idRetained'
};
CKEDITOR.plugins.add('autoid', {
init: function (editor) {
var self = this;
// This configures the Advanced Content Filter to allow all headings
... | JavaScript | 0 | @@ -4856,32 +4856,296 @@
ter));%0A %7D%0A%0A
+ // This modifies the dialog for the 'link' plugin to allow the option of%0A // internal document linking to autoid headings. Original 'link' plugin%0A // code can be found at:%0A // https://github.com/ckeditor/ckeditor-dev/tree/master/plugins/link... |
6931429267288e0bb5c694954ad321baa3d995be | Bump up sleep to fix flaky test | test/express/integration/hooks/recordsExpire.tests.js | test/express/integration/hooks/recordsExpire.tests.js | // ----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// ----------------------------------------------------------------------------
var expect = require('chai').use(require('chai-subset')).expect,
supertest = require('supertest... | JavaScript | 0 | @@ -1376,16 +1376,17 @@
sleep(10
+0
);%0A
|
e536f612a41d61bb0669313d70c387f495595be7 | Remove unnecessary code | test/specs/features.spec.js | test/specs/features.spec.js | 'use strict'
const vuedoc = require('../..')
const assert = require('assert')
const path = require('path')
/* global describe it */
const FIXTURES_PATH = path.join(__dirname, '../fixtures')
describe('features', () => {
describe('jsdoc', () => {
it('should successfully render with JSDoc tags', () => {
co... | JavaScript | 0.001341 | @@ -1115,114 +1115,8 @@
%7D)%0A
- .then((md) =%3E %7B%0A require('fs').writeFileSync('md.md', md)%0A return md%0A %7D)%0A
|
db15dd05f7b1e8e8fcbbaf71546a7b1f473152a9 | add string | string.js | string.js | /**
* 将字符串拆分成数组
* @param {[type]} str [description]
* @return {[type]} [description]
*/
let str_to_array = function(str){
return str.split('');
}
| JavaScript | 0.999999 | @@ -150,8 +150,109 @@
('');%0A%7D%0A
+%0Alet str_to_array = function (str) %7B%0A return Array.prototype.map.call(str,function(x)%7Breturn x%7D);%0A%7D%0A
|
9b5ae68685f84fa8ba5aadf74ae213fdfaa3660f | Make sk a function calling sk.element() | src/_footer.js | src/_footer.js | })(window.sk = window.sk || {}); | JavaScript | 0.002681 | @@ -12,21 +12,59 @@
k =
-window.sk %7C%7C %7B
+function()%7Breturn sk.element.apply(this, arguments);
%7D);
|
ed996db3c40bcdbf90e060ac3370cd8195e5e829 | Add ttl to error alert | src/actions.js | src/actions.js | import Promise from 'bluebird';
import request from 'superagent';
import Dispatcher from './dispatcher';
import BuildStore from './stores/build-store';
import UserStore from './stores/user-store';
import {BUILDS_RECEIVE, USER_RECEIVE, API_ERROR, ALERT_ADD, ALERT_REMOVE} from './constants';
Promise.promisifyAll(reques... | JavaScript | 0 | @@ -509,78 +509,68 @@
-Dispatcher.handleViewAction(%7B%0A type: ALERT_ADD,%0A alert: %7B%0A
+actions.removeAlert('loading-data');%0A actions.addAlert(%7B%0A
@@ -589,18 +589,16 @@
error',%0A
-
me
@@ -652,18 +652,16 @@
,%0A
-
-
iconClas
@@ -678,24 +678,33 @@
a-times'
+,
%0... |
d94874fde44ae9cbaeebc9281756eae2bd259dda | fix adapter: namespace check for config.qunit changed check on config namespace to check for config.qunit in order to fix unit tests | src/adapter.js | src/adapter.js | function createQUnitConfig (karma, defaultConfig) { // eslint-disable-line no-unused-vars
var config = defaultConfig || {}
if (!karma.config || !karma.config.qunit) {
return config
}
for (var key in karma.config.qunit) {
config[key] = karma.config.qunit[key]
}
return config
}
function createQUni... | JavaScript | 0.000001 | @@ -619,16 +619,30 @@
config =
+ (tc.config &&
tc.conf
@@ -649,16 +649,17 @@
ig.qunit
+)
%7C%7C %7B%7D%0A%0A
|
cf0400d6fab1ea64da7a250137f0d451f5b18315 | set default (empty); | src/angular.js | src/angular.js |
"use strict";
import {Monad} from './Monad';
import {RootController} from './controllers/RootController';
import {HomeController} from './controllers/HomeController';
import {LoginController} from './controllers/LoginController';
import {Navigation} from './services/Navigation';
import {default as normalizePost} from... | JavaScript | 0.000001 | @@ -1994,16 +1994,43 @@
t.css')%0A
+ .value('ckeditor', %7B%7D)%0A
;%0A%0Aw
|
78685760e88b24d94c1d9804f5e67ec8d7e1d11a | Create a source to work around unexported methods | src/app/app.js | src/app/app.js | /**
* Add all your dependencies here.
*
* @require animation.js
*/
var popup = new ol.Overlay({
element: $('#popup')
});
var map = new ol.Map({
overlays: [popup],
target: 'map',
// initial center and zoom of the map's view
view: new ol.View({
center: [40.71448, -74.00598].reverse(),
minZoom: 2,
... | JavaScript | 0 | @@ -794,34 +794,104 @@
);%0A%0A
-$.getJSON('world-110m.json
+var worldSource = new ol.source.TopoJSON(%7B%0A url: 'world-110m.json'%0A%7D);%0AworldSource.once('change
', f
@@ -902,161 +902,169 @@
ion(
-data
) %7B%0A
-var features = new ol.format.TopoJSON().readFeaturesFromObject(data);%0A world.setFeatures(feat... |
b91c7ffb289af1753b9d1d84e16fbfcd34954124 | use http-errors to create errors | examples/params/index.js | examples/params/index.js | 'use strict'
/**
* Module dependencies.
*/
var express = require('../../');
var app = module.exports = express();
// Faux database
var users = [
{ name: 'tj' }
, { name: 'tobi' }
, { name: 'loki' }
, { name: 'jane' }
, { name: 'bandit' }
];
// Create HTTP error
function createError(status, message) {
... | JavaScript | 0.000001 | @@ -40,16 +40,57 @@
s.%0A */%0A%0A
+var createError = require('http-errors')%0A
var expr
@@ -296,142 +296,8 @@
%5D;%0A%0A
-// Create HTTP error%0A%0Afunction createError(status, message) %7B%0A var err = new Error(message);%0A err.status = status;%0A return err;%0A%7D%0A%0A
// C
|
8de9c6c12c3e1ebf05b941add1d659321ea54930 | Add injection for error dialog (#9235) | src/renderers/shared/fiber/ReactFiberErrorLogger.js | src/renderers/shared/fiber/ReactFiberErrorLogger.js | /**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModu... | JavaScript | 0 | @@ -367,16 +367,123 @@
rict';%0A%0A
+const emptyFunction = require('fbjs/lib/emptyFunction');%0Aconst invariant = require('fbjs/lib/invariant');%0A%0A
import t
@@ -531,16 +531,49 @@
uler';%0A%0A
+let showDialog = emptyFunction;%0A%0A
function
@@ -2847,17 +2847,357 @@
);%0A %7D%0A
-%7D
+%0A showDialog(capturedEr... |
6f4b62240236383b747097f8c5db40259b6ec64a | Refactor and add logs to base-extractor | src/scripts/utils/data_extractors/base-extractor.js | src/scripts/utils/data_extractors/base-extractor.js | import table from './table-extractor'
import div from './dom-extractor'
/**
* @typedef {TabularData} Table data.
* @property {string[][]} data - Table data.
* @property {string[]} [header] - Header labels.
*/
/**
* Extract tabular (rows and columns) from the selection.
* @param {DomSelectionRange} domSelectionR... | JavaScript | 0 | @@ -5,16 +5,25 @@
rt table
+Extractor
from '.
@@ -48,18 +48,27 @@
import d
-iv
+omExtractor
from '.
@@ -633,16 +633,25 @@
= table
+Extractor
.getTabu
@@ -702,24 +702,99 @@
catch(any) %7B
+%0A console.log('Could not get tabular data with table extractor', any)%0A
%7D%0A%0A try %7B%0A
@@ -850,18 +850,27... |
15fd6d9dc6b6f3ca84e486ed0d1dc1dc4cd0db61 | fix typo in keywordSpotter | src/service/Livelihood/middleware/keywordSpotter.js | src/service/Livelihood/middleware/keywordSpotter.js | const utils = require('../utils')
module.exports = () => {
return async (ctx, next) => {
const incomingEvents = ctx.state.incomingEvents
const respondEvents = []
let mapURL = ''
await Promise.all(
incomingEvents.map(async e => {
if (e.message.text === '看看民生預報') {
mapURL = awa... | JavaScript | 0.99981 | @@ -286,10 +286,10 @@
'%E7%9C%8B%E7%9C%8B
-%E6%B0%91%E7%94%9F
+%E5%9C%B0%E5%9C%96
%E9%A0%90%E5%A0%B1')
|
5fdc101834d64fb2fc16d48cefdea0fcdecef18f | add min size | src/browser.js | src/browser.js | import app from 'app';
import BrowserWindow from 'browser-window';
import path from 'path';
import {
ipcMain, powerSaveBlocker
}
from 'electron';
import yargs from 'yargs';
var args = yargs(process.argv.slice(1)).wrap(100).argv;
var powerSaveBlockerState = false;
var startupTime = new Date().getTime();
var parseT... | JavaScript | 0.000001 | @@ -1078,16 +1078,63 @@
indow(%7B%0A
+ minWidth: 637,%0A minHeight: 514,%0A
|
c655f95c093502e06965e88f4df7b2648942603c | Revert "add min size" | src/browser.js | src/browser.js | import app from 'app';
import BrowserWindow from 'browser-window';
import path from 'path';
import {
ipcMain, powerSaveBlocker
}
from 'electron';
import yargs from 'yargs';
var args = yargs(process.argv.slice(1)).wrap(100).argv;
var powerSaveBlockerState = false;
var startupTime = new Date().getTime();
var parseT... | JavaScript | 0 | @@ -1082,55 +1082,8 @@
w(%7B%0A
- minWidth: 637,%0A minHeight: 514,%0A
|
51b22634e98f1428ee3d07ed1a3172ab593a6028 | Fix lint error | src/browser.js | src/browser.js | 'use strict';
var path = require('path');
var axon = require('axon');
var spawn = require('cross-spawn-async');
var electronpath = require('electron-prebuilt');
var app = path.join(__dirname, '../', 'electron-service');
var sock = axon.socket('req');
var bindSocketPromise;
var bindSocket = function () {
if (bindSoc... | JavaScript | 0.000035 | @@ -1759,16 +1759,17 @@
function
+
() %7B%0A%09%09%09
|
28b2056df307a0f0bc3ca03b2a3d03aef14c4cbc | Add lazyFactory to DAOHandler daoMap | js/foam/node/server/DAOHandler.js | js/foam/node/server/DAOHandler.js | /**
* @license
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requir... | JavaScript | 0.000003 | @@ -841,22 +841,46 @@
-required: true
+lazyFactory: function() %7B return %7B%7D; %7D
%0A
|
6772f4c85af4087cb8ad60669aecf540c77fe9ae | Improve about copy | src/pages/about.js | src/pages/about.js | import React from 'react'
import { Link } from 'gatsby'
import Layout from '../components/layout'
import SEO from '../components/seo'
import profile from '../images/profile.jpg'
const About = () => (
<Layout>
<SEO title="About" />
<section className="content-section wrap">
<div className="about-header">... | JavaScript | 0.000005 | @@ -614,99 +614,8 @@
ent.
- I work at %3Ca href=%22https://medienmacher.com%22%3EDie Medienmacher%3C/a%3E in Muttenz, Switzerland.
%3C/p%3E
@@ -653,16 +653,40 @@
k=%22info%22
+ className=%22text-center%22
%3EFor que
@@ -708,25 +708,16 @@
ents
-, the best way to
+ you can
con
@@ -724,19 +724,16 @@
tact me
-is
... |
e12472fb38fa97f02338473a4c8736201da6c8b2 | update email alias | js/jquery.inputmask.extensions.js | js/jquery.inputmask.extensions.js | /*
Input Mask plugin extensions
http://github.com/RobinHerbots/jquery.inputmask
Copyright (c) 2010 - 2014 Robin Herbots
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
Version: 0.0.0
Optional extensions on the jquery.inputmask base
*/
(function ($) {
//extra definitions
$.ex... | JavaScript | 0.000014 | @@ -4671,16 +4671,25 @@
%7D.*%7B2,6%7D
+%5B.*%7B1,2%7D%5D
%22,%0A
|
1b1fcca95c701b47956cdf2f8aced21648e7156d | remove accent | src/pages/index.js | src/pages/index.js | import React from "react";
import styled from "styled-components";
import Link from "gatsby-link";
import Helmet from "react-helmet";
import PictureFrame from "../components/PictureFrame";
import Social from "../components/Social";
const StyledHome = styled.div`
display: flex;
flex-direction: column;
align-items... | JavaScript | 0.999881 | @@ -1545,9 +1545,9 @@
Rodr
-%C3%AD
+i
guez
|
480761526c12a85c31dd102ee7777282767a204a | use more code font | src/pages/index.js | src/pages/index.js | import React from "react"
import Link from "gatsby-link"
import Helmet from "react-helmet"
import css from "./index.module.css"
const H1 = ({children}) =>
<h1 className={css.H1}>{children}</h1>
const H2 = ({children}) =>
<h2 className={css.H2}>{children}</h2>
const Div = ({children}) =>
<div className={c... | JavaScript | 0 | @@ -788,13 +788,26 @@
s/%22%3E
-Posts
+%3Ccode%3Eposts%3C/code%3E
%3C/Li
@@ -897,16 +897,29 @@
s/%22%3E
-Profiles
+%3Ccode%3Eprofiles%3C/code%3E
%3C/Li
@@ -1004,17 +1004,23 @@
jects/%22%3E
-P
+%3Ccode%3Ep
rojects%3C
@@ -1020,16 +1020,23 @@
ojects%3C/
+code%3E%3C/
Link%3E%3C/d
@@ -1115,14 +1115,27 @@
e/%22%3E
-... |
47c94372343c8d1a35e42ef74ada333c6581d33a | convert index to functional component | src/pages/index.js | src/pages/index.js | import React from "react"
export default () => <div>Hello world!</div>
| JavaScript | 0.999987 | @@ -15,15 +15,16 @@
rom
-%22
+'
react
-%22
+';
%0A%0Aex
@@ -40,13 +40,41 @@
ult
-() =%3E
+function Index() %7B%0A return (%0A
%3Cdi
@@ -94,8 +94,15 @@
!%3C/div%3E%0A
+ );%0A%7D%0A
|
df543aa95df59d458ab70d05320e996d9b86c2ef | Update homepage copy | src/pages/index.js | src/pages/index.js | import React from "react";
import styled from "styled-components";
import Link from "gatsby-link";
import Helmet from "react-helmet";
import PictureFrame from "../components/PictureFrame";
import Social from "../components/Social";
const StyledHome = styled.div`
display: flex;
flex-direction: column;
align-items... | JavaScript | 0 | @@ -130,106 +130,8 @@
et%22;
-%0Aimport PictureFrame from %22../components/PictureFrame%22;%0Aimport Social from %22../components/Social%22;
%0A%0Aco
@@ -634,21 +634,17 @@
/%3E
-%7B%22 %22%7D
+%0A
%0A
@@ -661,21 +661,17 @@
o! %3C/h1%3E
-%7B%22 %22%7D
+%0A
%0A
@@ -711,17 +711,16 @@
browser
- ... |
f5eaad4b317c4c950082a36f57eb101628485021 | eliminate bogus case | runtime-js/metamodel.js | runtime-js/metamodel.js | function type$metamodel(x) {
if (x === null) {
return getNothingType$metamodel();
} else {
//Search for metamodel
var mm = x.$$metamodel$$;
if (mm === undefined && x.constructor && x.constructor.T$name && x.constructor.T$all) {
//It's probably an instance of a Ceylon ... | JavaScript | 0.999941 | @@ -1193,134 +1193,12 @@
ined
-) %7B%0A throw Exception(%22JS Interop not supported%22);%0A %7D else if (typeof($$targs$$.Type) === 'string') %7B%0A %7D else if (
+ %7C%7C
$$ta
|
37a785e09f30e36c2c286bc36821912bffd6cc9f | Update Santa page | src/pages/santa.js | src/pages/santa.js | import React, { Fragment } from 'react'
import styled from 'styled-components'
import {
Box,
Container,
Heading,
LargeButton,
Text,
theme
} from '@hackclub/design-system'
import Link from 'gatsby-link'
import Helmet from 'react-helmet'
import Nav from 'components/Nav'
import Footer from 'components/Footer'
... | JavaScript | 0 | @@ -2339,208 +2339,147 @@
-Signup is now closed. Check your email for the next steps! Santa%E2%80%99s%0A list will be finalized by December 12. You can also join #secret-santa%0A on Slack to participate in the discussion.
+Dozens of community members from around the world made our Secret Santa e... |
d9eb32c8f6640416e1f6b3666d6ebe0ccf25bcb8 | two -> three | test/unit/core/Raycaster.js | test/unit/core/Raycaster.js | /**
* @author simonThiele / https://github.com/simonThiele
*/
module( "Raycaster" );
test( "intersectObjects", function() {
var raycaster = getRaycaster();
var objectsToCheck = getObjectsToCheck();
ok ( raycaster.intersectObjects( objectsToCheck ).length === 1,
"no recursive search should lead to one hit" );
... | JavaScript | 0.999176 | @@ -413,34 +413,36 @@
should lead to t
-wo
+hree
hits%22 );%0A%0A%09var
@@ -1026,10 +1026,12 @@
to t
-wo
+hree
hit
|
09087fa053af4a9ad59c7ee12bf921a0e69c79a6 | test updated | lib/assets/test/spec/cartodb/table/tableview.spec.js | lib/assets/test/spec/cartodb/table/tableview.spec.js | /**
* test for table view
*/
describe("tableview", function() {
describe("headerview", function() {
var view;
var model = new cdb.admin.CartoDBTableMetadata({
name: 'test'
});
beforeEach(function() {
view = new cdb.admin.HeaderView({
el: $('<div>'),
column: ['name', 't... | JavaScript | 0 | @@ -3280,15 +3280,22 @@
row
-changes
+is being saved
%22, f
@@ -3403,15 +3403,14 @@
.row
-Changed
+Saving
();%0A
|
c777f4bc6a788990a8b8fc3e40b8d746ea4aca82 | remove a testcase | test/unit/form/validator.js | test/unit/form/validator.js | describe("测试getRule",function(){
it("name为max,passed为false,hint为null",function(){
var ready = false;
runs(function(){
NR.provide(['form/validator'],function(D,Validator){
var v2 = new Validator([{
test:"email",
hint:"email not correct"
},'max:5']);
ready = true;
var rule_by_name ... | JavaScript | 0.998273 | @@ -726,32 +726,34 @@
%09%7D);%0A%09%7D);%09%0A%7D);%0A%0A
+/*
%0Adescribe(%22%E6%B5%8B%E8%AF%95rem
@@ -1325,16 +1325,19 @@
);%09%0A%7D);%0A
+ */
%0A%0Adescri
|
9bcb4d4f077cc04e20023e5e9caf27c37879d01c | correct image size display | web/static/js/swipe.wrapper.js | web/static/js/swipe.wrapper.js | // touch-friendly gallery for mobile version
// built around swipe.js
// TODO js async load?
// when too many images could crash - to be tested - best would be to only set bg property for next and prev 5, and to update after each change
// enable for documents embedded images?
(function(C2C) {
C2C.swipe ... | JavaScript | 0.000007 | @@ -4637,10 +4637,10 @@
ize(
-35
+80
0, w
@@ -4683,33 +4683,34 @@
pdate(imagesize(
-8
+20
00, width, heigh
@@ -4759,33 +4759,34 @@
pdate(imagesize(
-8
+20
00, width, heigh
|
a865226e380a32bb1fea5a56c9ad2d75370e62f6 | Fix typo in until() | probabilistic/control.js | probabilistic/control.js |
// Repeat a computation n times
function ntimes(times, block)
{
for (var i = 0; i < times; i++)
{
block(i)
}
}
// Invoke block until condition is true
function until(condiiton, block)
{
var cond = condition()
while (!cond)
{
block()
cond = condition()
}
}
// Evaluate proc a bunch of times and build a li... | JavaScript | 0.000905 | @@ -171,18 +171,18 @@
il(condi
-i
t
+i
on, bloc
|
bf03f8d90f094b709607549d70564b8975535f6a | add error reporting to the example | examples/react-native-expo/App.js | examples/react-native-expo/App.js | // import * as Expo from 'expo'
import React from 'react'
import {
Text,
View,
AsyncStorage,
Image
// Linking
} from 'react-native'
import Uppy from '@uppy/core'
import Tus from '@uppy/tus'
import UppyFilePicker from './react-native/file-picker'
import FileList from './FileList'
import PauseResumeButton from ... | JavaScript | 0 | @@ -1401,25 +1401,43 @@
plete: false
+,%0A info: null
%0A
-
%7D%0A%0A t
@@ -2570,27 +2570,24 @@
%7D)%0A
- //
console.log
@@ -2609,37 +2609,296 @@
te:'
-)%0A // console.log(result
+, result)%0A %7D)%0A%0A this.uppy.on('info-visible', () =%3E %7B%0A const info = this.uppy.getSt... |
0f24f1d359965388fbd1b28b7abe0c1a962e204f | update 'key_permissions' example | examples/rest2/key_permissions.js | examples/rest2/key_permissions.js | 'use strict'
const runExample = require('../util/run_example')
module.exports = runExample({
name: 'rest-key-permissions',
rest: {
env: true,
transform: true
}
}, async ({ debug, debugTable, rest }) => {
debug('fetching permissions')
const perms = await rest.keyPermissions()
const rows = perms.m... | JavaScript | 0.000005 | @@ -17,207 +17,242 @@
nst
-runExample = require('../util/run_example')%0A%0Amodule.exports = runExample(%7B%0A name: 'rest-key-permissions',%0A rest: %7B%0A env: true,%0A transform: true%0A %7D%0A%7D, async (%7B debug, debugTable, rest %7D) =%3E %7B
+%7B RESTv2 %7D = require('bfx-api-node-rest')%0Aconst %7B ... |
b4a88ca370c3e3f5fa38918aa96ded324a4b5fac | Add tests for util/flow | test/unit/util/flow_test.js | test/unit/util/flow_test.js | import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
chai.use(chaiAsPromised);
// import FlowUtil from '../../../lib/util/flow';
describe('XFlow utils ', function() {
});
| JavaScript | 0 | @@ -95,12 +95,30 @@
d);%0A
-%0A//
+import fs from 'fs';%0A%0A
impo
@@ -165,46 +165,1259 @@
';%0A%0A
-describe('XFlow utils ', function() %7B%0A
+var getEntryNode = FlowUtil.getEntryNode;%0Avar getNodeType = FlowUtil.getNodeType;%0Avar isTerminalNode = FlowUtil.isTerminalNode;%0A%0Avar data = fs.readFileSync('d... |
8a86259f6134d5c099093903da2c94adbe472141 | Add some better documentation to the async counter | examples/universal/api/counter.js | examples/universal/api/counter.js | function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
export function fetchCounter(callback) {
setTimeout(() => {
callback(getRandomInt(1, 100));
}, 500);
}
| JavaScript | 0 | @@ -133,71 +133,319 @@
%7B%0A
-setTimeout(() =%3E %7B%0A callback(getRandomInt(1, 100));%0A %7D, 500
+// Rather than immediately returning, we delay our code with a timeout to simulate asynchronous behavior%0A setTimeout(() =%3E %7B%0A callback(getRandomInt(1, 100));%0A %7D, 500);%0A %0A // In the case of... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.