conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use env variable to API key during testing\n" }, { "from": "human", "value": "module.exports = (grunt) => {\n // Grunt configuration\n grunt.initConfig({\n ghostinspector: {\n options: {\n apiKey: 'ff586dcaaa9b781163dbae48a230ea1947f894ff'\n },...
javascript
chosen
[ { "from": "system", "value": "Change production build for input/output files\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n 'use strict';\n\n grunt.initConfig({\n less: {\n development: {\n options: {\n paths: ['velvet']\n },\n fil...
javascript
chosen
[ { "from": "system", "value": "Add minified file size notification on Grunt build\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.initConfig({\n pkg : grunt.file.readJSON('package.json'),\n\n jshint: {\n files: ['Gruntfile.js', '<%= pkg.name %>.js']...
javascript
chosen
[ { "from": "system", "value": "Rename main html file to index.html during build\n\nto make publish process more streamlined\n" }, { "from": "human", "value": "/*jslint node: true, sloppy: true */\n\nmodule.exports = function (grunt) {\n\n grunt.initConfig({\n\n inlineEverything: {\n\n ...
javascript
chosen
[ { "from": "system", "value": "Add grunt-mdlint to CI tests\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);\n grunt.initConfig({\n mdlint: {\n pass: ['README.md'],\n fail: ['test/fixtures...
javascript
chosen
[ { "from": "system", "value": "Use less verbose Grunt syntax.\n" }, { "from": "human", "value": "\"use strict\";\n\nmodule.exports = function (grunt) {\n grunt.loadNpmTasks(\"grunt-contrib-uglify\");\n\n grunt.initConfig({\n uglify: {\n options: {\n report: ...
javascript
chosen
[ { "from": "system", "value": "Update admin urole in front\n" }, { "from": "human", "value": "'use strict';\n\napp.controller('MainController', ['$rootScope', '$scope', '$http', 'growl',\n function($rootScope, $scope, $http, growl) {\n\n // UI\n\n $scope.is_admin = function() {\n retu...
javascript
chosen
[ { "from": "system", "value": "Update file format version string.\n" }, { "from": "human", "value": "/**\n * @author jimbo00000\n */\n\nTHREE.InstancedGeometryExporter = function () {};\n\nTHREE.InstancedGeometryExporter.prototype = {\n\n\tconstructor: THREE.InstancedGeometryExporter,\n\n\tparse:...
javascript
chosen
[ { "from": "system", "value": "Update Dispatcher: dispatch resolves with results of callbacks\n" }, { "from": "human", "value": "//= require ./core\n\n(function () {\n\"use strict\";\n\nvar __callbacks = [];\n\nMarbles.Dispatcher = {\n\tregister: function (callback) {\n\t\t__callbacks.push(callba...
javascript
chosen
[ { "from": "system", "value": "chore: Use process instead of globel to set env variable\n" }, { "from": "human", "value": "const { parseRawCommit } = require('conventional-changelog/lib/git')\n\nmodule.exports = function (pluginConfig, {commits}, cb) {\n let type = null\n\n commits\n\n .map((c...
javascript
chosen
[ { "from": "system", "value": "Add Copyright and link to MIT License" }, { "from": "human", "value": "// ==UserScript==\n// @name Duolingo Comment Links\n// @description Turn comment timestamps into direct links\n// @match *://www.duolingo.com/*\n// @author HodofHod\n// @nam...
javascript
chosen
[ { "from": "system", "value": "Add Geolocation API compatibility check (web)\n" }, { "from": "human", "value": "import { observable, action } from 'mobx';\n\nexport default new class StoreCoords {\n\t\n\t@observable\n\tlat = 0\n\t\n\t@observable\n\tlng = 0\n\t\n\t@observable\n\taccuracy = 9999\n\...
javascript
chosen
[ { "from": "system", "value": "Fix map flashing outside country (web)\n" }, { "from": "human", "value": "import { decorate, observable, action } from 'mobx';\n\nclass StoreCoords {\n\t\n\tlat = 0\n\tlng = 0\n\taccuracy = 9999\n\t\n\t// Update coordinates and accuracy in store.\n\tupdate(coords) {...
javascript
chosen
[ { "from": "system", "value": "Create test task to match package.json\n" }, { "from": "human", "value": "/*\n * grunt-liquibase\n * https://github.com/chrisgreening/grunt-liquibase\n *\n * Copyright (c) 2014 Chris Greening\n * Licensed under the MIT license.\n */\n\n'use strict';\n\nmodule.export...
javascript
chosen
[ { "from": "system", "value": "Rename tax disc test and cohorts\n\nThis effectively creates a new A/B test using the\nnew weightings." }, { "from": "human", "value": "//= require govuk/multivariate-test\n\n/*jslint browser: true,\n * indent: 2,\n * white: true\n */\n/*global $, GOVUK */\n$(func...
javascript
chosen
[ { "from": "system", "value": "Rename fqdn to fqname in DialogEditorHttpService\n\nhttps://bugzilla.redhat.com/show_bug.cgi?id=1553846\n" }, { "from": "human", "value": "ManageIQ.angular.app.service('DialogEditorHttp', ['$http', 'API', function($http, API) {\n this.loadDialog = function(id) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add missing \"devel\" and \"undef\". Remove \"indent\" since it was moved to jscs.\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.initConfig({\n pkg: grunt.file.readJSON('bower.json'),\n jshint: {\n grunt: {\n src: [...
javascript
chosen
[ { "from": "system", "value": "Implement user-visible alert after interaction\n" }, { "from": "human", "value": "require('./intro-anim.sass');\n\nconst isTouchDevice = 'ontouchstart' in document.documentElement;\nconst ev = isTouchDevice ? 'touchend' : 'click';\nconst delay = isTouchDevice ? 1050...
javascript
chosen
[ { "from": "system", "value": "Use correct default value for status enum in migration\n" }, { "from": "human", "value": "'use strict'\n\nmodule.exports = {\n up: function (queryInterface, Sequelize) {\n queryInterface.addColumn(\n 'Rescues',\n 'type',\n {\n type: Sequeli...
javascript
chosen
[ { "from": "system", "value": "Return out of Pixelator.picker if no keys are provided\n" }, { "from": "human", "value": "var Pixelator = function(data, partner) {\n this.data = data;\n this.partner = partner;\n};\n\nPixelator.prototype = {\n defaults: function() {\n var default_context = th...
javascript
chosen
[ { "from": "system", "value": "Add script/lint --fix which fixes some code formatting issues via eslint\n" }, { "from": "human", "value": "'use strict'\n\nconst path = require('path')\nconst {spawn} = require('child_process')\n\nconst CONFIG = require('../config')\n\nmodule.exports = async functi...
javascript
chosen
[ { "from": "system", "value": "Update to the latest web platform tests\n\nThese just add additional coverage.\n" }, { "from": "human", "value": "\"use strict\";\n\nif (process.env.NO_UPDATE) {\n process.exit(0);\n}\n\nconst path = require(\"path\");\nconst fs = require(\"fs\");\nconst request = ...
javascript
chosen
[ { "from": "system", "value": "fix: Fix stack traces for errors happening inside coffee-script tests.\n\nBoth `coffee-script` as well as `source-map-support` (loaded through `babel-register`) patch `Error.prepareStackTrace` to modify stack traces to point to correct error locations for transpiled code. Unfor...
javascript
chosen
[ { "from": "system", "value": "Add an example to highlight if a story renders too many times\n" }, { "from": "human", "value": "import React, { useRef } from 'react';\n\nexport default {\n title: 'Core/Rendering',\n};\n\n// NOTE: in our example apps each component is mounted twice as we render i...
javascript
chosen
[ { "from": "system", "value": "Copy entire src directory not file by file\n" }, { "from": "human", "value": "'use strict';\n\nvar generators = require('yeoman-generator'),\n _ = require('lodash');\n\nmodule.exports = generators.Base.extend({\n\n constructor: function () {\n generators.Base.a...
javascript
chosen
[ { "from": "system", "value": "Update getDocuments function to be a general GET function\n" }, { "from": "human", "value": "function getDocuments(path, email, key, projectId) { \n const token = getAuthToken_(email, key);\n \n const baseUrl = \"https://firestore.googleapis.com/v1beta1/projec...
javascript
chosen
[ { "from": "system", "value": "Fix error on Meteor.loginWithGoogle() with no args" }, { "from": "human", "value": "Meteor.loginWithGoogle = function (options, callback) {\n // support both (options, callback) and (callback).\n if (!callback && typeof options === 'function') {\n callback = op...
javascript
chosen
[ { "from": "system", "value": "Use ponyfil for base error\n" }, { "from": "human", "value": "function BaseError(data){\n var oldLimit = Error.stackTraceLimit,\n error;\n\n Error.stackTraceLimit = 20;\n\n error = Error.apply(this, arguments);\n\n Error.stackTraceLimit = oldLimit...
javascript
chosen
[ { "from": "system", "value": "Add failing test to example\n" }, { "from": "human", "value": "var ntf = require('ntf')\n , test = ntf.http('http://ntfjs.org')\n\nexports.ntf = test.get('/', function(test) {\n test.statusCode(200)\n test.body('ntf')\n test.done()\n})\n" }, { "from": "g...
javascript
chosen
[ { "from": "system", "value": "Sort on last updated first\n" }, { "from": "human", "value": "'use strict';\n\n// @ngInject\nvar ParameterSearchController = function($scope, $location, $controller, npdcAppConfig, Parameter) {\n // Extend NpolarApiBaseController\n $controller(\"NpolarBaseControll...
javascript
chosen
[ { "from": "system", "value": "Fix bug where it will run more tests than desired\n" }, { "from": "human", "value": "/**\n * Run the first test with \"focus\" tag.\n *\n * @param {Object} hydro\n * @api public\n */\n\nmodule.exports = function(hydro) {\n if (!hydro.get('focus')) return;\n var fo...
javascript
chosen
[ { "from": "system", "value": "Remove parentheses from around arrow function arg" }, { "from": "human", "value": "'use strict';\n\nconst naked = require('naked-string');\n\nmodule.exports = function equalsish(stringOne, stringTwo) {\n\tif (stringOne === undefined) {\n\t\tthrow new Error('No argum...
javascript
chosen
[ { "from": "system", "value": "Return database results in root GET (3/16).\n" }, { "from": "human", "value": "var express = require('express');\nvar cors = require('cors');\nvar bodyParser = require('body-parser');\nvar nano = require('nano')('http://localhost:5984');\nvar todo = nano.db.use('tod...
javascript
chosen
[ { "from": "system", "value": "feat: Add title for every router\n\nuse router.afterEach to set document title.\n" }, { "from": "human", "value": "import Vue from 'vue';\nimport VueRouter from 'vue-router';\n\nVue.use(VueRouter);\n\nimport Home from './Home';\n// import Counter from './Counter'\n\...
javascript
chosen
[ { "from": "system", "value": "Add form for role view\n" }, { "from": "human", "value": "import React from 'react'\n\nconst GroupRolesView = () => (\n <div/>\n)\n\nexport default GroupRolesView\n" }, { "from": "gpt", "value": "import React from 'react'\nimport {connect} from 'react-r...
javascript
chosen
[ { "from": "system", "value": "Switch jest environment to `jsdom`\n\nProbably more appropriate? Found this is `node` when an error was thrown because `window` doesn't exist.\n" }, { "from": "human", "value": "module.exports = {\n preset: \"ts-jest\",\n testEnvironment: \"node\",\n module...
javascript
chosen
[ { "from": "system", "value": "Make fastboot transform actually work\n" }, { "from": "human", "value": "/* eslint-env node */\n'use strict';\n\nconst fastbootTransform = require('fastboot-transform');\n\nconst filesToImport = [\n 'dependencyLibs/inputmask.dependencyLib.js',\n 'inputmask.js',\n ...
javascript
chosen
[ { "from": "system", "value": "Fix isList to check recursively.\n\nBiwaScheme.isList (also used by assert_list) only checked to see if the\nobj was a pair. It now properly checks the list recursively, ending\nwith the (new) empty list. It still does not check if it's cyclic.\n\nThis is believed to cause a ...
javascript
chosen
[ { "from": "system", "value": ":fire: Remove beginning check for 'use babel'\n" }, { "from": "human", "value": "'use babel'\n\nimport {transform} from 'babel-core'\nimport Path from 'path'\n\nexport const compiler = true\nexport const minifier = false\nexport function process(contents, {rootDirec...
javascript
chosen
[ { "from": "system", "value": "Fix bug where .gitignore was not being generated\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\nvar program = require('commander')\n , gulp = require('gulp')\n , chalk = require('chalk')\n , exec = require('exec')\n , pjson ...
javascript
chosen
[ { "from": "system", "value": "Add tenant context based on subdomain\n" }, { "from": "human", "value": "'use strict';\nconst seneca = require('seneca')()\nconst senecaContet = require('seneca-context')\n\nseneca.add({role:'api', cmd:'post'}, (args, done) => {\n seneca.make('blog/posts').save$(ar...
javascript
chosen
[ { "from": "system", "value": "Make constants accessible through funcs\n\nEach constant is not accessible through a function. This should make autocomplete within IDE's much easier\n" }, { "from": "human", "value": "const React = require('react');\nvar { NativeModules, Platform } = require('react...
javascript
chosen
[ { "from": "system", "value": "Add console interceptors only in dev env\n" }, { "from": "human", "value": "\"use strict\";\nglobal.use = function (path) {\n if(path === 'config'){\n return require.main.require('./' + path);\n }else{\n return require('./' + path);\n }\n};\n\...
javascript
chosen
[ { "from": "system", "value": "Add app.import statements for octicons css and font files\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nvar path = require('path');\n\nmodule.exports = {\n name: 'ember-cli-octicons',\n blueprintsPath: function() {\n return path.j...
javascript
chosen
[ { "from": "system", "value": "Add propTypes check to editableTableHeader\n" }, { "from": "human", "value": "import React from 'react'\nimport PropTypes from 'prop-types'\n\nconst EditableTableHeader = ({columnNames}) => {\n\n return(\n <div>\n {columnNames.map( columnName => {return <di...
javascript
chosen
[ { "from": "system", "value": "Update loading of options hash to be compatible with modern ember-cli\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ember-devtools',\n isEnabled: function() {\n var addonConfig = this.app.project.config...
javascript
chosen
[ { "from": "system", "value": "Update version string to 2.6.0-pre.17\n" }, { "from": "human", "value": "/**\n* Features a variety of commonly used widgets, including toolbars, text inputs, checkboxes, groups\n* and multiple types of buttons. \n*\n* @namespace onyx \n*/\nmodule.exports.version = \...
javascript
chosen
[ { "from": "system", "value": "Fix merge conflict & add 3rd paramater for map function; false for directory, true for file\n" }, { "from": "human", "value": "var fs = require('fs');\n\nmodule.exports = function requireAll(options) {\n if (typeof options === 'string') {\n options = {\n di...
javascript
chosen
[ { "from": "system", "value": "Store phone numbers in memory and respond differently\n" }, { "from": "human", "value": "var restify = require('restify');\nvar messenger = require('./lib/messenger');\n\nvar server = restify.createServer();\n\nserver.use(restify.queryParser());\nserver.use(restify....
javascript
chosen
[ { "from": "system", "value": "Augment instance instead of prototype\n" }, { "from": "human", "value": "\nvar EventEmitter = require('events').EventEmitter;\nvar inherits = require('inherits');\n\nmodule.exports = function(fn) {\n\n inherits(fn, EventEmitter);\n\n var self = new fn();\n\n fn.p...
javascript
chosen
[ { "from": "system", "value": "Add authorize to createReceiver() convenience method\n" }, { "from": "human", "value": "\"use strict\";\n\nmodule.exports.Receiver = require( './lib/receiver' );\n\nmodule.exports.transports = {\n\treceivers: {\n\t\tExpress: require( './lib/transport.receiver.expres...
javascript
chosen
[ { "from": "system", "value": "Remove destination parameter and watch correct path\n" }, { "from": "human", "value": "var browserify = require('browserify');\nvar watchify = require('watchify');\nvar koars = require('koars-utils')({module: 'assets', asset:'js'});\n\nmodule.exports = function(src,...
javascript
chosen
[ { "from": "system", "value": "Remove the reconnection tests from the firefox testsuite\n" }, { "from": "human", "value": "var detect = require('rtc-tools/detect');\nvar isTestling = typeof __testlingConsole != 'undefined';\n\n// if we are running in testling then run the media tests\nif (isTestl...
javascript
chosen
[ { "from": "system", "value": "Include new SignalR in preview view\n\n" }, { "from": "human", "value": "[\n 'lib/jquery/jquery.min.js',\n 'lib/angular/angular.js',\n 'lib/underscore/underscore-min.js',\n 'lib/umbraco/Extensions.js',\n 'js/app.js',\n 'js/umbraco.resources.js',\n...
javascript
chosen
[ { "from": "system", "value": "deleteOldSubscriptions: Fix run-order issue where callback that was supposed to delete old sub, deleted new sub too\n" }, { "from": "human", "value": "import { addCallback } from 'meteor/vulcan:core';\nimport { Subscriptions } from './collection'\n\nasync function d...
javascript
chosen
[ { "from": "system", "value": "Move from exec to fs\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n/**\n * This file creates a `tsconfig.json` if it doesn't already exist.\n * tsconfig is the recommended method for configuring TypeScript.\n */\n\n/* global require process */\nconst exe...
javascript
chosen
[ { "from": "system", "value": "Return Raw Match Data in Inverse Order\n" }, { "from": "human", "value": "module.exports= {\n\tviews: [{\n\t\t\"name\": \"Raw Match Data\",\n\t\t\"view\": \"matches\"\n\t}],\n\t\n\tmatches: function (mongoCollection, callback) {\n\t\tmongoCollection.find().toArray(f...
javascript
chosen
[ { "from": "system", "value": "Change options handler to use filepath instead of filename.\n" }, { "from": "human", "value": "var fs = require('fs');\nvar path = require('path');\nvar argv = require('optimist').argv;\n\n// Load options into JS object.\nexports.options = JSON.parse(fs.readFileSync...
javascript
chosen
[ { "from": "system", "value": "Include name of `rule` that caused error in text formatter\n" }, { "from": "human", "value": "import columnify from 'columnify';\nimport figures from 'figures';\nimport chalk from 'chalk';\n\nexport default function TextFormatter(errorsGroupedByFile) {\n const file...
javascript
chosen
[ { "from": "system", "value": "Add action types for running code\n" }, { "from": "human", "value": "export const RUNNING = 'RUNNING';\n\nexport const START_LOAD_RUNTIME = 'START_LOAD_RUNTIME';\nexport const FINISH_LOAD_RUNTIME = 'FINISH_LOAD_RUNTIME';\nexport const FAIL_LOAD_RUNTIME = 'FAIL_LOAD_...
javascript
chosen
[ { "from": "system", "value": "Remove measurement on-end event listener that was preventing the measurement result from being displayed\n" }, { "from": "human", "value": "import Measurement from 'esri/dijit/Measurement';\nimport React, {\n Component,\n PropTypes\n} from 'react';\n\nexport defau...
javascript
chosen
[ { "from": "system", "value": "Fix port to be compatible with heroku\n" }, { "from": "human", "value": "'use strict';\n\nvar express = require('express'),\n\tindex = require('./routes/index.js');\n\nvar app = express();\n\napp.get('/', index.get);\n\nvar server = app.listen(3000, function () {\n\...
javascript
chosen
[ { "from": "system", "value": "Remove fast path in resize handler\n\nIt can't reliably determine whether the scrollbar still needs to\nbe clipped\n\nCloses #5445\n" }, { "from": "human", "value": "import { onBlur } from \"../display/focus.js\"\nimport { on } from \"../util/event.js\"\n\n// These ...
javascript
chosen
[ { "from": "system", "value": "Fix issues with callback function\n" }, { "from": "human", "value": "(function (angular) {\n 'use strict';\n\n function FlotDirective(eehFlot, $interval) {\n return {\n restrict: 'AE',\n template: '<div class=\"eeh-flot\"></div>',\...
javascript
chosen
[ { "from": "system", "value": "Fix default params by setting empty object\n" }, { "from": "human", "value": "function randomise ({\n count = 1,\n min = 0,\n max = 100,\n precision = 0,\n join = ', '\n}) {\n const delta = max - min\n const array = []\n let index = count\n while (index-- >...
javascript
chosen
[ { "from": "system", "value": "Disable sharp cache (helps with Heroku)" }, { "from": "human", "value": "const axios = require('axios')\nconst sharp = require('sharp')\n\nasync function fetchPostProcessedRadarFrame(url) {\n const data = await fetchRadarImage(url)\n return processImage(data)\n}\n...
javascript
chosen
[ { "from": "system", "value": "Remove log and Prefix Authorization token with 'Basic '\n\nUpdate your env vars\n" }, { "from": "human", "value": "var BlueprintClient = require('xively-blueprint-client-js');\n\nvar client = new BlueprintClient({\n authorization: process.env.BLUEPRINT_AUTHORIZATIO...
javascript
chosen
[ { "from": "system", "value": "Add unit test for access flags\n" }, { "from": "human", "value": "'use strict';\n\nvar chai = require('chai');\nvar expect = chai.expect;\n\nvar Stats = require('lib/common/components/stats');\n\nvar ReadStream = require('lib/common/streams/read-stream');\nvar Wr...
javascript
chosen
[ { "from": "system", "value": "Update to take name from state and not props\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport HouseholdService from '../services/HouseholdService'\n\nclass Household extends Component {\n constructor(props) {\n super(props)\n\n...
javascript
chosen
[ { "from": "system", "value": "Fix arrayHelper move down when selector does not match\n" }, { "from": "human", "value": "export const withUpdated = (arr, select, update) => (\n arr.map(el => select(el) ? update(el) : el)\n);\n\nexport const withInsertedBefore = (arr, selectBefore, element) => {\...
javascript
chosen
[ { "from": "system", "value": "Make tick thicker to facilitate hovering\n\ncc: da39a3ee5e6b4b0d3255bfef95601890afd80709@zeningqu\n" }, { "from": "human", "value": "'use strict';\n\n// Service for the spec config.\n// We keep this separate so that changes are kept even if the spec changes.\nangula...
javascript
chosen
[ { "from": "system", "value": "Support most ASCII characters and all Unicode above U+007F\n" }, { "from": "human", "value": "const r = require('./../../../db');\nconst config = require('config');\n\nconst check = id =>\n\tnew Promise((resolve, reject) => {\n\t\tr.table('registrations')\n\t\t\t.ge...
javascript
chosen
[ { "from": "system", "value": "Remove extra word for more better englishes" }, { "from": "human", "value": "// This require this file to load all the models into the \n// interactive note console\n\nprocess.env.NODE_ENV = 'development'\nrequire('coffee-script')\no = require('./models/organization...
javascript
chosen
[ { "from": "system", "value": "Fix decode error if pad name contains special characters and is sanitized\n" }, { "from": "human", "value": "var padManager = require('../../db/PadManager');\nvar url = require('url');\n\nexports.expressCreateServer = function (hook_name, args, cb) {\n //redirects ...
javascript
chosen
[ { "from": "system", "value": "Add some other dates into sample activities\n" }, { "from": "human", "value": "const activitiesByTimestamp = {\n // activityTimestamps: [1488058736421, 1488058788421, 1488058446421, 1488051326421, 1488051326555]\n 1488058736421: {\n text: \"hang at Golden Gate ...
javascript
chosen
[ { "from": "system", "value": "Change colour of the cube for basic scene.\n" }, { "from": "human", "value": "define(function(require){\r\n\r\n var scene = new THREE.Object3D();\r\n var camera = new THREE.PerspectiveCamera(75, 16 / 9, 0.1, 5000);\r\n\r\n camera.position.set(0, 0, 5);\r\n ...
javascript
chosen
[ { "from": "system", "value": "Allow to dispatch an array of actions in parallel.\n" }, { "from": "human", "value": "const notify = (events) => ({ dispatch }) => next => action => {\n const returnValue = next(action);\n events.forEach( event => {\n if (event.catch.indexOf(action.type) !== -1...
javascript
chosen
[ { "from": "system", "value": "Make version a regular property instead of getter\n" }, { "from": "human", "value": "const path = require('path');\n\nlet version;\n\nmodule.exports = {\n Client: require('./client/Client'),\n Shard: require('./sharding/Shard'),\n ShardingManager: require('./shar...
javascript
chosen
[ { "from": "system", "value": "Fix broken twitter avatars\n- services.twitter.profile_image_url_https field wasn't being published\n" }, { "from": "human", "value": "privacyOptions = { // true means exposed\n _id: true,\n commentCount: true,\n createdAt: true,\n email_hash: true,\n isInvited...
javascript
chosen
[ { "from": "system", "value": "fix: Fix \"Invalid date\" bug in date related components\n" }, { "from": "human", "value": "import moment from 'moment';\n\nconst DefaultDateFormat = 'YYYY-MM-DD';\nconst DefaultTimeFormat = 'HH:mm:ss';\nconst DefaultDateTimeFormat = 'YYYY-MM-DD HH:mm:ss';\n\nexport...
javascript
chosen
[ { "from": "system", "value": "[refactor] Use $document for unit test suppport.\n" }, { "from": "human", "value": "/* global angular */\n(function() {\n angular.module(\"googlechart\")\n .factory(\"agcScriptTagHelper\", agcScriptTagHelperFactory);\n\n agcScriptTagHelperFactory.$injec...
javascript
chosen
[ { "from": "system", "value": "Add log to module exports\n" }, { "from": "human", "value": "import scripts from './scripts';\nimport shortcut from './shortcut';\nimport setUserRequire from './require';\n\n\nmodule.exports = {\n scripts,\n setUserRequire,\n shortcut\n}" }, { "from": "gp...
javascript
chosen
[ { "from": "system", "value": "Fix unregistered socket adapter triggers\n" }, { "from": "human", "value": "const uuidV4 = require('uuid/v4');\n\nclass SocketAdapter {\n constructor(uuid) {\n this.uuid = uuid;\n this.conn = {\n remoteAddress: `socket-adapter: ${this.uuid}`,\n };\n ...
javascript
chosen
[ { "from": "system", "value": "Fix animation and count checking\n" }, { "from": "human", "value": "Template.notificationBadge.helpers({\n count: function () {\n // TODO: find a better way ?\n this._count = this._count || this.count;\n\n if (this.count !== this._count) {\n $('.notif...
javascript
chosen
[ { "from": "system", "value": "Use '==' because '===' causes undesired behavior" }, { "from": "human", "value": "window.onload=function(){\nvar theNumber = _.random(1, 100);\nvar theList = $(\"#list\");\nvar theBanner = $(\"#triumph\");\n\n$(\"#submit\").click(function() {\n var theGuess = $(\"#...
javascript
chosen
[ { "from": "system", "value": "Fix typo in tags error message.\n" }, { "from": "human", "value": "var GitHub = require( '../../lib/Webmaker.js' ).github;\n\nmodule.exports = {\n tags: function( req, res ) {\n GitHub.tags( req.params.repo, function( err, tags ) {\n if ( err ) {\n r...
javascript
chosen
[ { "from": "system", "value": "Add test for reordering elements in an Array.\n" }, { "from": "human", "value": "describe(\"Utilities\", function() {\n\tit(\"should get the domain\", function() {\n\t\texpect(getDomain('http://www.google.com')).toMatch('www.google.com');\n\t\texpect(getDomain('http...
javascript
chosen
[ { "from": "system", "value": "build: Fix issue with babel config error in UMD build.\n" }, { "from": "human", "value": "module.exports = {\n modules: false,\n presets: [\n [\"latest\", { es2015: { modules: false } }],\n \"es2015-rollup\",\n \"react\",\n \"stage-0\"\n ]\n};\n" },...
javascript
chosen
[ { "from": "system", "value": "Update to use autoprefixer directly\n" }, { "from": "human", "value": "'use strict';\n\nvar autoprefixer = require('autoprefixer-core')\n , cssAid = require('css-aid/process')\n , cssAidRules = [require('css-aid/rules/variables')]\n , getFiles = requir...
javascript
chosen
[ { "from": "system", "value": "Add comment to describe the output files\n" }, { "from": "human", "value": "import MemoryFileSystem from 'memory-fs'\nimport tty from 'tty'\nimport path from 'path'\nimport webpack from 'webpack'\n\nexport default function plugin (config) {\n const compiler = webpa...
javascript
chosen
[ { "from": "system", "value": "Fix detection tests silent fails\n\nCC @sourrust\n" }, { "from": "human", "value": "'use strict';\n\nvar bluebird = require('bluebird');\nvar fs = bluebird.promisifyAll(require('fs'));\nvar hljs = require('../../build');\nvar path = require('path');\nv...
javascript
chosen
[ { "from": "system", "value": "Add test to chekc if captcha object is null. The test fails\n" }, { "from": "human", "value": "describe(\"The constructor is supposed a proper Captcha object\", function() {\n it('Constructor Captcha exists', function(){\n expect(Captcha).toBeDefined();\n ...
javascript
chosen
[ { "from": "system", "value": "Add Redis sentinelRetryStrategy function in Redis config to prevent constant retries\n" }, { "from": "human", "value": "'use strict';\n\nvar debug = require('debug')('fundation:redis');\nvar Redis = require('ioredis');\n\n//\n// Redis\n//\nmodule.e...
javascript
chosen
[ { "from": "system", "value": "Fix adding root class to html, not body\n" }, { "from": "human", "value": "var $ = require('jquery');\n\nmodule.exports = function(namespace) {\n var toggleSelector = '[data-' + namespace + '-toggle]';\n var openClass = namespace + '--open';\n\n var body = ...
javascript
chosen
[ { "from": "system", "value": "Add defensive logic to csrf-ajax-filter\n" }, { "from": "human", "value": "/* global document, $ */\n/* Project specific Javascript goes here. */\n\n/*\nFormatting hack to get around crispy-forms unfortunate hardcoding\nin helpers.FormHelper:\n\n if template_pack...
javascript
chosen
[ { "from": "system", "value": "Remove test data from database after tests are run\n" }, { "from": "human", "value": "var chai = require('chai');\nvar expect = chai.expect;\nvar models = require('../server/db/models');\nvar request = require('request');\nvar localServerUri = 'http://127.0.0.1:3000...
javascript
chosen
[ { "from": "system", "value": "Add sourcemap generation to build script\n" }, { "from": "human", "value": "const path = require('path');\nconst webpack = require('webpack');\nconst banner = require('./banner');\n\nmodule.exports = {\n entry: './src/api/v4/index.js',\n output: {\n path: path....
javascript
chosen
[ { "from": "system", "value": "Resolve promise in PR handler\n" }, { "from": "human", "value": "'use strict';\n\nvar R = require('ramda');\n\n\nfunction onPrClose() {\n\n}\n\nfunction writeSuccess(res, result) {\n res.send(':)');\n}\n\nfunction writeFailure(res, err) {\n res.send(':(');\n}\n\nf...
javascript
chosen
[ { "from": "system", "value": "Use toString when printing proxy description\n" }, { "from": "human", "value": "import _ from '../wrap/lodash'\nimport isMatcher from '../matchers/is-matcher'\nimport * as stringifyObject from 'stringify-object-es5'\n\nexport default (anything) => {\n if (_.isStrin...
javascript
chosen
[ { "from": "system", "value": "Fix bug with German umlauts in dashcase filter\n" }, { "from": "human", "value": "app.filter('dashcase', function () {\n\n return function (input) {\n\n input = input.replace(/\\s+/g, '-')\n .toLowerCase()\n .replace('ä', 'ae')\n .replace('ö', 'oe...
javascript
chosen