conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add a constructor method and add a property of term for the state, add a function as an event handler onchange that sets the state for term as the inputs value.\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nclass SearchBar extends C...
javascript
chosen
[ { "from": "system", "value": "Add handlebars helper in order to show recipe image" }, { "from": "human", "value": "(function () {\n\n RecipeListView.prototype.template = Handlebars.compile($(\"#recipe-list-tpl\").html());\n RecipeView.prototype.template = Handlebars.compile($(\"#recipe-tp...
javascript
chosen
[ { "from": "system", "value": "Add API endpoint for categories\n" }, { "from": "human", "value": "define([], function() {\n var MoxieConf = {\n endpoint: 'http://api.m.ox.ac.uk',\n paths: {\n places_search: '/places/search',\n places_id: '/places/',\n ...
javascript
chosen
[ { "from": "system", "value": "Rename dependant to dependent (American English)\n" }, { "from": "human", "value": "'use strict'\n\nvar semver = require('semver')\nvar sub = require('subleveldown')\nvar DepDb = require('dependency-db')\n\nmodule.exports = function (db, name, range, opts) {\n rang...
javascript
chosen
[ { "from": "system", "value": "Fix minor code style issues\n" }, { "from": "human", "value": "Dashboard.TickerWidget = Dashboard.Widget.extend({\n sourceData: \"\",\n\n templateName: 'ticker_widget',\n classNames: ['widget', 'widget-ticker'],\n\n widgetView: function() {\n var widget = thi...
javascript
chosen
[ { "from": "system", "value": "Set fixture base before instead of before each\n" }, { "from": "human", "value": "describe(\"Core Bliss\", function () {\n\t\"use strict\";\n\n\tbeforeEach(function () {\n\t\tfixture.setBase('tests/fixtures');\n\t\tthis.fixture = fixture.load('core.html');\n\t\tdocu...
javascript
chosen
[ { "from": "system", "value": "Update preview logic after content refactoring\n\nAs we removed the two column layout in favour of the 1 column\nstream, the related preview logic has to be updated.\n" }, { "from": "human", "value": "const parseUrl = require('parseurl');\nconst get = require('lodas...
javascript
chosen
[ { "from": "system", "value": "[clear-cartridge] Change div with empty compoennt.\n" }, { "from": "human", "value": "var dispatcher = require('../dispatcher');\nmodule.exports = {\n render: require('./render'),\n builtInStore: require('./built-in-store'),\n actionBuilder: require('./action-bui...
javascript
chosen
[ { "from": "system", "value": "Remove all flowtypes for now\n" }, { "from": "human", "value": "'use strict'\n\n/* eslint-disable no-param-reassign */\n\n// Replace absolute file paths with <PROJECT_ROOT>\n\nconst cwd = process.cwd()\n\n/*::\ntype Val = string | Object\n */\n\nmodule.exports = {\n...
javascript
chosen
[ { "from": "system", "value": "Remove lambda expression for ES5 support\n" }, { "from": "human", "value": "'use strict'\n\nfunction makeError (res, originalError) {\n var errorMessage = res.body.message || res.body.error_message || res.body.ErrorMessage\n if (errorMessage) {\n var error = ne...
javascript
chosen
[ { "from": "system", "value": "Add basic support for inserting function call parentheses.\n" }, { "from": "human", "value": "import NodePatcher from './NodePatcher';\n\nexport default class FunctionApplicationPatcher extends NodePatcher {\n constructor(node, context, editor, fn, args) {\n sup...
javascript
chosen
[ { "from": "system", "value": "Update name property, rename id in failed function call.\n" }, { "from": "human", "value": "(function (env) {\n \"use strict\";\n env.ddg_spice_rfc = function(api_result) {\n\n if (!api_result || api_result.error || api_result.message == \"no results.\"...
javascript
chosen
[ { "from": "system", "value": "Make test dbs not persistent\n" }, { "from": "human", "value": "#!/usr/bin/env node\nvar suite = require('suite.js');\nvar o = require('./object-sugar');\n\n// test schemas\nvar license = o.schema('License', {\n name: {type: String, unique: true}\n});\n\nvar libr...
javascript
chosen
[ { "from": "system", "value": ":new: Add new type to flow\n" }, { "from": "human", "value": "'use babel'\n\n/* @flow */\n\nimport type {Point, TextEditorMarker, TextEditor, Range} from 'atom'\n\nexport type Provider = {\n grammarScopes: Array<string>,\n getDeclarations: ((params: {textEditor: T...
javascript
chosen
[ { "from": "system", "value": "Fix copying files that don't exist\n" }, { "from": "human", "value": "'use strict';\n\nvar yeoman = require( 'yeoman-generator' ),\n yosay = require( 'yosay' );\n\nvar DashGenerator = yeoman.generators.Base.extend( {\n initializing: function() {\n th...
javascript
chosen
[ { "from": "system", "value": "Update suggest + fetch tags methods to return arrays\n\n- prev was using `Set` but it cannot be simply serialized to a primitive to send over the web ext interscript messaging API\n" }, { "from": "human", "value": "import index from './'\nimport { keyGen, removeKeyT...
javascript
chosen
[ { "from": "system", "value": "Fix native strategy resolution path\n" }, { "from": "human", "value": "function nativeStrategy(data) {\n const { origin, destination, mode } = data;\n\n let originLocation;\n let destinationLocation;\n\n if (typeof origin === 'object' && origin.lat && origin.lng...
javascript
chosen
[ { "from": "system", "value": "Use $.ajaxSuccess to show \"add new course\" button\n" }, { "from": "human", "value": "this.mmooc=this.mmooc||{};\n\n\nthis.mmooc.courseList = function() {\n return {\n listCourses: function(parentId) {\n mmooc.api.getEnrolledCourses(function(co...
javascript
chosen
[ { "from": "system", "value": "Fix env for test runner\n" }, { "from": "human", "value": "const path = require(\"path\");\nconst rootDir = path.normalize(path.join(__dirname, \"..\"));\nconst tester = path.join(rootDir, \"node_modules\", \"vscode\", \"bin\", \"test\");\nconst cp = require(\"child...
javascript
chosen
[ { "from": "system", "value": "Add login check, use appSetting model\n" }, { "from": "human", "value": "/**\n * Utilities for accessing CouchDB.\n */\ndefine([\n \"jquery\"\n], function($) {\n var couchUtils = {\n /**\n * Login to CouchDB\n * @return Promise\n ...
javascript
chosen
[ { "from": "system", "value": "Fix lib import for linux platforms\n" }, { "from": "human", "value": "const { copyFileSync, existsSync } = require('fs')\nconst { join } = require('path')\n\nconst IS_LINUX = !['win32', 'darwin'].includes(process.platform)\n\nconst baseDir = ({\n 'darwin': '/usr/lo...
javascript
chosen
[ { "from": "system", "value": "Normalize fn name for change objects\n" }, { "from": "human", "value": "import {curry, values} from 'ladda-fp';\nimport {createCache} from './cache';\nimport {decorateCreate} from './operations/create';\nimport {decorateRead} from './operations/read';\nimport {decor...
javascript
chosen
[ { "from": "system", "value": "Set MIME type for RTL blob" }, { "from": "human", "value": "import MapboxGl from 'mapbox-gl'\n\n// Load mapbox-gl-rtl-text using object urls without needing http://localhost for AJAX.\nconst data = require(\"raw-loader?mimetype=text/javascript!@mapbox/mapbox-gl-rtl-...
javascript
chosen
[ { "from": "system", "value": "Update the benchmark to use the document.readyState to measure page-completedness\nrather than the onload event. Extensions were moved from the pre-onload state\nto running at document idle some time ago.\n\nBUG=none\nTEST=none\n\nReview URL: http://codereview.chromium.org/397...
javascript
chosen
[ { "from": "system", "value": "Add support for local config overrides\n" }, { "from": "human", "value": "'use strict';\n\nconst WebApp = require('./services/WebApp');\nconst app = new WebApp();\n\napp\n .configure({\n files: [\n __dirname + '/config/application.js'\n ]\n })\n .boots...
javascript
chosen
[ { "from": "system", "value": "Optimize native promisification and support multiple arguments\n" }, { "from": "human", "value": "\nvar falsey = {\n 0: true,\n false: true,\n no: true,\n nope: true\n}\n\nvar bloob = process.env.MZ_BLUEBIRD\nif (typeof Promise === 'undefined' || (bloob && !fals...
javascript
chosen
[ { "from": "system", "value": "Fix code style of sorted unique count.\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * For a sorted input, counting the number of unique values\n * is possible in constant time and constant memory. This is\n * a simple implementation of the algorithm.\n ...
javascript
chosen
[ { "from": "system", "value": "Fix electron behaviour when cancelling http basic auth\n" }, { "from": "human", "value": "const electron = require('electron');\nconst BrowserWindow = electron.BrowserWindow;\nconst ipcMain = electron.ipcMain;\n\nmodule.exports = { createAuthWindow: function(mainWin...
javascript
chosen
[ { "from": "system", "value": "[CHORE] Use DATABASE_URL instead of POSTGRES_URL\n" }, { "from": "human", "value": "Sequelize = require('sequelize')\ndbConfig = require('../database.json')['staging']\npg = require('pg').native;\n\nvar db;\n\nif (process.env.POSTGRES_URL) {\n var match = process.e...
javascript
chosen
[ { "from": "system", "value": "Document TODO for JSON schema\n" }, { "from": "human", "value": "'use strict';\n\nvar validate = exports;\n\nvar validator = require('validator');\n\nvalidate.name = function(input) {\n /**\n * TODO: Change js validation for json schema\n */\n var error = 'Ple...
javascript
chosen
[ { "from": "system", "value": "[CLEANUP] Convert internal-test-helpers to new test style\n" }, { "from": "human", "value": "QUnit.module('internal-test-helpers');\n\nQUnit.test('module present', function(assert) {\n assert.ok(true, 'each package needs at least one test to be able to run through ...
javascript
chosen
[ { "from": "system", "value": "Add button for jumping to todays date\n" }, { "from": "human", "value": "/**\r\n * Created by nkmathew on 05/07/2016.\r\n */\r\n\r\n$(document).ready(function () {\r\n $(\"#profile-form\").submit(function (e) {\r\n $(\"#btn-submit-profile\").spin(BIG_SPINN...
javascript
chosen
[ { "from": "system", "value": "Adjust switch for accept alias to serve and build.\n" }, { "from": "human", "value": "'use strict';\n\n// This is a very simple interface\n// Used to fire up gulp task in your local project\nvar runner = require('../utils/runner'),\n cb = require('../utils/callba...
javascript
chosen
[ { "from": "system", "value": "Change port that its running on\n" }, { "from": "human", "value": "// Use this file to change prototype configuration.\n\n// Note: prototype config can be overridden using environment variables (eg on heroku)\n\nmodule.exports = {\n\n // Service name used in header...
javascript
chosen
[ { "from": "system", "value": "Use env port for app to listen on\n" }, { "from": "human", "value": "module.exports = (function () {\n 'use strict';\n\n var config = {\n development: {\n server: {\n port: 3000\n },\n wsapp: {\n port: 3334\n }\n },\n tes...
javascript
chosen
[ { "from": "system", "value": "Use _this when it seems necessary\n\nSigned-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de>\n" }, { "from": "human", "value": "'use strict';\n\nfunction SAbstractObject() {\n this.toString = function () {\n var clazz = getClas...
javascript
chosen
[ { "from": "system", "value": "Use correct name for array method 'forEach'\n" }, { "from": "human", "value": "let task = require('./lib/task');\n\n\nif (process.platform === 'win32') {\n console.log('Windows is currently not supported. Please use');\n console.log(' npm run test:end2end:l...
javascript
chosen
[ { "from": "system", "value": "Refactor to use new test helper\n" }, { "from": "human", "value": "import Index from 'appkit/routes/index';\nimport App from 'appkit/app';\n\nvar route;\n\nmodule(\"Unit - IndexRoute\", {\n setup: function(){\n route = App.__container__.lookup('route:index');\n ...
javascript
chosen
[ { "from": "system", "value": "Fix invalid path for Bootstrap js file\n" }, { "from": "human", "value": "var elixir = require('laravel-elixir');\n\nelixir(function(mix) {\n\n mix.copy(\n 'node_modules/bootstrap/dist/fonts',\n 'public/build/fonts'\n );\n\n mix.copy(\n ...
javascript
chosen
[ { "from": "system", "value": "Fix analytics wrapper for window.location.href\n" }, { "from": "human", "value": "(function (root) {\n \"use strict\";\n\n root.GOVUK.GDM = root.GOVUK.GDM || {};\n root.GOVUK.GDM.analytics = {\n 'register': function () {\n GOVUK.Analytics.load();\n v...
javascript
chosen
[ { "from": "system", "value": "Fix tests confirming default plugins are included in compileOptions.\n" }, { "from": "human", "value": "import { defaultCompileOptions } from 'ember-template-compiler';\nimport TransformOldBindingSyntax from 'ember-template-compiler/plugins/transform-old-binding-syn...
javascript
chosen
[ { "from": "system", "value": "Configure C++ syntax highlighting for ROOT prompt notebooks\n" }, { "from": "human", "value": "/* ROOTaaS JS */\n\n// Make sure Clike JS lexer is loaded, then configure syntax highlighting for %%cpp and %%dcl magics\nrequire(['codemirror/mode/clike/clike', 'base/js/...
javascript
chosen
[ { "from": "system", "value": "Add pako as a webpack external dependency\n" }, { "from": "human", "value": "var webpack = require('webpack'),\n path = require('path'),\n yargs = require('yargs');\n\nvar libraryName = 'hdrhistogram',\n plugins = [],\n outputFile;\n\nif (yargs.argv.p) {...
javascript
chosen
[ { "from": "system", "value": "chore(gulp): Remove build as dependency from release task.\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp'),\n run = require('gulp-run'),\n\n del = require('del'),\n scrollrack = require('scroll-rack');\n\n\n// Config\nvar path...
javascript
chosen
[ { "from": "system", "value": "Increase timeout for mocha tests\n" }, { "from": "human", "value": "'use strict';\n\nconst gulp = require('gulp');\nconst tools = require('./src');\n\nconst unmockedModulePathPatterns = [\n 'node_modules/.*',\n 'utils/helper-tests.js'\n];\n\ntools.setGlobalConfigu...
javascript
chosen
[ { "from": "system", "value": "Add jshint esverion: 6 comment\n" }, { "from": "human", "value": "\nconst gulp = require('gulp');\nconst jasmineNode = require('gulp-jasmine-node');\nconst livereload = require('gulp-livereload');\n\n// Loads Jasmine Browser\ngulp.task('test', () => gulp.src('jasmin...
javascript
chosen
[ { "from": "system", "value": "Redefine build:all:js task to skip jquery builds\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\nvar path = require('path');\nvar metal = require('gulp-metal');\nvar runSequence = require('run-sequence');\n\nvar codeFileGlobs = [\n\t...
javascript
chosen
[ { "from": "system", "value": "Add new classes and icons based in cctray response status\n" }, { "from": "human", "value": "'use babel';\n\nimport $ from 'jquery';\nimport CONFIG from '../constants/AppConstants';\n\nlet RepositoryDataMapper = {\n parse: (data) => {\n let xml = $($.parseXML(da...
javascript
chosen
[ { "from": "system", "value": "Use modified version of raphael piechart code\n" }, { "from": "human", "value": "Ensembl.Panel.Piechart.prototype.getContent = function() {\n var panel = this;\n var visible = [];\n\n this.graphData = [];\n this.graphConfig = {};\n this.graphEls = {};\n ...
javascript
chosen
[ { "from": "system", "value": "Set webpack libraryTarget to commonjs\n" }, { "from": "human", "value": "module.exports = {\n entry: './src/index.js',\n output: {\n path: './dist',\n filename: 'hyperline.js'\n },\n module: {\n loaders: [\n {\n test: /\\.js$/,\n load...
javascript
chosen
[ { "from": "system", "value": "Add source-map to minified build\n" }, { "from": "human", "value": "/* eslint-env node */\n\nconst isProduction = process.env.NODE_ENV === 'production';\n\nmodule.exports = {\n entry: {\n daypicker: './DayPicker.dist.js',\n },\n output: {\n path: `${__dirna...
javascript
chosen
[ { "from": "system", "value": "Enable import of React components without .jsx suffix\n" }, { "from": "human", "value": "const path = require('path');\n\nmodule.exports = {\n devtool: 'cheap-module-eval-source-map',\n entry: {\n eventPage: './src/eventPage.js',\n contentScript: './src/cont...
javascript
chosen
[ { "from": "system", "value": "Remove devtool in production build\n\n- Reduces bundle size by 90%\n" }, { "from": "human", "value": "const path = require('path');\nconst { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');\nconst CompressionPlugin = require('compression-webpack-plugin')...
javascript
chosen
[ { "from": "system", "value": "Swap out double quotes with single quotes\n" }, { "from": "human", "value": "angular.module(\"hyperContentFor\", [])\n .value(\"HYPER_CONTENT_FOR_IDS\", { })\n\n .directive(\"hyperContent\", function() {\n return {\n scope: { \"for\": \"@\" },\n\n res...
javascript
chosen
[ { "from": "system", "value": "Add support for forum thread view" }, { "from": "human", "value": "// ==UserScript==\n// @name Slickdeals Don't Track Me!\n// @version 1.0\n// @description Replaces outgoing Slickdeals tracking links with direct links.\n// @match http://slickdeals.net...
javascript
chosen
[ { "from": "system", "value": "Rename Debug.init JS function to Debug.ready for consistency with other modules\n" }, { "from": "human", "value": "var Debug = {\n init: function() {\n $( '.enable-profiling' ).click( function() {\n return toggleProfiling.bind( this )( true );\n...
javascript
chosen
[ { "from": "system", "value": "Add tests for document click sub/unsub\n" }, { "from": "human", "value": "describe('PageClick', () => {\n const PageClickInjector = require('inject!../src/PageClick');\n let mock, PageClick;\n\n\n beforeEach(() => {\n mock = jasmine.createSpyObj('mock', ['']);...
javascript
chosen
[ { "from": "system", "value": "Fix reference to non-existent field. Inject session state into ctor.\n" }, { "from": "human", "value": "module.exports = (function() {\n\n var def = require('./def');\n var util = require('./util');\n\n var guard_undef = util.guard_undef;\n\n var Message = def.t...
javascript
chosen
[ { "from": "system", "value": "fix: Solve the default random avatar path problem\n" }, { "from": "human", "value": "const path = require('path');\nconst options = require('../utils/commandOptions');\n\nmodule.exports = {\n commonn: {\n convertPxToRem: {\n enable: false,\n ...
javascript
chosen
[ { "from": "system", "value": "Use test runner from react-component-template\n" }, { "from": "human", "value": "import glob from 'glob';\n\n\nglob.sync('**/*-test.js', {realpath: true, cwd: __dirname}).forEach(require);\n" }, { "from": "gpt", "value": "'use strict';\n\n\nrequire('reac...
javascript
chosen
[ { "from": "system", "value": "Add catch-all route to allow page refreshing\n" }, { "from": "human", "value": "const userController = require('./users/userController.js');\nconst listingController = require('./listings/listingController.js');\n\nmodule.exports = (app, db) => {\n\n // Routes for ...
javascript
chosen
[ { "from": "system", "value": "Drop the wrapper, clone the element and apply the class instead\n" }, { "from": "human", "value": "import React, { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport Box from '../box';\nimport { ButtonGroup } from '../button';\nimport cx from...
javascript
chosen
[ { "from": "system", "value": "Use log.warn instead of debug and claim it's a warn\n" }, { "from": "human", "value": "const express = require('express');\nconst logger = require('../logger').policy;\nconst schemas = require('../schemas');\nconst predefined = require('./predefined');\nconst condit...
javascript
chosen
[ { "from": "system", "value": "Set object id and initiate parent_ids array" }, { "from": "human", "value": "(function (tree) {\n\ntree.Extend = function Extend(selector, option, index) {\n this.selector = selector;\n this.option = option;\n this.index = index;\n\n switch(option) {\n ...
javascript
chosen
[ { "from": "system", "value": "Return success param on successful decision upload\n" }, { "from": "human", "value": "import { Router } from 'express'\nimport bodyParser from 'body-parser'\nimport Decision from './classes/Decision.js'\nvar router = Router()\n\nrouter.use(bodyParser.urlencoded({ ex...
javascript
chosen
[ { "from": "system", "value": "Allow custom markdown-it instance to be passed to the <Markdown /> component\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport markdownIt from 'markdown-it';\nimport ast from './util/ast';\nimport renderTokens from './util/renderTo...
javascript
chosen
[ { "from": "system", "value": "Rewrite using modern JavaScript features\n" }, { "from": "human", "value": "function FakeStorage() {\n this.clear();\n}\n\nFakeStorage.prototype = {\n key(index) {\n // sanitise index as int\n index = parseInt(index);\n // return early if index isn't a po...
javascript
chosen
[ { "from": "system", "value": "Change js2doc fields in lxd init function\n" }, { "from": "human", "value": "/**\n * __ _ __ ____\n * / / | |/ // __ \\\n * / / | // / / /\n * / /___/ |/ /_/ /\n * /_____/_/|_/_____/\n *\n * @author Alan Doherty (BattleCrate Ltd.)\n * @license MI...
javascript
chosen
[ { "from": "system", "value": "Update the way we identify suffixes to be more precise\n" }, { "from": "human", "value": "import { showLoading, hideLoading } from './loading_bar_ducks'\n\nconst defaultTypeSuffixes = ['PENDING', 'FULFILLED', 'REJECTED']\n\nexport default function loadingBarMiddlewa...
javascript
chosen
[ { "from": "system", "value": "Fix delete client: authorizations should be removed.\n\nSigned-off-by: François de Metz <4073ce8ed0c8af431a3bf625d935cc2c9542ae9c@af83.com>\nSigned-off-by: Virtuo <ff019a5748a52b5641624af88a54a2f0e46a9fb5@ruyssen.fr>\n" }, { "from": "human", "value": "/* Where is de...
javascript
chosen
[ { "from": "system", "value": "Revert \"more encoding settings.\" because it's stupid.\n\nThis reverts commit ccb99882a11a9edd301de8c6e42bf9700e6f8bf5.\n" }, { "from": "human", "value": "var http = require('http');\n\nexports.proxy = function(proxy_port, proxy_host, client_req, client_resp) {\n ...
javascript
chosen
[ { "from": "system", "value": "Enable Q's long stack support by default\n\nSince the response builder handler is often one of the first things created in our APIs,\nit provides a convenient place to enable the long stack support in Q.\n" }, { "from": "human", "value": "'use strict';\n\nvar Respon...
javascript
chosen
[ { "from": "system", "value": "Set campaign and region to null by default\n\nCampaign and region are getting passed down by the dashboard view\nfrom the dropdowns, so there is no need to provide defaults in the\nNCO dashboard component.\n" }, { "from": "human", "value": "'use strict';\n\nmodule.e...
javascript
chosen
[ { "from": "system", "value": "Set up continuous integration script\n" }, { "from": "human", "value": "/*global desc, task, jake, fail, complete */\n(function() {\n\t\"use strict\";\n\n\ttask(\"default\", [\"lint\"]);\n\n\tdesc(\"Lint everything\");\n\ttask(\"lint\", [], function() {\n\t\tvar lin...
javascript
chosen
[ { "from": "system", "value": "Write a failing test to show variable substitution\n\nI plan to just use sprintf's support for this.\n\nhttp://www.diveintojavascript.com/projects/javascript-sprintf\n" }, { "from": "human", "value": "describe('strong-api', function(){\n var StrongAPI = require('.....
javascript
chosen
[ { "from": "system", "value": "Add tests for menu buttons\n" }, { "from": "human", "value": "import React from \"react\";\nimport ReactTestUtils from \"react-addons-test-utils\";\n\nimport MenuScreen from \"src/components/MenuScreen/MenuScreen.js\";\n\ndescribe(\"MenuScreen\", () => {\n\n it(\"s...
javascript
chosen
[ { "from": "system", "value": "Move trim into more sensible place" }, { "from": "human", "value": "import { isValidElement } from 'react'\n\nconst whitespacesRe = /\\s+/g\nconst _format = (str = '') => str.replace(whitespacesRe, ' ')\n\nconst elementToTextRec = x => {\n if (Array.isArray(x)) {\n...
javascript
chosen
[ { "from": "system", "value": "Make BlockQuote.content editable as container.\n" }, { "from": "human", "value": "import { NodeComponent } from '../../kit'\n\nexport default class BlockQuoteComponent extends NodeComponent {\n render ($$) {\n let node = this.props.node\n let el = $$('div')\n...
javascript
chosen
[ { "from": "system", "value": "Update regex that cleans page content\n\nRegex no longer removes common punctuation. Line breaks are replaced with a space." }, { "from": "human", "value": "// Filename: popup.js\n// Date: July 2017\n// Authors: Evgeni Dobranov & Thomas Binu\n// Purpose: Defin...
javascript
chosen
[ { "from": "system", "value": "Adjust spacing between Page.Actions items\n" }, { "from": "human", "value": "// @flow\nimport baseStyles from '../../../styles/resets/baseStyles.css.js'\nimport styled from '../../styled'\n\nexport const config = {\n marginBottom: 100,\n padding: '12px 0',\n spac...
javascript
chosen
[ { "from": "system", "value": "Add tests for the {index} placeholder\n" }, { "from": "human", "value": "var tape = require('tape');\n\ntape.test('transformer - should be a function', function (assert) {\n\tassert.equals(typeof require('../lib/transformer'), 'function');\n\tassert.end();\n});\n\nt...
javascript
chosen
[ { "from": "system", "value": "Adjust the helperfunction for a lazy map component to use the correct xtype.\n" }, { "from": "human", "value": "function getMap(){\n var map = new OpenLayers.Map({\n layers: [\n new OpenLayers.Layer.WMS(\n \"OpenLayers WMS\", \n ...
javascript
chosen
[ { "from": "system", "value": "Add non-hardcoded variable that leads to styleguide assets folder\n" }, { "from": "human", "value": "'use strict'\n\n// var util = require('util')\nvar console = require('better-console')\n// var renderNav = require('./compolib.renderNav')\nvar filetreeToJSON = requ...
javascript
chosen
[ { "from": "system", "value": "Add a test case to ensure that the memory leak is fixed.\n" }, { "from": "human", "value": "var iTunes = require('../')\n , conn = null\n\niTunes.createConnection(onConn);\n\nfunction onConn (err, c) {\n if (err) throw err;\n conn = c;\n conn.selection( onSele...
javascript
chosen
[ { "from": "system", "value": "Rename common chunk \"manifest\" to \"runtime\"\n" }, { "from": "human", "value": "const {\n optimize: { CommonsChunkPlugin },\n} = require('webpack');\n\nfunction isCss({ resource }) {\n return resource &&\n resource.match(/\\.(css|sss)$/);\n}\n\nfunction isVe...
javascript
chosen
[ { "from": "system", "value": "Use extra context from error object\n" }, { "from": "human", "value": "// This should be the only file aware that we use Opbeat for error reporting.\nimport { opbeatAppId, opbeatOrgId } from './settings'\n\nconst init = () => {\n window._opbeat('config', {\n org...
javascript
chosen
[ { "from": "system", "value": "Fix copy-paste typo in unit test.\n" }, { "from": "human", "value": "import test from 'ava';\nimport { decoder } from '../../src';\nimport base from '../base';\n\ntest('should be able to compose decoder functions', t => {\n t.deepEqual(\n decoder.decode(\n ...
javascript
chosen
[ { "from": "system", "value": "Undo code for client logic\n" }, { "from": "human", "value": "DropboxOAuth = {};\n\n// Request dropbox credentials for the user\n// @param options {optional}\n// @param callback {Function} Callback function to call on\n// completion. Takes one argument, credential...
javascript
chosen
[ { "from": "system", "value": "Add more basic tests for creating elements\n" }, { "from": "human", "value": "/*global QUnit:false, module:false, test:false, asyncTest:false, expect:false*/\n/*global start:false, stop:false ok:false, equal:false, notEqual:false, deepEqual:false*/\n/*global notDeep...
javascript
chosen
[ { "from": "system", "value": "Rename ref to noteRef in API\n\nWill need ref to ref the base ref.\n" }, { "from": "human", "value": "import ApiEvents from './events/ApiEvents';\nimport { firebaseRef } from './appconfig';\n\nvar ref = firebaseRef.child('notes');\n\nvar API = {\n start() {\n re...
javascript
chosen
[ { "from": "system", "value": "Read host, user and passwd from arglist\n" }, { "from": "human", "value": "var readline = require('readline');\nvar mineflayer = require('mineflayer');\n\nvar rl = readline.createInterface({\n\tinput: process.stdin,\n\toutput: process.stdout,\n\tterminal: false\n});...
javascript
chosen
[ { "from": "system", "value": "Set select place marker latlng based on main map center latlng\n" }, { "from": "human", "value": "var Place = {};\n\n$(document).on('pageshow', '#select-place', function() {\n $('#select-place-map').css('height', 500);\n\n utils.getCurrentLocation().done(funct...
javascript
chosen
[ { "from": "system", "value": "Fix formatting in plugins file\n" }, { "from": "human", "value": "/* eslint-disable */\nrequire('dotenv').config()\n\nmodule.exports = (on, config) => {\n if (config.testingType === 'component') {\n require('@cypress/react/plugins/load-webpack')(on, config, {web...
javascript
chosen
[ { "from": "system", "value": "Fix use of \"new\" keyword making eslint angry\n" }, { "from": "human", "value": "import EventPost from 'flarum/components/EventPost';\n\n/**\n * The `DiscussionRenamedPost` component displays a discussion event post\n * indicating that the discussion has been renam...
javascript
chosen
[ { "from": "system", "value": "Add assert as part of App();\n" }, { "from": "human", "value": "function Dialogue(title,contents,buttons) {\n\n var Title;\n var Contents;\n var Buttons;\n\n /** Setters */\n function SetTitle(){\n\n }\n function SetButtons(){\n\n }\n func...
javascript
chosen
[ { "from": "system", "value": "LILY-2266: Allow clearing of social media fields with inline editing\n" }, { "from": "human", "value": "angular.module('app.directives').directive('editableLink', editableLink);\n\nfunction editableLink() {\n return {\n restrict: 'E',\n scope: {\n ...
javascript
chosen
[ { "from": "system", "value": "Use formatError to expose errors\n" }, { "from": "human", "value": "'use strict';\nconst Foxx = require('org/arangodb/foxx');\nconst schema = require('./schema');\nconst graphql = require('graphql-sync').graphql;\n\nconst ctrl = new Foxx.Controller(applicationContex...
javascript
chosen
[ { "from": "system", "value": "Remove accidently added error handler from update listener\n" }, { "from": "human", "value": "var browserify = require('browserify');\nvar cssify = require('cssify');\nvar watchify = require('watchify');\nvar through = require('through');\nvar fs = require('fs');\nv...
javascript
chosen
[ { "from": "system", "value": "Update UI to represent that author is also followed when you send a friend request\n" }, { "from": "human", "value": "$(function() {\n var $friend_request_button = $(\"#send-friend-request-button\");\n var $friend_request_sent_message = $(\"#friend-request-sen...
javascript
chosen
[ { "from": "system", "value": "Call setter even if object isn't writable.\n" }, { "from": "human", "value": "\"use strict\";\n/* @flow */\n\nconst Value = require('../Value');\n\nlet serial = 0;\n\n//TODO: We should call this a PropertyDescriptor, not a variable.\n\nclass PropertyDescriptor {\n\t...
javascript
chosen