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
506282cd7b3fde56e22b3b316676f4b7aab8eb7a
Improve promise error handling
lib/eventbrite.js
lib/eventbrite.js
'use strict'; var Promise = global.Promise || require('ypromise'); var https = require('https'), path = require('path'), util = require('util'); var eventbrite = require('../config').eventbrite; exports.getEvent = getEvent; // ----------------------------------------------------------------------------- ...
JavaScript
0.000001
@@ -673,24 +673,31 @@ fresh.%0A +return eventData.th @@ -701,32 +701,36 @@ .then(function ( +data ) %7B%0A if ( @@ -733,123 +733,363 @@ if ( -Date.now() - requested %3E TTL) %7B%0A requested = Date.now();%0A eventData = fetchEvent();%0A %7D +!(data && data.statusCode === 2...
c05a94f7ce7f8e8192825282fc9a2172ac4c862a
Make specs optional
lib/file/event.js
lib/file/event.js
'use strict'; var util = require('util'); var id = 0; /** * Event * * Represent an abstract MIDI event * * @private * @abstract * @constructor * @param {Object} specs - Event details * @param {Number} delay - Event delay in ticks */ function Event(specs, delay) { var name; this.id = 'EVENT_' +...
JavaScript
0
@@ -347,16 +347,41 @@ y %7C%7C 0;%0A + specs = specs %7C%7C %7B%7D;%0A %0A
8e58fb66bd9900c6e23f63a3ee821d1df473da8c
Fix https-redirect for koa
lib/frameworks.js
lib/frameworks.js
function express(middleware) { return middleware; } function koa(middleware) { return function*(next) { yield middleware.bind(null, this.req, this.res); if (this.req.currentUser) { this.request.currentUser = this.req.currentUser; this.currentUser = this.req.currentUser; } if (this.req...
JavaScript
0.000008
@@ -98,24 +98,86 @@ on*(next) %7B%0A + this.req.secure = this.secure; // used by cookie-session%0A%0A yield mi @@ -960,24 +960,86 @@ eject) =%3E %7B%0A + ctx.req.secure = ctx.secure; // used by cookie-session%0A%0A middle
afa812539171625b4d9c4ac45f3911b9edfdbb58
fix typo
lib/gcli/index.js
lib/gcli/index.js
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (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.mozilla.org/MPL/ * ...
JavaScript
0.999991
@@ -2174,24 +2174,25 @@ li.getEnviro +n ment = canon @@ -2201,16 +2201,17 @@ etEnviro +n ment;%0A%0A%0A
e5697bb7a4eb40f14f1c9854c59ed52d5a73cf5c
Add precentage
src/service.js
src/service.js
// @flow import fs from 'fs'; import http from 'http'; import path from 'path'; import nodeID3 from 'node-id3'; import Promise from 'bluebird'; import Youtube from 'youtube-node'; import YoutubeDL from 'youtube-dl'; import { iTunes } from 'itunes-info'; import spinner from './spinner'; const timeStrToMillis = (str) =...
JavaScript
0.000015
@@ -248,16 +248,58 @@ -info';%0A +import childProcess from 'child_process';%0A import s @@ -3840,20 +3840,17 @@ -quality -', ' += 0',%0A @@ -3858,20 +3858,17 @@ --format -', ' += bestaudi @@ -3890,20 +3890,17 @@ o-format -', ' += mp3',%0A @@ -3905,17 +3905,17 @@ -' +%60 --output ', p @@ -3910,19 +...
39592cd6750be082ce698f067125ea929a759268
Remove logging from tar
src/tar/get.js
src/tar/get.js
import npm from '../adapters/npm'; import S3 from '../adapters/s3'; import Logger from '../adapters/logger'; export default async (event, context, callback) => { const { registry, bucket, region, logTopic } = process.env; const storage = new S3({ region, bucket }); const log = new Logger('tar:get', { region, top...
JavaScript
0.000001
@@ -64,49 +64,8 @@ s3'; -%0Aimport Logger from '../adapters/logger'; %0A%0Aex @@ -153,18 +153,8 @@ gion -, logTopic %7D = @@ -216,74 +216,8 @@ %7D); -%0A const log = new Logger('tar:get', %7B region, topic: logTopic %7D); %0A%0A @@ -820,50 +820,8 @@ %7D%0A%0A - await log.error(null, storageError);%0A%0A...
2bdf3fad3179e67d1407aa60912226e2a5383149
Fix specs for '.stringify'
test/stringify.js
test/stringify.js
var Ovi = require('../'); var assert = require('chai').assert; describe('.stringify(obj, opts)', function() { it('should correctly stringify `null`', function() { assert.equal(Ovi.stringify({value:null}), 'value:null'); }); it('should correctly stringify `undefined`', function() { assert.equal(Ovi.strin...
JavaScript
0.003444
@@ -513,16 +513,17 @@ ue:true%7D +) , 'value @@ -529,17 +529,16 @@ e:true') -) ;%0A %7D) @@ -644,16 +644,17 @@ e:false%7D +) , 'value @@ -657,25 +657,24 @@ alue:false') -) ;%0A %7D);%0A @@ -1011,21 +1011,19 @@ 'value: -01000 +512 ');%0A @@ -2445,16 +2445,17 @@ se%0A %7D +) , 'num:1 @@ -2456,...
b6f4ad72b977a116fca47704771edd6e2bdd31ca
index oriented binary search alt
Binary_Search/Javascript/ghostsnstuff/binary_search.js
Binary_Search/Javascript/ghostsnstuff/binary_search.js
/* * Index Oriented Binary Search * @author Jared Halpert (ghostsnstuff) * @params: sorted list, startIndex, stopIndex, and value to be located * @edge cases: list emtpy, startIndex > stopIndex, value exceeds range of list values * @logic * update middle * return middle index if value found * recursive Binar...
JavaScript
0.000001
@@ -524,16 +524,86 @@ tIndex)%0A + * @description: http://en.wikipedia.org/wiki/Binary_search_algorithm%0A */%0Afunc
2e49adbe97b2584fd33adc4cb14c88d9104c1dd5
optimize test
compared_heap.js
compared_heap.js
/* Heap for Optimization * Copyright 2015 330k * https://github.com/330k/ * * This software is released under the MIT License. * http://opensource.org/licenses/mit-license.php */ function compared_heap(){ "use strict"; var _top = null; var _size = 0; var _mergeList = function(i, j){ var ret = null; if(i ...
JavaScript
0.000033
@@ -870,30 +870,31 @@ var root -s = -%5B%5D +null ;%0A%09%09var i = 0;%0A%09 @@ -889,26 +889,18 @@ var -i = 0;%0A%09%09var l = 0 +ret = null ;%0A%09%09 @@ -1295,143 +1295,44 @@ %09%09%09%09 -roots.push(curr);%0A%09%09%09%09curr = curr.next;%0A%09%09%09%7D while(curr !== top);%0A%09%09%09%0A%09%09%09for(i = 0...
8c394ac4e5ddc6b4ca74c8a50704463bb16fc557
Remove unnecessary console log'
middlewares/customer/index.js
middlewares/customer/index.js
const Customer = require('./../../models/customer') const CustomerMiddleware = (req, res, next) => { const customerId = req.params.id console.log('[CUSTOMER] Customer id: ' + customerId) Customer.findOne({ 'where': { 'id': customerId, 'user_id': req.currentUser.id } }) .then((customer) => { if (!custo...
JavaScript
0
@@ -133,63 +133,8 @@ s.id -%0A console.log('%5BCUSTOMER%5D Customer id: ' + customerId) %0A%0A
8d027b7e682439f2187214645b69cb9e3ba47717
Test that appRoot is defined
test/structure.js
test/structure.js
var gulp = require('gulp'), chai = require('chai'), expect = chai.expect, runSequence = require('run-sequence'), execSync = require('exec-sync'), styleguide = require('../lib/styleguide.js'), through = require('through2'), data = { source: { css: ['./test/project/source/**/*.scss'], overvi...
JavaScript
0.000001
@@ -644,16 +644,54 @@ erview,%0A + appRoot: '/my-styleguide-book',%0A ex @@ -2223,32 +2223,180 @@ script%3E');%0A %7D); +%0A%0A it('should define application root', function() %7B%0A indexHtml.contents.toString().should.contain('%3Cbase href=%22/my-styleguide-book/%22 /%3E')%0A %7D); %0A%7D);%0A%0A...
2f61750bf808a8716c21b6c804901ae4beef4b08
Update MobileNetV2.js
CNN/Conv/Stage/Stage_BlockParamsCreator/MobileNetV2.js
CNN/Conv/Stage/Stage_BlockParamsCreator/MobileNetV2.js
export { MobileNetV2 }; import * as Pool from "../../util/Pool.js"; import * as ValueDesc from "../../../Unpacker/ValueDesc.js"; import { Params } from "../Stage_Params.js"; import { MobileNetV2_Thin } from "./MobileNetV2_Thin.js"; /** * Provide parameters for MobileNetV2 (i.e. add-inut-to-output, pointwise1 is tiwc...
JavaScript
0
@@ -47,16 +47,19 @@ %22../../ +../ util/Poo
1ec2d8c75362efe28b77c0942d6ffb52ae10dee7
Remove unnecessary priority setting
src/tinymce.js
src/tinymce.js
/** * Binds a TinyMCE widget to <textarea> elements. */ angular.module('ui.tinymce', []) .value('uiTinymceConfig', {}) .directive('uiTinymce', ['$rootScope', '$window', 'uiTinymceConfig', function($rootScope, $window, uiTinymceConfig) { uiTinymceConfig = uiTinymceConfig || {}; var generatedIds = 0; re...
JavaScript
0
@@ -324,28 +324,8 @@ n %7B%0A - priority: 10,%0A
f396057744ea4f993f48eff645f0aa46f06b4728
Add documentation
src/toolgif.js
src/toolgif.js
(function() { $.fn.toolgif = function( options ) { var settings = $.extend({ width:200, height:100, speed:200, borderRadius:5, textColor:"initial", gifChange:true }, options ); return this.each( function() { if ( $( this ).data( 'toolgif' ) ){ return false; } $( this ).data( 'toolgif', true ); var...
JavaScript
0
@@ -1,8 +1,93 @@ +/* Toolgif %7C https://mburakerman.github.io/toolgif/ %7C @mburakerman %7CLicense: MIT */%0D%0A (functio @@ -129,24 +129,44 @@ ions ) %7B%0D%0A%0D%0A +//Default settings%0D%0A var settings
a58c7896e5c574cc127b2e9625a2a63fb721dfe6
Make tooltip to change positions
src/tooltip.js
src/tooltip.js
import { mouse as d3mouse } from "d3-selection"; import { format as formatBytes } from "bytes"; // https://www.d3-graph-gallery.com/graph/interactivity_tooltip.html#template export const createTooltip = node => node .append("div") .style("opacity", 0) .attr("class", "tooltip"); export const createMouse...
JavaScript
0.000001
@@ -371,24 +371,57 @@ city%22, 1);%0A%0A +const tooltipCache = new Map();%0A%0A export const @@ -491,43 +491,38 @@ %7B%0A -const %5Bx, y%5D = d3mouse(container);%0A +if (!tooltipCache.has(d)) %7B%0A co @@ -542,16 +542,18 @@ = d%0A + .ancesto @@ -557,16 +557,18 @@ stors()%0A + .rev @@ -578,16 +...
8f1a84f792b1f390c4540968dd6967289d019556
Change healthcheck endpoint for dashboard (#33)
lib/cf/dashboard/src/lib/routes/cfabacus/cfabacus.js
lib/cf/dashboard/src/lib/routes/cfabacus/cfabacus.js
'use strict'; const express = require('express'); const controller = require('../../controllers').cfAbacusApi; const router = express.Router(); const authenticate = require('../../middleware/authmiddleware'); router.get('/ping', (req, res) => { res.status(200).send({ 'status': 'OK' }); }); router.get('/meter...
JavaScript
0
@@ -221,12 +221,19 @@ t('/ -ping +healthcheck ', ( @@ -281,21 +281,22 @@ ' -status': 'OK' +healthy': true %0A %7D @@ -935,8 +935,9 @@ router; +%0A
f9da12fbda1898f9fc159423715543a82ae4b0c3
Clear PageContext pages during navigation.
ui/js/pages/page/PageContext.js
ui/js/pages/page/PageContext.js
import React, { Component, PropTypes } from 'react'; import { getItems } from '../../actions'; import PageItem from './PageItem'; export default class PageContext extends Component { constructor() { super(); this.state = { pages: [] }; } componentDidMount() { this._load(this.props); } compone...
JavaScript
0
@@ -480,24 +480,58 @@ %7D = props;%0A + this.setState(%7B pages: %5B%5D %7D);%0A if (filt
7006cd7fcb8f22d7aa67ef518b6db867b0f53c8e
Remove jquery dep.
test/test-main.js
test/test-main.js
'use strict'; if(!Function.prototype.bind){ // PhantomJS doesn't support bind yet Function.prototype.bind = Function.prototype.bind || function (thisp) { var fn = this; return function () { return fn.apply(thisp, arguments); }; }; } var tests = Object.keys(window.__karma...
JavaScript
0
@@ -9,16 +9,17 @@ ict';%0Aif + (!Functi @@ -36,16 +36,17 @@ pe.bind) + %7B%0A // @@ -146,17 +146,16 @@ function - (thisp) @@ -202,17 +202,16 @@ function - () %7B%0A @@ -338,17 +338,16 @@ function - (file) %7B @@ -343,26 +343,24 @@ ion(file) %7B%0A - return / @@ -490,48 +490,8 @@ : %7B%0A ...
5a70c528561ce605f54ee25a8cfe57f9c2317590
fix travis test errors.(
ads/xlift.js
ads/xlift.js
/** * Copyright 2016 The AMP HTML Authors. 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 require...
JavaScript
0.000002
@@ -1066,16 +1066,17 @@ izeInfo: + %7B%7D%7D;%0A @@ -1325,16 +1325,185 @@ %3E %7B%0A +global.XliftAmpHelper = global.XliftAmpHelper %7C%7C null;%0A if (global.XliftAmpHelper == null) %7B%0A global.context.noContentAvailable();%0A %7D%0A else %7B%0A global. XliftAmp @@ -1517,16 +1517,22 @@...
126f7ff4a98c6ef7135fc6aa27f6dafcc3417b6e
Fix broken tests
test/test.dist.js
test/test.dist.js
/** * @license Apache-2.0 * * Copyright (c) 2018 The Stdlib Authors. * * 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 required by a...
JavaScript
0.000555
@@ -2406,30 +2406,46 @@ ile -for REPL functionality +containing %22flat%22 namespace help texts (mi @@ -2576,20 +2576,25 @@ 'stdlib- -repl +flat-help .min.js' @@ -2688,20 +2688,20 @@ bundle. -repl +help , 'funct @@ -2703,37 +2703,99 @@ function', ' -is a function +has member' );%0A%09t.equal( typeof bundle.he...
d76ac917036d3d95b22396562bfb3845f0f4ad87
update site tests
test/test.site.js
test/test.site.js
/** * WPCOM module */ var WPCOM = require('../'); var Site = require('../lib/site'); var util = require('./util'); var assert = require('assert'); var fs = require('fs'); /** * Testing data */ var test = require('./data'); /** * Create a `Site` instance */ describe('WPCOM#Site', function(){ // Create a...
JavaScript
0.000007
@@ -1154,16 +1154,20 @@ e('posts +List ()', fun @@ -1167,32 +1167,32 @@ )', function()%7B%0A - %0A it('shoul @@ -1288,16 +1288,20 @@ te.posts +List (functio @@ -1792,16 +1792,20 @@ te.posts +List (%7B numbe @@ -2221,16 +2221,20 @@ e('media +List ()', fun @@ -2364,17 +2364,20 @@ te.media -s +List (funct...
6cfe7376dfe13616f770779149c64762220f9345
Add minimal error reporting
lib/mongoCache.js
lib/mongoCache.js
var mongo = require('mongodb'); var MongoClient = require('mongodb').MongoClient; var mongoUri = process.env.MONGOLAB_URI || process.env.MONGOHQ_URL || 'mongodb://localhost/prerender'; var database; MongoClient.connect(mongoUri, function(err, db) { database = db; }); var cache_manager = require('cache-m...
JavaScript
0.000001
@@ -1497,20 +1497,16 @@ - upsert: @@ -1510,20 +1510,16 @@ t: true%0A - @@ -1538,24 +1538,60 @@ ion (err) %7B%0A + console.error(err);%0A
200485463a9020a76499013a86b7f6fdcb559312
modify mysql settings.
lib/mysql_pool.js
lib/mysql_pool.js
var mysql = require("mysql"); module.exports = mysql.createPool({ connectionLimit: 16, host: 'localhost', port: 2016, user: 'wangxy', password: 'wincom', database: 'scdb' });
JavaScript
0
@@ -100,17 +100,20 @@ t: ' -localhost +192.168.0.88 ',%0A @@ -125,11 +125,11 @@ rt: -201 +330 6,%0A
2edc288146d8eef05625152480bc06259bba4c5f
Replace forEach with for-of
lib/note/index.js
lib/note/index.js
import parseNote from './parse-note'; import getAlternateName from './get-alternate-name'; import getNoteFromPianoKey from './get-note-from-piano-key'; import { pianoKeys, frequencies } from './piano-keys'; import validateNote from './validate-note'; import intervals from './intervals'; import Chord from '../chord'; c...
JavaScript
0.999997
@@ -1398,48 +1398,40 @@ %0A%7D%0A%0A -Object.keys(intervals).forEach(function +for (let interval of Object.keys (int @@ -1435,16 +1435,18 @@ interval +s) ) %7B%0A No @@ -1537,18 +1537,16 @@ ;%0A %7D;%0A%7D -); %0A%0Aexport
82e166073e9110f57e90b823473e90e76fe9a5ed
fix contributions state variable generation
src/ui/grid.js
src/ui/grid.js
import React from 'react'; import ReactDOMServer from 'react-dom/server'; import moment from 'moment'; import _ from 'lodash'; var { DOM, createFactory } = React; var App = React.createClass({ getInitialState: function() { return { contributions: [] }; }, generateAllDa...
JavaScript
0.000001
@@ -2598,55 +2598,15 @@ map( -%0A ( item -) =%3E - %7B%0A return %5Bit @@ -2638,32 +2638,8 @@ em%5D%5D -;%0A %7D%0A );%0A%0A
abeb354fef58ff7dd46ccd27a853adcd119c1c0b
fix compile issue
src/ui/html.js
src/ui/html.js
/** * @fileoverview * these are lightweight helpers that should not be attached to the element more than once */ goog.provide('recoil.ui.HtmlHelper'); goog.require('goog.dom.classlist'); /** * @constructor * @param {!recoil.ui.WidgetScope} scope gui scope */ recoil.ui.HtmlHelper = function(scope) { this.sc...
JavaScript
0.000001
@@ -1271,16 +1271,31 @@ unction%0A + * @template T%0A * @para @@ -1328,22 +1328,17 @@ haviour%3C -string +T %3E,(Objec
febe3a1c5819c2777c08a4f31d631bdb6981caab
Fix leak to global object.
lib/regularity.js
lib/regularity.js
/* Regularity.js: Regular expressions for humans Author: Fernando Martinez de la Cueva License: MIT Url: https://github.com/oinak/regularity */ // souvenirs from Crockford-land: Function.prototype.method = function(name, func){ this.prototype[name] = func; return this; }; Function.method('bind', function(...
JavaScript
0
@@ -5128,24 +5128,28 @@ '0'%5D;%0A +var replaced = '
c954e613648c5d1673f69cf66594b8616aa098cc
Update validator.js
test/validator.js
test/validator.js
'use strict'; var should = require('should'); var fixtures = require('./fixtures'); var validate = require('..'); describe('HAR Spec', function () { it('should fail with empty object', function (done) { validate({}, function (err, valid) { err[0].should.have.property('message'); err[0].message.shou...
JavaScript
0.000002
@@ -234,32 +234,68 @@ (err, valid) %7B%0A + valid.should.be.false;%0A %0A err%5B0%5D.sho @@ -316,32 +316,32 @@ rty('message');%0A - err%5B0%5D.mes @@ -506,32 +506,68 @@ (err, valid) %7B%0A + valid.should.be.false;%0A %0A err%5B0%5D.sho @@ -635,35 +635,25 @@ al(' -m is -si...
c6622b3c39c48ac5b34bd5756adc057d433ce11c
Remove traces of the term "expectations"
shelltest.js
shelltest.js
"use strict" var process = require('child_process'); var assert = require('./lib/assertion'); module.exports = function() { return new constructor; } var constructor = function() { this.options = {}; this.expectations = []; }; var proto = constructor.prototype; proto.cmd = buildSetter("cmd"); proto.cwd = buil...
JavaScript
0.00243
@@ -202,31 +202,29 @@ %7B%7D;%0A this. -expecta +asser tions = %5B%5D;%0A @@ -606,39 +606,37 @@ %3E 1) %7B%0A this. -expecta +asser tions.push(new a @@ -677,31 +677,29 @@ %7B%0A this. -expecta +asser tions.push(n @@ -782,23 +782,21 @@ %7B%0A var -expecta +asser tions = @@ -800,23 +800,21 @@ = this...
e03cd9227e0c266b6492272164899d72231628eb
document RSVP.defer
lib/rsvp/defer.js
lib/rsvp/defer.js
import { Promise } from "./promise"; function defer(label) { var deferred = { // pre-allocate shape resolve: undefined, reject: undefined, promise: undefined }; deferred.promise = new Promise(function(resolve, reject) { deferred.resolve = resolve; deferred.reject = reject; }, label); ...
JavaScript
0
@@ -31,16 +31,817 @@ mise%22;%0A%0A +/**%0A %60RSVP.defer%60 returns an object similar to jQuery's %60$.Deferred%60 objects.%0A %60RSVP.defer%60 should be used when porting over code reliant on %60$.Deferred%60's%0A interface. New code should use the %60RSVP.Promise%60 constructor instead.%0A%0A The object returne...
a670311251543d3f616c109c6ac8d8d2374e8eda
Remove webpack decorator and other than default exports
src/webpack.js
src/webpack.js
import notify from './lib/notify' import { loader as _loader, loaderGlobal as _loaderGlobal } from './loader' export function loader(parentModule, fn) { createHotLoader(_loader, parentModule, fn); } export function loaderGlobal(parentModule, fn) { createHotLoader(_loaderGlobal, parentModule, fn); } function cr...
JavaScript
0
@@ -1779,36 +1779,15 @@ in, -_export='default', decorator +...args ) %7B%0A @@ -1827,33 +1827,28 @@ %0A%09%09%09 -_export = plugin%7C%7C_export +args.unshift(plugin) ;%0A%09%09 @@ -1886,182 +1886,8 @@ %09%7D%0A%0A -%09%09if (typeof _export === 'function') %7B%0A%09%09%09decorator = _export;%0A%09%09%09_export = '...
b4df401fe27a8a9615eda9310bd38de7b19ed294
fix programatic usage 2
cli/multipass.js
cli/multipass.js
#!/usr/bin/env node var url = require("url"); var net = require("net"); var _ = require("lodash"); var async = require("async"); var Tracker = require("peer-search/tracker"); var events = require('events'); var cfg = require("../lib/cfg"); var log = require("../lib/log"); var db = require("../lib/db"); var indexer = ...
JavaScript
0.000001
@@ -380,24 +380,102 @@ mporter%22);%0A%0A +var argv = module.parent ? %7B %7D : require(%22minimist%22)(process.argv.slice(2));%0A%0A var mp = new @@ -498,16 +498,16 @@ tter();%0A - var sour @@ -1239,16 +1239,8 @@ argv - && argv %5B%22di @@ -1932,16 +1932,16 @@ lect%22);%0A + %09%09if (!a @@ -1947,17 +1947,8 @@...
db724e715e428fe7cfb0e44c3069121ecdbab224
Fix a test
tests/col.test.js
tests/col.test.js
import React from 'react'; import renderer from 'react-test-renderer'; import { shallow } from 'enzyme'; import { css, StyleSheet } from 'aphrodite'; import { Col, style } from '../src/components'; describe('Col', () => { it('Should add class equal to props', () => { const wrapper = shallow(<Col xs={12} sm={8} ...
JavaScript
0.999999
@@ -1448,18 +1448,18 @@ ', 'col- -md +lg '%5D;%0A
f231f90bb3a4eb377f96401055edbb83d98ae278
Add hasPublishedPrivatePackage fact
lib/user-facts.js
lib/user-facts.js
var User = require('../models/user'); var P = require('bluebird'); module.exports = { getFactsForRequest: function getFactsForRequest(request) { return P.try(function() { var facts = {}; if (request.loggedInUser) { facts.isRegistered = true; } return P.props(facts); }).then...
JavaScript
0
@@ -264,16 +264,270 @@ true;%0A%0A + var user = User.new(request);%0A facts.hasPublishedPrivatePackage = user.getPackages(request.loggedInUser.name, 0).then(function(packages) %7B%0A return Boolean(packages.items.filter(e =%3E e.access == 'restricted').length);%0A %7D);%0A%0A %7D%...
2e962725ed585318bcbd29613739dfac5c914eab
update validation to allow both pass and email
lib/validation.js
lib/validation.js
const Joi = require('joi'); const AUTH_SCHEMA = Joi.object().keys({ email: Joi.string().email(), pass: Joi.string().min(5), token: Joi.string() }).without('email', ['pass', 'token']).without('pass', ['email', 'token']).without('token', ['email', 'pass']); const USER_SCHEMA = Joi.object().keys({ name: ...
JavaScript
0
@@ -173,25 +173,16 @@ il', - %5B'pass', 'token' %5D).w @@ -169,33 +169,32 @@ 'email', 'token' -%5D ).without('pass' @@ -198,26 +198,16 @@ ss', - %5B'email', 'token' %5D).w @@ -202,17 +202,16 @@ 'token' -%5D ).withou @@ -877,24 +877,122 @@ wat.com' %7D,%0A + %7B name: 'Waaat', email: 'wat@wat.com', ...
4e08ff5579226199d3eeac35d3e4364f726618d1
use single quotes on initSubmodule caps check seems a bit more standard for chars to appear with single quote *cough* java
lib/whiteboard.js
lib/whiteboard.js
window.whiteboard = (function(){ /* ------------------------------- */ /* Private variables and functions */ /* ------------------------------- */ var _callbacks = {}, _, _previousX, _previousY; /** * Find all callbacks that match a specific event pattern * * Supports wildcard "*" characters ...
JavaScript
0
@@ -5933,11 +5933,11 @@ %3E= -%22A%22 +'A' && @@ -5963,11 +5963,11 @@ %3C= -%22Z%22 +'Z' %0A
c3eaaadf282cb713a3cbb3d8d76a05a7d3ff025a
Improve test output
tests/full/run.js
tests/full/run.js
#!/usr/bin/env node "use strict"; try { var V86 = require("../../build/libv86.js").V86Starter; } catch(e) { console.error("Failed to import build/libv86.js. Run `make build/libv86.js first."); process.exit(1); } var fs = require("fs"); var root_path = __dirname + "/../.."; var SCREEN_WIDTH = 80; functio...
JavaScript
0.999561
@@ -4551,30 +4551,246 @@ arn( -screen_to_text(screen) +%22=================================== SCREEN ===================================%22);%0A console.warn(screen_to_text(screen));%0A console.warn(%22==============================================================================%22 );%0A
1d272e6354bcf5749c5b24bbf5958aa21e2d0e2f
enable all tests
tests/js/index.js
tests/js/index.js
//////////////////////////////////////////////////////////////////////////// // // Copyright 2016 Realm Inc. // // 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/li...
JavaScript
0.000001
@@ -1473,16 +1473,19 @@ handler%0A +// if (isNo @@ -1493,24 +1493,27 @@ eProcess) %7B%0A +// const Se @@ -1562,20 +1562,23 @@ dler');%0A +// + Segfault @@ -1615,16 +1615,19 @@ .log%22);%0A +// %7D%0A%0Avar T @@ -1638,19 +1638,16 @@ = %7B%0A - // ListTes @@ -1690,19 +1690,16 @@ PASS%0A -...
d3e342dcb5044642414b887e65c8c8241c9a9dc6
add tests for function case
tests/not.spec.js
tests/not.spec.js
var not = Redash.not describe('(Function) not', function () { it('Should invert the provided value (true -> false, false -> true)', function () { not(true).should.equal(false) not(false).should.equal(true) }) it('Should handle truthy values', function () { not([]).should.equal(false) not({}).sho...
JavaScript
0.00023
@@ -56,16 +56,118 @@ on () %7B%0A + it('Should properly report its arity (is unary)', function () %7B%0A not.should.have.length(1)%0A %7D)%0A%0A it('Sh @@ -707,12 +707,1719 @@ ue)%0A %7D) +%0A%0A describe('If the received argument is a function...', function () %7B%0A it('Should return a function', funct...
424ea3209f7291a0d096d2598afb3848a5d9f9c1
Update chat.js
static/chat.js
static/chat.js
var app = angular.module('chatApp', []); app.controller('ChatController', function($scope, socket) { // When we're using HTTPS, use WSS too. var ws_scheme = window.location.protocol == "https:" ? "wss" : "ws"; var socket_url = ws_scheme + '://' + window.location.host + "/chat" + window.location.pathname; ...
JavaScript
0.000001
@@ -139,16 +139,55 @@ SS too.%0A + $scope.messages = django_messages;%0A var
e939da308cb2e9870aee4a8994e898987865a658
Change blink-diff threshold 1 to 5
test/constants/image-diff.js
test/constants/image-diff.js
export default { customDiffConfig: { thresholdType: 'pixel', threshold: 1, }, };
JavaScript
0.000001
@@ -79,9 +79,9 @@ ld: -1 +5 ,%0A
fbd645ae10b6b8c41befe416765ea7b6bc3343d9
check if travis works
test/fluce-component.spec.js
test/fluce-component.spec.js
/* @flow */ import React from 'react' import {addons} from 'react/addons' var {TestUtils} = addons var {createRenderer} = TestUtils import Fluce from '../src/fluce-component' import createFluce from '../src/create-fluce' describe('<Fluce />', () => { it('Should throw when rendered with many children', () => { ...
JavaScript
0
@@ -910,12 +910,73 @@ )%0A %7D)%0A%0A + it('This should fail', () =%3E %7B%0A expect(1).toBe(2)%0A %7D)%0A%0A %0A%7D)%0A
c2ce9c988fa7c2a18dc02627dcb21930e8692bbc
add ipcMain to window.require function
test/helpers/setupTestEnv.js
test/helpers/setupTestEnv.js
require('babel-register'); require('babel-polyfill'); require('mock-local-storage'); const noop = () => null; global.document = require('jsdom').jsdom('<body></body>'); global.window = document.defaultView; global.navigator = window.navigator; require.extensions['.scss'] = noop; const {ipcRenderer} = require('elect...
JavaScript
0.000001
@@ -295,16 +295,25 @@ Renderer +, ipcMain %7D = requ @@ -420,16 +420,31 @@ Renderer +,%0A ipcMain %0A %7D,%0A
a0d7307911e8714df6752b12a0d2ca36ebdd66c4
update command new with the latest spec
test/integration/new.spec.js
test/integration/new.spec.js
var exec = require("child_process").exec; var fs = require("fs"); var rm = require("rimraf"); var helpers = require("../helpers/utils"); describe("Created directory", function() { afterEach(function(done) { rm("./test-app", done); }); it("should scaffold a bunch of files and directories", function(done) { ...
JavaScript
0
@@ -39,32 +39,8 @@ ec;%0A -var fs = require(%22fs%22);%0A var @@ -105,16 +105,307 @@ utils%22); +%0Avar should = require('chai').should();%0A%0A// describe(%22Command ./bin/em new%22, function() %7B%0A// it(%22should require a dirName argument%22, function(done)%7B%0A// exec(%22./bin/em new%22, function() %7B...
03f0a4768809a0b059a948b594169af832e2fe77
Optimize selectionSort
sort/sort.js
sort/sort.js
let insertionSort = function (array) { for (var j = 1; j < array.length; j++) { let val = array[j]; let i = j - 1; while (i >= 0 && array[i] > val) { array[i + 1] = array[i]; i -= 1; } array[i + 1] = val; } }; let selectionSort = function (array) ...
JavaScript
0.000001
@@ -1,11 +1,16 @@ -let +function inserti @@ -11,36 +11,24 @@ nsertionSort - = function (array) %7B%0A @@ -269,19 +269,24 @@ %7D%0A%7D;%0A%0A -let +function selecti @@ -295,20 +295,8 @@ Sort - = function (arr @@ -366,25 +366,17 @@ let k = -undefined +j ;%0A @@ -391,16 +391,20 @@ ar i = j + + 1 ...
ae8f37ad57333107457d9753b6143fbb4f46029d
Test prop and val hooks
spec/test.js
spec/test.js
define(function (require) { 'use strict'; var Placeholder = require('jquery.placeholder') , $ = require('jquery') , options = {force: true, className: 'placeholder'} describe('jQuery placeholder plugin', function () { var currentId = 0 function makeInput (newAttrs) { var attrs = { id: ...
JavaScript
0
@@ -205,23 +205,16 @@ ceholder - plugin ', funct @@ -2192,34 +2192,14 @@ ith -text input -which value is set @@ -2204,32 +2204,38 @@ t to placeholder + value ', function () %7B @@ -3112,24 +3112,797 @@ ue)%0A %7D)%0A%0A + it('should keep val and prop behavior before plugin init', function () %7B%0A ...
5cd21f65a2331e9688de9d609e33c634b89f033b
update for machina 1.0.1
machina-server.js
machina-server.js
_ = Npm.require('underscore'); machina = Npm.require('machina')(_);
JavaScript
0
@@ -1,35 +1,4 @@ -_ = Npm.require('underscore');%0A mach @@ -29,9 +29,6 @@ na') -(_) ;%0A
94398b2feebf2cc6b4554e3b2d6d29942f4957f1
Allow state to be optional. If not passed in then set it to null.
website/app/application/services/project-state.js
website/app/application/services/project-state.js
Application.Services.factory("projectState", projectStateService); // projectState service tracks state information by project. Each // state has a unique id that is assigned to it. function projectStateService() { var self = this; self.stateByProject = {}; self.lastID = 0; // The last state id assigned. ...
JavaScript
0
@@ -2791,16 +2791,58 @@ xtID();%0A + var s = state ? state : null;%0A @@ -2863,36 +2863,32 @@ tes%5BstateID%5D = s -tate ;%0A re
ef20ab3d11627f230148f6f3538e5ba2c6c30d9f
Fix bug in the table for getting field names
widgets/tables/src/main/javascript/tablewidget.js
widgets/tables/src/main/javascript/tablewidget.js
/* * ************************************************************************ * Copyright (c), 2013 Next Century Corporation. All Rights Reserved. * * This software code is the exclusive property of Next Century Corporation and is * protected by United States and International laws relating to the protection * of...
JavaScript
0.000001
@@ -2181,10 +2181,25 @@ me, -%22%22 +neon.widget.TABLE , po
7d0d31980d85157b4e6e4c54368a914d411ac907
Travis ci lint task works
src/Block.js
src/Block.js
/* * Copyright (c) 2016, Artur Sousa <arturfelipe.sousa@gmail.com> * * License: MIT */ import React, {Component} from "react"; import {MegadraftPlugin, MegadraftIcons} from "megadraft"; const {BlockContent, BlockData, BlockInput, CommonBlock} = MegadraftPlugin; export default class Block extends Component { ...
JavaScript
0.999862
@@ -643,10 +643,10 @@ rl: -'' +%22%22 %0A
4acc3ef12b9a360401c5b5b9ff133e218897b309
add Emoji fix width
src/Emoji.js
src/Emoji.js
import PropTypes from 'prop-types'; import React from 'react'; import { StyleSheet, Text, TouchableOpacity, View, ViewPropTypes, } from 'react-native'; import Emoticons from 'react-native-emoticons'; export default class Emoji extends React.Component { constructor(props) { super(props); } // renderIcon() { ...
JavaScript
0.000002
@@ -82,34 +82,8 @@ et,%0A -%09Text,%0A%09TouchableOpacity,%0A %09Vie @@ -919,16 +919,51 @@ eturn (%0A +%09%09%09%3CView style=%7Bstyles.container%7D%3E%0A %09%09%09%3CEmot @@ -968,16 +968,16 @@ oticons%0A - %09%09%09%09onEm @@ -1164,16 +1164,27 @@ %7D%0A%09%09%09/%3E%0A +%09%09%09%3C/View%3E%0A %09%09);%0A%09%7...
47e179a00d59ad62ab93cbfedcc381f2192cd8cc
Send 'next' msg to client.
web/src/actions/feedback.js
web/src/actions/feedback.js
import * as types from '../constants/ActionTypes'; import fetch from 'isomorphic-fetch'; import config from '../config'; import * as surveyActions from './survey'; /* eslint no-use-before-define: [2, { "functions": false }] */ function getRandomArbitrary(min, max) { return Math.floor(Math.random() * (max - min) +...
JavaScript
0
@@ -4713,32 +4713,230 @@ %7D%0A + // Send 'next' msg to client%0A window.parent.postMessage(%7B%0A source: window.location.origin,%0A msg: 'next'%0A %7D, '*');%0A
c50e4e93753baefbd31cdb1cf757ddd463d94205
Complete variables-objects.js
week-7/variables-objects.js
week-7/variables-objects.js
// JavaScript Variables and Objects // I paired [by myself, with:] on this challenge. // __________________________________________ // Write your code below. // __________________________________________ // Test Code: Do not alter code below this line. function assert(test, message, test_number) { if (!...
JavaScript
0.000019
@@ -57,15 +57,8 @@ self -, with: %5D on @@ -74,16 +74,16 @@ llenge.%0A + %0A// ____ @@ -148,21 +148,229 @@ below.%0A%0A -%0A%0A%0A%0A%0A +// secretNumber = 0%0AsecretNumber = 7;%0A// password = %22%22%0Apassword = %22just open the door%22;%0A// allowedIn = true%0AallowedIn = false;%0A// members = 1%0A// members = ...
215bc2631073531cc67620e38a49499364cd5e4e
Revert path adjustment
src/Paths.js
src/Paths.js
let path = require('path'); class Paths { /** * Create a new Paths instance. */ constructor() { this.rootPath = path.posix.resolve(__dirname, '../../../'); } /** * Set the root path to resolve webpack.mix.js. * * @param {string} path */ setRootPath(path) { ...
JavaScript
0.000001
@@ -133,30 +133,24 @@ Path = path. -posix. resolve(__di @@ -681,14 +681,8 @@ ath. -posix. reso
05af557b5bd3080bd371f4a94fdf601d97bb0e08
fix table component
src/Table.js
src/Table.js
import React from 'react'; import cx from 'classnames'; class Table extends React.Component { render() { var classes = { centered: this.props.centered, hoverable: this.props.hoverable, stripped: this.props.stripped, bordered: this.props.bordered }; return ( <table className=...
JavaScript
0.000001
@@ -88,16 +88,18 @@ onent %7B%0A + render @@ -103,16 +103,20 @@ der() %7B%0A + var @@ -129,24 +129,30 @@ s = %7B%0A + + centered: th @@ -180,41 +180,108 @@ + -hoverable: this.props.hoverable,%0A + highlight: this.props.hoverable,%0A %22responsive-table%22: this.props...
41e154f4abadb9106abc85b5e41dee2899ec042a
define NODE_ENV
src/build.js
src/build.js
import { Buffer } from 'buffer'; import path from 'path'; import webpack from 'webpack'; import cssnext from 'postcss-cssnext'; import cssnano from 'cssnano'; import chalk from 'chalk'; import findBabelConfig from 'find-babel-config'; import uuid from 'uuid'; import UglifyJsPlugin from 'uglifyjs-webpack-plugin'; // Tu...
JavaScript
0.000012
@@ -2559,24 +2559,150 @@ plugins: %5B%0A + new webpack.DefinePlugin(%7B%0A 'process.env': %7B NODE_ENV: options.minify ? 'production' : 'development' %7D%0A %7D),%0A option
82345f2de5ddde1655661342ad0f53325540ae67
Use an accumulator instead and only do one iteration - much more efficient
src/cache.js
src/cache.js
var _cache = []; function EventHandler(token, eventName, handler, enabled) { this.elementToken = token; this.eventName = 'click.namespacename'; this.eventType = 'click'; this.namespace = 'namespace'; this.handler = handler; this.enabled = enabled; } module.exports = { add : function(token, eventName, ha...
JavaScript
0.000001
@@ -671,22 +671,15 @@ ache -%0A .filter +.reduce (fun @@ -676,32 +676,37 @@ reduce(function( +acc, entry) %7B%0A @@ -700,33 +700,28 @@ ry) %7B%0A - return +if ( entry.elemen @@ -773,68 +773,42 @@ Name -;%0A %7D)%0A .map(function(h) %7B%0A return h +) %7B%0A acc.push(e...
77a5e5258c2ec468b6d438796dea79f27603dc8f
Update clone method
src/clone.js
src/clone.js
/* Clone JSON objects */ export const clone = (obj) => JSON.parse(JSON.stringify(obj)) export default clone
JavaScript
0.000001
@@ -46,48 +46,253 @@ e = -(obj) =%3E JSON.parse(JSON.stringify(obj)) +o =%3E %7B%0A let n, i%0A if (typeof o !== 'object') return o%0A if (!o) return o%0A if (o.constructor === Array) %7B%0A n = %5B%5D%0A for (i = 0; i %3C o.length; i++) n%5Bi%5D = clone(o%5Bi%5D)%0A return n%0A %7D%0A n = %7B%7D%0A f...
d91e45c488c48a827a3062026c8fab82f825f84d
change color options, from showClor to color/noColor.
src/doGet.js
src/doGet.js
/* * doGet.js : rajah mainfile for GAS environment. */ require('global'); function doGet(e) { var config, calledByHttp, error, timers = require('./timers'); if (typeof e !== 'undefined' && typeof e.queryString !== 'undefined') { // execute by Web Access. calledByHttp = true; ...
JavaScript
0
@@ -308,16 +308,17 @@ = true;%0A +%0A @@ -330,21 +330,273 @@ g = -e.parameters; +%7B%0A specs: e.parameters %7C%7C null,%0A match: e.parameter.match %7C%7C null,%0A showColor: (typeof e.parameter.color !== 'undefined') %7C%7C%0A ...
8297e1b0fcbcdc83bcdc8011783ce7cec1d0797b
add further (missing) annotations from 1.4.x
src/ecdsa.js
src/ecdsa.js
var assert = require('assert') var crypto = require('./crypto') var BigInteger = require('bigi') var ECSignature = require('./ecsignature') // https://tools.ietf.org/html/rfc6979#section-3.2 function deterministicGenerateK(curve, hash, d) { assert(Buffer.isBuffer(hash), 'Hash must be a Buffer, not ' + hash) asser...
JavaScript
0
@@ -1846,24 +1846,90 @@ ature, Q) %7B%0A + // 1.4.2 H = Hash(M), already done by the user%0A // 1.4.3 e = H%0A var e = Bi
739bb4aa11f9cfffe327d59a410072faec108f81
update beta todo list
src/index.js
src/index.js
// TODO: // 1+ convert kea input structure to actions, reducers and selectors // 2+ skip the step of doing it twice, both before and after connection // 3+ have something easy to hook up to redux // 4. typescript support? // 5. easy to use plugins // 6. connect working with prettier // 7- could precalculate data? // 8+...
JavaScript
0
@@ -259,15 +259,27 @@ ect -working +giving nicer output wit @@ -318,16 +318,35 @@ ate data +, e.g. with prepack ?%0A// 8+ @@ -441,16 +441,53 @@ c stores +%0A// 0. set proptypes on the component %0A%0Aimport
f40a18575fbbbc260a5aaf57eec36a76a37ae86a
Use memoryHistory for react-router
src/index.js
src/index.js
import 'babel-polyfill'; import React, {createElement} from 'react'; import {render} from 'react-dom'; import {browserHistory} from 'react-router'; import {AppContainer} from 'react-hot-loader'; import Root from './modules/common/components/Root'; import './index.scss'; const renderApp = (rootComponent) => render( ...
JavaScript
0.000001
@@ -118,16 +118,37 @@ rHistory +, createMemoryHistory %7D from ' @@ -399,30 +399,37 @@ istory: -browser +createMemory History +() %7D)%7D%0A
e4c85d3835ca133888913c0c7fdd50b6446748e3
Set default parameter for `Skoci` constructor
src/index.js
src/index.js
// Wrap hooks around request import qs from 'qs' module.exports = function (opts) { // Retain hooks functions this.hooks = {} // https://.../api this.baseUrl = opts.baseUrl // /vehicle/cars this.url = opts.url // Add an alias method // name, method, action // skoci.add({ name: 'retrieve' }) // s...
JavaScript
0
@@ -74,16 +74,21 @@ on (opts + = %7B%7D ) %7B%0A // @@ -3205,24 +3205,246 @@ params) %7D)%0A%0A + if (skociObject.baseUrl === undefined %7C%7C skociObject.url === undefined) %7B%0A console.error('To request an api, please provide either %60baseUrl%60 or %60url%60 or both when instantiate a Skoci instance')%...
af3d905e650060cd3d7513932fad1ea9e1dc5c17
Use _.get
src/index.js
src/index.js
// Set an empty reference to _ because it's not known yet if it will be // underscore or lodash var _; // UUID // https://gist.github.com/LeverOne/1308368 /* jshint ignore:start */ function uuid(a,b){for(b=a='';a++<36;b+=a*51&52?(a^15?8^Math.random()*(a^20?16:4):4).toString(16):'-');return b} /* jshint ignore:end */ ...
JavaScript
0.001593
@@ -1009,32 +1009,34 @@ ) %7B%0A var doc = +_. get(collection,
aaf6ef2b4f97f5e3477b4736d8cdab137c2b024b
support https
src/index.js
src/index.js
import 'isomorphic-fetch'; const isFunction = (value) => { return typeof value === 'function'; }; const UPLOAD_URL = 'http://upload.qiniu.com'; const checkConfig = (config) => { const { uptoken, uptokenUrl, uptokenFunc, domain, name } = config; if (!name) { throw new Error('name is required'); } else if (!dom...
JavaScript
0
@@ -118,13 +118,8 @@ = ' -http: //up
ba5a9dc2eceacff2a08432b136826ee0c29444b3
Use const in 2 declarations inside render method
src/index.js
src/index.js
/** * <TextareaAutosize /> */ import React from 'react'; import PropTypes from 'prop-types'; import calculateNodeHeight, { purgeCache } from './calculateNodeHeight'; import isBrowser from './isBrowser'; import uid from './uid'; const noop = () => {}; // IE11 has a problem with eval source maps, can be reproduced w...
JavaScript
0
@@ -1575,18 +1575,20 @@ ) %7B%0A -le +cons t %7B%0A @@ -1885,18 +1885,20 @@ %7D;%0A%0A -le +cons t maxHei
199b1d5585d00c9e58b8118e600eee78c4d70797
Remove ES6 Map dependency, fix react-hot-loader errors by using CSJS scoped-name as cache key
src/index.js
src/index.js
import React, { Component } from 'react'; import csjs from 'csjs'; import insertStyle, { removeStyle, getStyle } from './insert-style'; const cache = new Map(); export { removeStyle, getStyle }; export default function (userCss, ...values) { let css = userCss; if (Array.isArray(css)) { // Forward string lit...
JavaScript
0
@@ -60,16 +60,63 @@ 'csjs';%0A +import scopedName from 'csjs/lib/scoped-name';%0A import i @@ -195,17 +195,10 @@ e = -new Map() +%7B%7D ;%0A%0Ae @@ -404,16 +404,108 @@ );%0A %7D%0A%0A + let cssText = csjs.getCss(css);%0A let scope = scopedName(cssText)('DecoratedComponent');%0A%0A return @@ -775,32 +775,15 ...
0b093dd99e2a4340b0c9e5056984cd9efd11e3c4
add missing componentDidUpdate
src/index.js
src/index.js
import React, { Component } from 'react'; import Diagram from './sequence-diagram-2.0.1'; class SequenceDiagram extends Component { componentDidMount() { const { input, options } = this.props; const diagram = Diagram.parse(input); if (this.div) { diagram.drawSVG(this.div, options) } } ren...
JavaScript
0.000002
@@ -127,16 +127,247 @@ onent %7B%0A +%0A componentDidUpdate() %7B%0A if (!this.div) return;%0A%0A const %7B input, options %7D = this.props;%0A this.div.removeChild(this.div.children%5B0%5D);%0A const diagram = Diagram.parse(input);%0A diagram.drawSVG(this.div, options)%0A %7D%0A%0A compon
cd6bc9ee1dcc239420d5492e6568a49ac90b09e4
Simplify response rejecting with errors
src/index.js
src/index.js
import {clone, pipeP, map} from 'ramda' import {printRequest} from 'apollo-client/transport/networkInterface' import {Socket as PhoenixSocket} from 'phoenix'; function applyWares (ctx, wares) { return new Promise(function (resolve, reject) { const queue = function (funcs, scope) { const next = function () ...
JavaScript
0.000026
@@ -2983,24 +2983,25 @@ if ( +! response .error)%7B @@ -2996,15 +2996,10 @@ onse -.error ) + %7B%0A @@ -3009,24 +3009,28 @@ reject( +'No response )%0A %7D @@ -3013,32 +3013,33 @@ ect('No response +' )%0A %7D else if @@ -3102,36 +3102,32 @@ reject( -'No response ')%0A %7D%0A %7D ...
4ae4d5d7b0fbe6170a04f67ef5cb20e12169258c
Rewrite ImageService with ES6
src/index.js
src/index.js
var images = { gm: require('./GraphicsMagick'), im: require('./ImageMagick') }; module.exports = { /** * Create specified images instance * @param {String} type * @param {Object} config * @returns {*} */ create: function (type, config) { if (images[type.toLowerCase()] instanceof Function) { ...
JavaScript
0
@@ -1,116 +1,155 @@ -var images = %7B%0A gm: require('./GraphicsMagick'),%0A im: require('./ImageMagick')%0A%7D;%0A%0Amodule.exports = %7B%0A +import GraphicsMagick from './GraphicsMagick';%0Aimport ImageMagick from './ImageMagick';%0A%0Avar image = %7B%0A gm: GraphicsMagick,%0A im: ImageMagick%0A%7D;%0A%0A /**%...
71fa23aec96a4a40ce6acca2ed104db20308c8e6
add timeout
src/index.js
src/index.js
require('stream'); const zlib = require('zlib'); const http = require('http'); const https = require('https'); const URL = require('url'); const Package = require('../package.json'); const Stream = require('stream'); class Snekfetch extends Stream.Readable { constructor(method, url, opts = { headers: {}, data: null ...
JavaScript
0.000008
@@ -1409,16 +1409,118 @@ s;%0A %7D%0A%0A + timeout(ms) %7B%0A this._timeout = setTimeout(() =%3E this.request.abort(), ms);%0A return this;%0A %7D%0A%0A then(r @@ -1633,16 +1633,13 @@ -function +const han @@ -1646,21 +1646,27 @@ dleError + = (err) + =%3E %7B%0A @@ -1694,16 +1694,54 @@ w ...
46ed056c6623dbeb5960cd1f9bf1cf3b7ab63e5f
Fix breaking change in Aurelia 0.15.0
src/index.js
src/index.js
export function configure(aurelia){ aurelia.globalizeResources('./mdl'); }
JavaScript
0.000001
@@ -49,11 +49,8 @@ obal -ize Reso
092c8535534655db3035f833cde33214a3f87478
Annotate private variables
src/index.js
src/index.js
import isArray from './util/is-array'; import isPlainObject from './util/is-plain-object'; import isString from './util/is-string'; import extend from './util/extend'; /** * Converts an array of primitives or objects to a plain object. * * @param {Array} array The initial array to convert. * @param {Object} [optio...
JavaScript
0.000004
@@ -3197,32 +3197,46 @@ default options%0A + * @private%0A * @type %7BObje @@ -3411,24 +3411,38 @@ ser options%0A + * @private%0A * @type %7B @@ -3890,16 +3890,30 @@ object%0A + * @private%0A * @ty
3153c828d549f49108e141eb93ef2286b7d1df51
Include the original node error message.
src/index.js
src/index.js
import path from 'path'; import each from 'lodash/each'; import map from 'lodash/map'; import omit from 'lodash/omit'; import clone from 'lodash/cloneDeep'; import isEmpty from 'lodash/isEmpty'; import assign from 'lodash/assignIn'; const debug = require('debug')('json-di'); const keywords = [ 'options', 'module', 're...
JavaScript
0
@@ -1242,17 +1242,16 @@ ror(%60Can - not load @@ -1316,16 +1316,34 @@ ata)%7D%5C%60) +, $%7Berror.message%7D %60);%0A
bfa5aad647fa7a25bae21f80a71e6c86e4f08dae
Revert "fix: add missing feature"
src/index.js
src/index.js
/** * Returns a very important number * @returns {number} */ export default function theDefaultExport() { return 42; } /** * Value that can be incremented * @type {number} */ export let value = 0; /** * Increments the value by one. */ export function incrementValue() { value++; } export function feature(...
JavaScript
0
@@ -331,24 +331,16 @@ rn 'cool - feature ';%0A%7D%0A%0Aex
4e978a26afe65694ad2d09340ca7fcbeab315ff3
add CORS for all routes
src/index.js
src/index.js
import joi from 'joi'; import Glue from 'glue'; import HapiMailer from 'hapi-mailer'; import HapiAuthBasic from 'hapi-auth-basic'; import HapiAuthJwt from 'hapi-auth-jwt'; import archimedesPlugin from './plugins/archimedes'; import eurekaPlugin from './plugins/eureka'; // var exampleConfig = { // port: 5000, // ...
JavaScript
0.000001
@@ -2488,32 +2488,70 @@ %7D +,%0A routes: %7Bcors: true%7D %0A %7D%0A
76717d4cc2bb455cd594e904f99611541f9185fb
update ttl
src/index.js
src/index.js
const AmpOptimizer = require('@ampproject/toolbox-optimizer') const { DocTagger, LinkRewriter } = require('./rewriters') const config = /** @type {ConfigDef} */ (require('../config.json')) config.MODE = process.env.NODE_ENV === 'test' ? 'test' : MODE const CACHE_TIME = 60 * 60 // 1 hour /** * Configuration typedef. ...
JavaScript
0.000001
@@ -279,14 +279,46 @@ // -1 hour +TODO: how should we actually set TTLs? %0A%0A/* @@ -1512,24 +1512,36 @@ String(), %7B%0A + cf: %7B%0A minify: @@ -1560,21 +1560,17 @@ %7D,%0A -cf: %7B + cacheTt @@ -1583,16 +1583,22 @@ HE_TIME, +%0A cacheEv @@ -1607,24 +1607,29 @@ ything: true +,%0A ...
b9528537d909069fddd436cd3daa212834877b4d
fix limit value
src/index.js
src/index.js
"use strict"; import React from 'react' import DefaultLayout from './layout' import AdForm from './form' import AdList from './list' import {RouteHandler, Route, Navigation} from 'react-router' class AdminComponent extends React.Component { static defaultProps = { root: '/admin' } static propTypes = { ...
JavaScript
0.001507
@@ -3653,16 +3653,48 @@ skip%7C%7C0%0A + limit: this.props.limit%7C%7C30%0A %7D%0A co @@ -4504,29 +4504,29 @@ limit: this. -props +state .limit,%0A @@ -5114,16 +5114,17 @@ um-1) * +( this.pro @@ -5131,16 +5131,35 @@ ps.limit +%7C%7Cthis.state.limit) ;%0A th
418a56cbdcc7791dec465dbe39d5cbbdf5b59efd
add TransactionBuilder
src/index.js
src/index.js
module.exports = { Address: require('./address'), bufferutils: require('./bufferutils'), convert: require('./convert'), crypto: require('./crypto'), ecdsa: require('./ecdsa'), ECKey: require('./eckey'), ECPubKey: require('./ecpubkey'), ECSignature: require('./ecsignature'), Message: require('./message...
JavaScript
0.000001
@@ -486,16 +486,72 @@ tion'),%0A + TransactionBuilder: require('./transaction_builder'),%0A networ
ff469c3d9d03e04115d315083c60f67abe6ceaad
Rename reset method
src/index.js
src/index.js
/* @flow */ import * as React from 'react'; import PropTypes from 'prop-types'; import getTransitionTimeMs from './getTransitionTimeMs'; export type Props = { children?: React.Node; expanded: boolean; onChangeEnd?: ?() => void; collapsedHeight: string; heightTransition: string; className: string; allow...
JavaScript
0.000001
@@ -552,19 +552,41 @@ %7B%0A _re -set +moveTransitionEndListener = () =%3E @@ -1556,27 +1556,49 @@ this._re -set +moveTransitionEndListener ();%0A %7D%0A%0A s @@ -2218,39 +2218,83 @@ ._re -set = () =%3E %7B%0A this._reset +moveTransitionEndListener = () =%3E %7B%0A this._removeTransitionEndListe...
7f69d3be0bf26af85a7ba77765ba0cb1e0f8573e
Fix watch
src/index.js
src/index.js
import path from 'path' import fs from 'fs' import ts from 'typescript' import { createFilter } from 'rollup-pluginutils' import { Linter, Configuration } from 'tslint' function normalizePath (id) { return path.relative(process.cwd(), id).split(path.sep).join('/') } function isString (value) { return Object.proto...
JavaScript
0.000002
@@ -412,16 +412,31 @@ = %7B%7D) %7B%0A + let linter;%0A%0A const @@ -781,61 +781,8 @@ sts) -%0A const program = Linter.createProgram(tsConfigFile) %0A%0A @@ -998,54 +998,8 @@ %7D%0A%0A - const linter = new Linter(config, program)%0A%0A re @@ -1048,16 +1048,141 @@ false,%0A%0A + options() %7B%0A ...
cf651498a8355be6bace075a1c356906f7280216
Fix the 'stop' method and some eslint issues
src/index.js
src/index.js
'use strict'; const express = require('express'); class Mockiji { /** * Constructor. * * @param {Object} options * @param {Object} options.configuration - A configuration object * @param {string} options.configFile - A path to a configuration file */ constructor(options = {}) { // Create Con...
JavaScript
0.019516
@@ -1114,32 +1114,42 @@ %0A reject( +new Error( 'Server is alrea @@ -1154,32 +1154,33 @@ eady listening') +) ;%0A return @@ -1286,32 +1286,33 @@ n(%0A () =%3E %7B + this.Logger.info @@ -1663,16 +1663,26 @@ reject( +new Error( 'Server @@ -1709,16 +1709,17 @@ tening') +) ;%0A @@ -179...
a509641a1bb159432b4ccd43d4d0229bd1a66254
build commit: 1485103897
src/index.js
src/index.js
/** * App ID for the skill */ //var APP_ID = undefined; //OPTIONAL: replace with "amzn1.echo-sdk-ams.app.[your-unique-value-here]"; var APP_ID = "amzn1.ask.skill.69248e8b-2456-4937-9227-94773ceb34de"; // [http://www.chimet.co.uk/csg/chi.html] // `22 January,6:50 am,6.4,7.4,051,3.90, 0.59,0.68,15,1.6,,1026,` // Date...
JavaScript
0
@@ -4574,16 +4574,33 @@ knots) %7B +%0A%0A return knots; %0A if(kn
463f7df596356dc9d1a741015e6d59819dacd0f9
reword index to make adding methods slightly easier
src/index.js
src/index.js
'use strict'; import there from './assertions/there'; import visible from './assertions/visible'; import count from './assertions/count'; import text from './assertions/text'; import immediately from './chains/immediately'; export default function (client) { return function chaiWebdriverIO(chai, utils) { t...
JavaScript
0
@@ -316,184 +316,181 @@ -there(client, chai, utils);%0A visible(client, chai, utils);%0A count(client, chai, utils);%0A text(client, chai, utils);%0A immediately(client, chai, utils +let methodsToAdd = %5Bthere, visible, count, text, immediately%5D;%0A%0A methodsToAdd.forEach(fu...
11ca0af4baa03380d8635a534931f2e698ebb32b
add method to close connection
src/index.js
src/index.js
'use strict'; var extend = require('extend'), mongoose = require('mongoose'), debug = require('debug')('hds:init'), mongo = require('./mongo'), Promise = require('bluebird'), util = require('./util'); var defaultOptions = { database: { host: '127.0.0.1', port: 27017, na...
JavaScript
0.000001
@@ -401,16 +401,23 @@ unction +initHds (options @@ -1270,24 +1270,254 @@ back);%0A%0A%7D;%0A%0A +exports.close = function closeHds(callback) %7B%0A%0A var prom = new Promise(function (resolve) %7B%0A mongoose.disconnect(function () %7B%0A resolve();%0A %7D);%0A %7D);%0A return util...
f4c75ab3a82b0e45eb135e71957d35a7b7dbb47d
Add comment
src/index.js
src/index.js
import React, { PureComponent } from 'react' function stateChangerCatchingError(stateChanger, errorKey) { return (prevState, props) => { // Check if stateChanger is a function if (typeof(stateChanger) === typeof(stateChanger.call)) { try { // Call state changer return stateChanger(prevS...
JavaScript
0
@@ -3332,24 +3332,79 @@ %7D)%0A %7D%0A + // Catch error within handler%E2%80%99s (first) function%0A catch
d977c7087aa3e776685856ed115058dd280eec24
Add component in the tree
src/index.js
src/index.js
import React , { Component , PropTypes } from 'react'; import { Provider as StoreProvider} from 'react-redux'; import {Provider as DefinitionsProvider} from './behaviours/definitions'; import {Provider as FieldHelpersProvider} from './behaviours/field'; import ConnectedSmartComponentExample from './components/smart'; i...
JavaScript
0
@@ -375,16 +375,73 @@ /dumb';%0A +import UserDumbComponent from './components/user-dumb';%0A%0A %0Aimport @@ -886,16 +886,91 @@ 234%7D /%3E%0A + %3Ch1%3EUser Dumb%3C/h1%3E%0A %3CUserDumbComponent id=%7B1234%7D /%3E%0A
f446dcfd72d6847540f338f2f463b6e863cf990f
trying to return false
src/index.js
src/index.js
const { parseFormString } = require('./util/parse'); const slack = require('./slack'); const { convertLinkToUri, extractFromUri } = require('./spotify'); const radio = require('./spotify/radio'); const track = require('./spotify/track'); function handler(event, context, callback) { const { body = '' } = ...
JavaScript
0.999999
@@ -2450,31 +2450,24 @@ false;%0A -return callback(nul @@ -2490,16 +2490,34 @@ sp('')); +%0A return false; %0A%0A%7D%0A%0Amod
46911abd438d7281442386ce65403dd2ebe9ea38
Use hashhistory, no scroll thing, remove devtools.
src/index.js
src/index.js
//TODO INSTLALL ESLINT THINGS import React from 'react' import { render } from 'react-dom' import { Router, Route, Redirect, IndexRoute } from 'react-router' import { Provider } from 'react-redux' import createHistory from 'history/lib/createBrowserHistory' // import { createHistory } from 'history' // import createHi...
JavaScript
0
@@ -240,189 +240,21 @@ eate -BrowserHistory'%0A// import %7B createHistory %7D from 'history'%0A// import createHistory from 'history/lib/createHashHistory'%0Aimport useScroll from 'scroll-behavior/lib/useStandardScroll' +HashHistory'%0A %0Aimp @@ -496,52 +496,8 @@ d'%0A%0A -import DevTools from 'containers/DevTools...
0d248d297903db015677703e929af373b5544812
Set the export as default
src/index.js
src/index.js
import copySitecoreLibraries from './tasks/copy-sitecore-libraries'; import deploy from './tasks/deploy'; import nugetRestore from './tasks/nuget-restore'; import packageWebsite from './tasks/package-website'; import publishProjects from './tasks/publish-projects'; import publishTDS from './tasks/publish-tds'; import t...
JavaScript
0.000023
@@ -358,16 +358,24 @@ %0Aexport +default %7B%0A copy
cc19f67d01c961d2be45859db5fd781c74bdc679
Update file path to import DateTime component so that it can be imported from the dist directory
src/index.js
src/index.js
import DateTime from './DateTime.vue' export default DateTime;
JavaScript
0
@@ -16,16 +16,21 @@ from '. +./src /DateTim
5c1e3e752b882c1c65617f907dcf1f68dd80d588
refactor response to only take 2 arguments
src/index.js
src/index.js
import { createJsonClient } from 'restify-clients'; import sanitize from './sanitize'; import spec from './spec'; let customFn = null; let mapme = { get: 'get', delete: 'del', update: 'put' }; Object.defineProperty(Array.prototype, 'peek', { // eslint-disable-line enumerable: false, writable: false, configurable...
JavaScript
0.000001
@@ -1174,26 +1174,15 @@ ve, -err, req, res, obj +...args ) %7B%0A @@ -1194,11 +1194,18 @@ lve( -obj +args.pop() );%0A%7D
dea3ada478882cd227a2486178d615d61b4fb538
fix class option because `classList` is not supported on SVG elements on IE
src/index.js
src/index.js
/* eslint-disable no-magic-numbers */ export default { install(Vue, opts = {}) { const dir = { params: ['symbol', 'size'], bind(el, binding, vnode) { // Get options opts.class = opts.class || 'icon'; opts.url = opts.url || '/assets/svg/sprite.svg'; // Get params ...
JavaScript
0.000001
@@ -1468,218 +1468,261 @@ -let isC +// IE do not support c lass -Existing = false;%0A%0A for (let i = 0; i %3C el.classList.length; i++) %7B%0A if (el.classList.item(i).indexOf(opts.class) !== -1) %7B%0A isClassExisting = true;%0A %7D%0A %7D%0A%0A +List on SVG element, ...
cb5d14d31f7b930f90f8bf0b936e9b315891b16a
Update index.js
src/index.js
src/index.js
(function(Chart) { var isObject = function(obj) { var type = typeof obj; return type === 'object' && !!obj; } var dataValue = function(dataPoint, isHorizontal) { if (isObject(dataPoint)) { return isHorizontal ? dataPoint.x : dataPoint.y; } return dataPoint; } var cloneArray = func...
JavaScript
0
@@ -1740,31 +1740,8 @@ %7D;%0A%0A - var precision = 2;%0A
481e2885af2d77fd1229962df3bde3a9dbf199e6
fix lint
src/index.js
src/index.js
import puppeteerConfig from '../puppeteer-config'; export { default as createScraper } from './scrapers/factory'; export { SCRAPERS } from './definitions'; export function getPuppeteerConfig() { return { ...puppeteerConfig }; }
JavaScript
0.000013
@@ -41,16 +41,21 @@ r-config +.json ';%0A%0Aexpo
7b3856ca4b926901170307bc0d1a57b578b4673c
change the way to get dispatch
src/index.js
src/index.js
import React, { PropTypes } from 'react'; /** * @param {string} options.form A unique key to identify your form throughout the app * @param {array} options.fields An array of string or object to configure the form fields * @return {object} Enhanced React Component */ export function createForm({ form, fie...
JavaScript
0.000001
@@ -429,24 +429,20 @@ -dispatch +form : PropTy @@ -449,24 +449,55 @@ pes. -func.isRequired, +object,%0A %7D;%0A%0A static contextTypes = %7B %0A @@ -493,38 +493,45 @@ pes = %7B%0A -form +store : +React. PropTypes.object @@ -522,33 +522,32 @@ PropTypes.object -, %0A %7D;%0A%0...
0d2173da7ad023b3e4128506f3f7d776be50be25
remove console
src/index.js
src/index.js
/* * restraint: * 1. common code: import 'xx'; * 2. export: export xx from xx, export x, { xx } from 'xx'; * */ import Module from 'module'; import path from 'path'; import fs from 'fs'; import * as babylon from "babylon"; import traverse from "babel-traverse"; import * as t from 'babel-types'; const r...
JavaScript
0.000056
@@ -2436,44 +2436,8 @@ );%0A%0A -console.log(pkgMap, commonImport);%0A%0A expo
6d49d2020d4052c40a9124d39a8130443854c3b7
make variables and comments easier to understand
src/index.js
src/index.js
import * as _ from 'lodash'; import * as reactDocs from 'react-docgen'; import isReactComponentClass from './isReactComponentClass'; import isStatelessComponent from './isStatelessComponent'; import * as p from 'path'; export default function ({types: t}) { return { visitor: { Class(path, state) { ...
JavaScript
0
@@ -1010,29 +1010,32 @@ %0A // -Find +Detect %60 React.create @@ -1037,24 +1037,25 @@ reateClass() +%60 %0A con @@ -1056,24 +1056,29 @@ const has +React CreateClass @@ -1151,21 +1151,24 @@ // -Find +Detect %60 createRe @@ -1177,16 +1177,17 @@ tClass() +%60 %0A @@ -1268,12 +12...
0111a6c834251ac43986ef93fbf2d831e9641404
Add ArcGis geocoding service
src/index.js
src/index.js
var L = require('leaflet'), Control = require('./control'), Nominatim = require('./geocoders/nominatim'), Bing = require('./geocoders/bing'), MapQuest = require('./geocoders/mapquest'), Mapbox = require('./geocoders/mapbox'), What3Words = require('./geocoders/what3words'), Google = require('./geocoders/google'),...
JavaScript
0
@@ -394,16 +394,57 @@ mapzen') +,%0A%09AcrGis = require('./geocoders/acrgis') ;%0A%0Amodul @@ -892,24 +892,48 @@ pzen.factory +,%0A%09arcgis: ArcGis.arcgis %0A%7D);%0A%0AL.Util
66a3f120e1773fce3993cab847f24002cfc0d4df
add unit tests
src/index.js
src/index.js
/* jshint node:true */ 'use strict'; var util = require('util'); var path = require('path'); var chalk = require('chalk'); var gutil = require('gulp-util'); var through = require('through2'); var PluginError = gutil.PluginError; var CleanCSS = require('clean-css'); module.exports = function(options) { options = opt...
JavaScript
0.000004
@@ -326,16 +326,57 @@ %7C%7C %7B%7D;%0A%0A + var cleancss = new CleanCSS(options);%0A%0A functi @@ -489,16 +489,28 @@ %0A %7D%0A%0A + try %7B%0A file @@ -532,37 +532,24 @@ Buffer( -new CleanCSS(options) +cleancss .minify( @@ -561,24 +561,26 @@ contents));%0A + file.pat @@ -626,16 +626,106 ...