conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Change lifted store structure to fit Redux DevTools 3.0\n" }, { "from": "human", "value": "export default function createDevToolsStore(onDispatch) {\n let currentState = {\n committedState: {},\n stagedActions: [],\n computedStates: [],\n skippedActions...
javascript
chosen
[ { "from": "system", "value": "Fix edge-case with blank user agent in FastBoot\n\n* Call the isMobile class with the current context to avoid leaking the global.\n" }, { "from": "human", "value": "import Service from '@ember/service';\nimport { computed, get, getProperties, set } from '@ember/obj...
javascript
chosen
[ { "from": "system", "value": "Use native doc.getElementById when available\n\nSimpleDOM doesn't have `getElementById`, but in a browser it is\nmore efficient to use the native `getElementById` instead of walking the\ndom.\n" }, { "from": "human", "value": "/*\n * Implement some helpers methods f...
javascript
chosen
[ { "from": "system", "value": "[confirm] Rename handlers to math confirmation popin props.\n" }, { "from": "human", "value": "import React, {Component, PropTypes} from 'react';\nimport ReactDOM from 'react-dom';\nimport {component as ConfirmationModal} from '../../application/confirmation-popin';...
javascript
chosen
[ { "from": "system", "value": "bau: Disable console logging of fingerprint diagnostics\n\nBy default Fingerprint2 logs messages like \"you don't have flash\ninstalled, so skipping flash fingerprinting\" to the user's console. This\nmessage is not useful for the average user, and at worst may persuade\nsome u...
javascript
chosen
[ { "from": "system", "value": "Add minus button as well and combine streams\n" }, { "from": "human", "value": "import React from 'react';\nimport { Link } from 'react-router';\nimport Cycle from 'cycle-react';\nlet Rx = Cycle.Rx;\n\nclass Testink extends React.Component {\n\trender() {\n\t\tretur...
javascript
chosen
[ { "from": "system", "value": "Switch order of supported node versions\n" }, { "from": "human", "value": "'use strict';\n\n// native runtime support for AWS\n// https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html\n\nmodule.exports = new Set([\n // .net\n // dotnetcore2.1\n // dot...
javascript
chosen
[ { "from": "system", "value": "Use more consistent attribute naming\n" }, { "from": "human", "value": "\"use strict\";\n\nmodule.exports = function(sequelize, DataTypes) {\n var Task = sequelize.define(\"Task\", {\n name: { type: DataTypes.STRING, allowNull: false },\n task_type: ...
javascript
chosen
[ { "from": "system", "value": "Remove unused statements from jobs\n\n" }, { "from": "human", "value": "import React from \"react\";\nimport { connect } from \"react-redux\";\nimport { Switch, Route } from \"react-router-dom\";\n\nimport { findJobs } from \"../actions\";\nimport JobsList from \"./...
javascript
chosen
[ { "from": "system", "value": "Use unbreakable spaces in lang dropdown\n" }, { "from": "human", "value": "import React from 'react'\nimport PropTypes from 'prop-types'\nimport moment from 'moment'\nimport { translate } from 'react-i18next'\n\nimport Dropdown from '../Dropdown'\n\nexport class Lan...
javascript
chosen
[ { "from": "system", "value": "Change mozlog use to ip from id\n" }, { "from": "human", "value": "const assert = require(\"assert\");\nconst csrf = require(\"csurf\");\nconst mozlog = require(\"../logging\").mozlog(\"csrf-middleware\");\nconst { captureRavenException } = require(\"../ravenclient\...
javascript
chosen
[ { "from": "system", "value": "Revert \"implement sign out button\"\n\nThis reverts commit b1e5d72e01ebdf8fbbc61e7fd2cc181ff0e413dc.\n" }, { "from": "human", "value": "import React from 'react';\nimport { connect } from 'react-redux'\nimport find from 'lodash/find';\nimport ChannelName from './Ch...
javascript
chosen
[ { "from": "system", "value": "Update length of Times to go to 10pm\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react';\n\nexport default class TimeColumn extends Component {\n // static propTypes = {\n // times: PropTypes.array.isRequired\n // };\n\n ren...
javascript
chosen
[ { "from": "system", "value": "Fix the import of structured emitter\n\nSigned-off-by: Fabio José <34f3a7e4e4d9fe971c99ebc4af947a5309eca653@gmail.com>\n" }, { "from": "human", "value": "const Cloudevent = require(\"../lib/cloudevent.js\");\nconst Spec = require(\"../lib/specs/spec_0_3.js\");\ncons...
javascript
chosen
[ { "from": "system", "value": "Add checks for 'name' and 'short_name'.\n" }, { "from": "human", "value": "\"use strict\";\n\nvar ManifestValidator = (function() {\n\n function _check(string) {\n var json = \"\";\n var logs = [];\n try {\n json = JSON.parse(string);\n } catch (e)...
javascript
chosen
[ { "from": "system", "value": "Break up long, long line\n" }, { "from": "human", "value": "import request from 'request';\nimport config from '../config/config';\n\nexport default {\n getFromConfig(callback) {\n let now = new Date();\n let later = new Date().setDate(now.getDate()...
javascript
chosen
[ { "from": "system", "value": "Make it possible for visible actors to move\n" }, { "from": "human", "value": "/*\n * Game core for Robots Order BreakOut Trepidation!\n *\n * @canvas = reference to an HTML5 canvas element.\n */\n\n'use strict';\nimport Actors from 'Actors.js';\n\nexport default cl...
javascript
chosen
[ { "from": "system", "value": "Add comments for the JS task configuration\n" }, { "from": "human", "value": "\"use strict\";\n\n/**\n * @typedef {{\n * input: string,\n * output: string,\n * ignoreLintFor: Array.<(string|RegExp)>,\n * }} JsTaskConfig\n */\n\nlet fs = require(\"fs\"...
javascript
chosen
[ { "from": "system", "value": "Write records to a temp file that can be read by Ruby\n" }, { "from": "human", "value": "const execFile = require('child_process').execFile;\n\nexports.handler = function(event, context) {\n const chunkSize = process.env.CHUNK_SIZE || 10;\n\n var records = event.R...
javascript
chosen
[ { "from": "system", "value": "Make sure rejection isn't duplicated\n" }, { "from": "human", "value": "'use strict';\n\nvar mongoose = require('mongoose');\nvar slack = require('./slack.js');\n\nvar Rejection = mongoose.model('Rejection');\n\nexports.reject = reject;\n\nfunction reject(args, mess...
javascript
chosen
[ { "from": "system", "value": "Update test server for build directory" }, { "from": "human", "value": "// Shamelessly pulled from Modernizr\n// https://github.com/Modernizr/Modernizr/blob/master/test/js/server.js\nvar express = require('express'),\n path = require('path'),\n fs = require('fs'),...
javascript
chosen
[ { "from": "system", "value": "Fix incorrect section name in Foundation shim\n" }, { "from": "human", "value": "var buildVariable = require('./buildVariable');\nvar format = require('util').format;\nvar repeat = require('repeat-string');\n\n/**\n * Builds a complete section of the s...
javascript
chosen
[ { "from": "system", "value": "Add option to deploy specific branch/tag which defaults to master" }, { "from": "human", "value": "/*\n @method gitPull\n Takes a flightplan instance and transport\n @param remote {Object} Flightplan transport instance\n @param webRoot {string} path to run git p...
javascript
chosen
[ { "from": "system", "value": "fix(envify): Apply envify globally so that local react files get processed by it.\n" }, { "from": "human", "value": "const babelify = require('babelify')\nconst envify = require('envify/custom')\nconst markdown = require('browserify-markdown')\nconst through = requi...
javascript
chosen
[ { "from": "system", "value": "Fix carrying kramed links around\n" }, { "from": "human", "value": "var _ = require('lodash');\n\n// Split a page up into sections (lesson, exercises, ...)\nfunction split(nodes) {\n var section = [];\n\n return _.chain(nodes)\n .reduce(function(sections, e...
javascript
chosen
[ { "from": "system", "value": "Change args order for report function\n" }, { "from": "human", "value": "const logger = require('./utils/logger'),\n argsParser = require('./parsers/argsParser'),\n styleParser = require('./parsers/styleParser'),\n filesReader = require('./utils/files...
javascript
chosen
[ { "from": "system", "value": "Disable moving after the game is over\n" }, { "from": "human", "value": "const socket = require('socket.io-client')();\n\nclass Client {\n\tconstructor(board, boardElement) {\n\t\tthis.board = board;\n\t\tthis.boardElement = boardElement;\n\t\tsocket.on('login', ({i...
javascript
chosen
[ { "from": "system", "value": "Use import() instead of System.import()\n" }, { "from": "human", "value": "import Vue from 'vue'\nimport Router from 'vue-router'\n\nVue.use(Router)\n\n// Codesplit based on route\nconst Home = ()=> System.import('pages/Home')\nconst Test = ()=> System.import('pages...
javascript
chosen
[ { "from": "system", "value": "Initialize notifier if window._rollbarConfig is found. @coryvirok.\n" }, { "from": "human", "value": "var globalnotifier = require('../globalnotifier');\nvar notifier = require('../notifier');\n\nfunction setupJSON() {\n var JSONObject = JSON;\n\n if (__USE_JSON__...
javascript
chosen
[ { "from": "system", "value": "Enable external link tracking plugin\n\nThis is needed to track external links on whitehall.\n\nPreviously, we had external link tracking but this was lost during the transition. It was assumed that external links were automatically tracked but the implementation requires the p...
javascript
chosen
[ { "from": "system", "value": "Remove related model data attribute not included\n" }, { "from": "human", "value": "'use strict';\nvar _ = require('lodash');\nvar debug = require('ghost-ignition').debug('format');\nvar Mapper = require('./vendor/jsonapi-mapper');\n\nvar defaultSerializerOptions = ...
javascript
chosen
[ { "from": "system", "value": "Fix getMergeCommits to return empty array\n\nIt turns out that `split('\\n')` will return an array with the whole\nstring if the separator is not found rather than the whole string\n" }, { "from": "human", "value": "'use strict'\n\nconst exec = require('./util').exe...
javascript
chosen
[ { "from": "system", "value": "Make sure events gets initialized\n" }, { "from": "human", "value": "var events = require('events'),\n util = require('util'),\n EventRegistry,\n EventRegistryInstance;\n\nEventRegistry = function () {};\nutil.inherits(EventRegistry, events.EventEmitter...
javascript
chosen
[ { "from": "system", "value": "Use the navigator's language properties even if a user exists but the user has not yet choosen a profile language. If the browser provides multiple preferred languages via `navigator.languages`, select the most-preferred one.\n\nWKN-47\n" }, { "from": "human", "valu...
javascript
chosen
[ { "from": "system", "value": "Support passing an array of urls.\n" }, { "from": "human", "value": "const fs = require('fs');\nconst {join} = require('path');\nconst {promisify} = require('util');\n\nconst readFile = promisify(fs.readFile);\nconst writeFile = promisify(fs.writeFile);\n\nconst mkd...
javascript
chosen
[ { "from": "system", "value": "Add admin routes and layout management\n" }, { "from": "human", "value": "var subscriptions = new SubsManager();\n\nRouter.configure({\n\tlayoutTemplate: 'layout',\n\tloadingTemplate: 'loading',\n\tnotFoundTemplate: 'notFound',\n});\n\nRouter.route('/', {\n\tname: '...
javascript
chosen
[ { "from": "system", "value": "Update with reference to global nav partial\n" }, { "from": "human", "value": "var _ = require('lodash')\nvar fs = require('fs')\nvar gzip = require('gzip-size')\nvar filesize = require('filesize')\nvar postcss = require('postcss')\nvar cssstats = require('cssstats'...
javascript
chosen
[ { "from": "system", "value": "Clean up source based on linter suggestions.\n" }, { "from": "human", "value": "const path = require('path')\n\nclass Loader {\n\n cwd() {\n return process.cwd()\n }\n\n moduleRepo(customPath = \"\") {\n if (customPath !== '') return customPath\n return ...
javascript
chosen
[ { "from": "system", "value": "Fix the Output constructor does not throw TypeError\n" }, { "from": "human", "value": "/*\n * Optics / output.js\n * copyright (c) 2016 Susisu\n */\n\n/**\n * @module output\n */\n\n\"use strict\";\n\nfunction endModule() {\n module.exports = Object.freeze({\n ...
javascript
chosen
[ { "from": "human", "value": "Add 'set', 'parse', 'serialize', 'serialise', and 'stringify'\n" }, { "from": "gpt", "value": "(function(){\n 'use strict';\n\n var parser = {};\n\n module.exports = exports = {\n 'set': function(prop, imp){\n // normalize\n if (prop === 'stringify' |...
javascript
chosen
[ { "from": "system", "value": "Update profile by passing accessToken, not profile data\n" }, { "from": "human", "value": "import { observable, action } from 'mobx'\n\nclass ProfileStore {\n @observable profile\n\n @action\n updateProfile(profile) {\n this.profile = profile\n }\n}\n\nexport...
javascript
chosen
[ { "from": "system", "value": "Refactor user input story with padding parameter.\n" }, { "from": "human", "value": "/**\n * User Input Component Stories.\n *\n * Site Kit by Google, Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not...
javascript
chosen
[ { "from": "system", "value": "Clone only valid react element\n" }, { "from": "human", "value": "import React, {\n PureComponent,\n createElement,\n Children,\n cloneElement\n} from 'react';\nimport PropTypes from 'prop-types';\n\nimport eventManager from './../util/eventManager';\n\nclass Co...
javascript
chosen
[ { "from": "system", "value": "Add a property onto VideoList that calls a function which updates App state with a selectVideo.\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport ReactDom from 'react-dom';\nimport YTSearch from 'youtube-api-search';\nimport Search...
javascript
chosen
[ { "from": "system", "value": "Add export to fix bundle problem\n" }, { "from": "human", "value": "export function configure(config) {\n config.globalResources(\"./page-pod\");\n}\n" }, { "from": "gpt", "value": "export { PagePod } from \"./page-pod\";\n\nexport function configure(co...
javascript
chosen
[ { "from": "system", "value": "fix(random): Fix random with a number issue\n\nIt was returning an array of empty values because I have no idea how to program :-(\n" }, { "from": "human", "value": "var uniqueRandomArray = require('unique-random-array');\nvar starWarsNames = require('./starwars-nam...
javascript
chosen
[ { "from": "system", "value": "Fix toggle-pin and clean code\n" }, { "from": "human", "value": "(function () {\n\t'use strict';\n\t// Awesome Browser Shortcuts\n\tchrome.commands.onCommand.addListener(function (command) {\n\t\tconsole.log(command);\n\t\tif (command === 'toggle-pin') {\n\t\t\t// G...
javascript
chosen
[ { "from": "system", "value": "Include utm_reader in stripped parameters" }, { "from": "human", "value": "chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {\n var queryStringIndex = tab.url.indexOf('?');\n if (tab.url.indexOf('utm_') > queryStringIndex) {\n var stri...
javascript
chosen
[ { "from": "system", "value": "Use prefixes in SPARQL query\n" }, { "from": "human", "value": "import Joi from 'joi'\nimport { graph } from 'helpers/sparql'\n\nexport default [\n {\n path: '/pipelines',\n query: `\n PREFIX core: <http://mu.semte.ch/vocabularies/core/>\n CONSTRUCT...
javascript
chosen
[ { "from": "system", "value": "Add placeholder of example ID to manual project entry\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nexport default class AddProject extends Component {\n constructor() {\n super();\n\n this.state = {\n projectId: '',\n ...
javascript
chosen
[ { "from": "system", "value": "Fix server-side locale matching logic\n" }, { "from": "human", "value": "export default ({\n defaultLocale,\n siteLocales,\n} = {}) => (req, res, next) => {\n if (typeof defaultLocale !== 'string') {\n throw new Error(`Expected defaultLocale to be a locale str...
javascript
chosen
[ { "from": "system", "value": "Add remove temperatureSync from blacklist\n" }, { "from": "human", "value": "/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2020\n */\n\nimport AsyncStorage from '@react-native-community/async-storage';\nimport { persistStore, persistReducer } from 'redu...
javascript
chosen
[ { "from": "system", "value": "Add midnight time to date stamps.\n" }, { "from": "human", "value": "SimpleForm = {\n processForm: function(target) {\n var form = {};\n array = $(target).serializeArray();\n _.each(array, function(formItem) {\n type = $(target).find(\"input[name='\" ...
javascript
chosen
[ { "from": "system", "value": "Add 7digital api key spot\n" }, { "from": "human", "value": "/* cp to secrets.js and fill w/ yr api keys as needed */\nexport default function secrets() {\n\treturn {\n\t\techoNest: '',\n\t};\n}\n" }, { "from": "gpt", "value": "/* cp to secrets.js and fi...
javascript
chosen
[ { "from": "system", "value": "Update to regex exec so returns array if no match found\n" }, { "from": "human", "value": "var _curry = require('./internal/_curry');\n\nvar Regex = require('./internal/_primitives').Regex;\n\n/**\n * Point-free, curried form of regular expression's test method.\n *...
javascript
chosen
[ { "from": "system", "value": "Allow importing Calendar by destructuring\n" }, { "from": "human", "value": "import Calendar from './Calendar';\nimport CenturyView from './CenturyView';\nimport DecadeView from './DecadeView';\nimport YearView from './YearView';\nimport MonthView from './MonthView'...
javascript
chosen
[ { "from": "system", "value": "Use alternate text for the schedule tweet when there's a new stage\n\n" }, { "from": "human", "value": "const TwitterPostBase = require('./TwitterPostBase');\nconst { captureScheduleScreenshot } = require('../screenshots');\nconst { readData } = require('../utilitie...
javascript
chosen
[ { "from": "system", "value": "Set default value for options argument" }, { "from": "human", "value": "const hash = require('object-hash');\n\nconst toSafeObject = obj => JSON.parse(JSON.stringify(obj || {}));\n\nfunction cache(func, options) {\n return (root, args, context) => {\n if (!conte...
javascript
chosen
[ { "from": "system", "value": "Define some variables for manual debugging\n" }, { "from": "human", "value": "const React = require('react');\nconst ReactDOM = require('react-dom');\nconst { Provider } = require('react-redux');\n\nconst { initializeApp } = require('./actions');\nconst Root = req...
javascript
chosen
[ { "from": "system", "value": "Fix typo in variable name" }, { "from": "human", "value": "import {Transform} from 'stream';\nimport SVGOptim from 'svgo';\nimport {PluginError} from 'gulp-util';\n\nconst PLUGIN_NAME = 'gulp-svgmin';\n\nmodule.exports = function (opts) {\n const stream = new Tra...
javascript
chosen
[ { "from": "system", "value": "Revert \"verifying token is present. deploy test\"\n\nThis reverts commit 58bf3a514f5c3ea77062ebee8b4fc16ed10f81f8.\n" }, { "from": "human", "value": "const { response } = require('./util/lambda')\n\nfunction handler(event, context, callback) {\n\n const { body }...
javascript
chosen
[ { "from": "system", "value": "Add spec for divisible by 3\n" }, { "from": "human", "value": "describe('pingPongOutput', function() {\n it(\"is the number for most input numbers\", function() {\n expect(pingPongOutput(2)).to.equal(2);\n });\n});\n" }, { "from": "gpt", "value": "d...
javascript
chosen
[ { "from": "system", "value": "Use Switch instead of exact\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Provider } from 'react-redux';\nimport { createStore, applyMiddleware } from 'redux';\nimport { BrowserRouter, Route } from 'react-...
javascript
chosen
[ { "from": "system", "value": "Allow subdomain gateway to use http\n\ngo-ipfs 0.5.0 can use a subdomain as gateway to preserve origin security. This updates orbit.chat to be able to load without an https error." }, { "from": "human", "value": "'use strict'\n\nimport React from 'react'\nimport { r...
javascript
chosen
[ { "from": "system", "value": "Make the tabs manager global\n" }, { "from": "human", "value": "define([\n \"src/views/manager\",\n \"less!src/stylesheets/main.less\"\n], function(TabsManager) {\n var hr = codebox.require(\"hr/hr\");\n var manager = new TabsManager();\n\n // Add tab...
javascript
chosen
[ { "from": "system", "value": "Add basic parts of app.\n" }, { "from": "human", "value": "// Import NPM dependencies like this:\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\n// Import styles like this:\nimport './styles/main.scss';\n\n// Import dependencies like this:\nimport ...
javascript
chosen
[ { "from": "system", "value": "Add delay test to the test index." }, { "from": "human", "value": "\"use strict\";\n\nexports[\"test filter\"] = require(\"./filter\")\nexports[\"test map\"] = require(\"./map\")\nexports[\"test take\"] = require(\"./take\")\nexports[\"test take while\"] = require(\...
javascript
chosen
[ { "from": "system", "value": "Put in a max for how many entities will be generated\n" }, { "from": "human", "value": "var chance = require('./fake-extension.js'),\n glimpse = require('glimpse');\n\nfunction publishEntry() {\n var mvc = chance.mvc(),\n\n serverLowerTime = chance.inte...
javascript
chosen
[ { "from": "system", "value": "Fix test, assert stdout equality\n" }, { "from": "human", "value": "var test = require('tape');\nvar child = require('child_process');\n\ntest('--client chrome', function(t) {\n var exe = child.spawn('node', ['./bin/cmd.js', '--client', 'chrome', 'fixture/console.j...
javascript
chosen
[ { "from": "system", "value": "Add DB sync toggle via environment variable" }, { "from": "human", "value": "import express from 'express'\nimport mongoose from 'mongoose'\nimport winston from 'winston'\nimport courses from './api/courses'\nimport buildings from './api/buildings'\nimport db from '...
javascript
chosen
[ { "from": "system", "value": "Fix - Removed obsolete code\n" }, { "from": "human", "value": "/* global Backbone */\n/* global $ */\n/* global _ */\n\n(function(){\n\n \"use strict\";\n\n var app = app || {};\n\n $(document).ready(function() {\n\n var myData = {\n type : 'confirm',\n ...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary buildTarget from install action" }, { "from": "human", "value": "import * as actions from './actions'\nimport plugins from './plugins'\n\nexport default {\n build (options) {\n const env = plugins({ ...options, buildTarget: 'build' })\n act...
javascript
chosen
[ { "from": "system", "value": "Enable strict mode (no warnings)\n" }, { "from": "human", "value": "/* eslint-disable import/no-import-module-exports */\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { QueryClientProvider, QueryClient } from '@tanstack/react-query';\n\nim...
javascript
chosen
[ { "from": "system", "value": "Use default dom node id and template\n" }, { "from": "human", "value": "{\n function say({ domNodeId, message }) {\n const domNode = document.getElementById(domNodeId);\n domNode.innerHTML = message;\n }\n say({ domNodeId: 'root', message: 'He...
javascript
chosen
[ { "from": "system", "value": "Make function pure by allowing doc to be passed in\n" }, { "from": "human", "value": "// Global\nconst doc = document;\n\n// Loaded ready states\nconst loadedStates = ['interactive', 'complete'];\n\n// Return Promise\nmodule.exports = cb => new Promise(resolve => {\...
javascript
chosen
[ { "from": "system", "value": "Use localhost as default hostname on all platforms\n" }, { "from": "human", "value": "define(function (require, exports) {\n \"use strict\";\n\n var Strings = require(\"i18n!nls/strings\");\n\n /**\n * Configuration of settings for use in `setupPreferen...
javascript
chosen
[ { "from": "system", "value": "Fix early return failure to reset context\n" }, { "from": "human", "value": "\nvar Picker = function(context) {\n this.context = context;\n}\n\n\nPicker.prototype = {\n pick: function(node, x, y, lx, ly) {\n var ctx = this.context;\n\n var tx = node.x || 0;\...
javascript
chosen
[ { "from": "system", "value": "Add way to notify the task when finished.\n" }, { "from": "human", "value": "var fs = require('fs');\nvar lodash = require('lodash');\nvar path = require('path');\n\nvar package = require(path.join(process.cwd(), 'package.json'));\nvar initDir = path.join(__dirname,...
javascript
chosen
[ { "from": "system", "value": "Make compatible with coffee-script 1.7" }, { "from": "human", "value": "require('coffee-script');\nvar roaster = require(\"roaster\");\nvar taskLists = require(\"../src/index\");\nvar fs = require(\"fs\");\n\nvar options = {};\noptions.isFile = true;\n\nroaster(\"./...
javascript
chosen
[ { "from": "system", "value": "Use var VNode to fix reduce_funcs uglify\n" }, { "from": "human", "value": "/**\n * Virtual DOM Node\n * @typedef VNode\n * @property {string | function} nodeName The string of the DOM node to create or Component constructor to render\n * @property {Array<VNode | st...
javascript
chosen
[ { "from": "system", "value": "Use object instead of array for ad info\n\nCurrently the info property of an ad is instantiated as an Array but used as an Object. This causes bugs in other libraries which use the ad object." }, { "from": "human", "value": "//ad-scraper.js\n/*Scrapes a Kijiji ad an...
javascript
chosen
[ { "from": "system", "value": "Add search word to response\n" }, { "from": "human", "value": "import express from 'express';\nimport cheerio from 'cheerio';\nimport request from 'request';\n\nconst router = new express.Router();\n\nrouter.post('/', (req, res) => {\n const url = `http://ordbok.ui...
javascript
chosen
[ { "from": "system", "value": "Create Buffer with encoding 'binary'.\n" }, { "from": "human", "value": "// A mock stream implementation that breaks up provided data into\n// random-sized chunks and emits 'data' events. This is used to simulate\n// data arriving with arbitrary packet boundaries.\n...
javascript
chosen
[ { "from": "system", "value": "Revert \"fix: so that sync will not always be false\"\n" }, { "from": "human", "value": "const isString = val => typeof val === 'string';\nconst isBlob = val => val instanceof Blob;\n\npolyfill.call(typeof window === 'object' ? window : this);\n\nfunction polyfill()...
javascript
chosen
[ { "from": "system", "value": "Add canDrag validation when card has no attack\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react';\nimport { getEmptyImage } from 'react-dnd-html5-backend';\nimport { DragSource as dragSource } from 'react-dnd';\nimport { CardMode...
javascript
chosen
[ { "from": "system", "value": "Add classname prop to render\n" }, { "from": "human", "value": "import React from 'react';\nimport cx from 'classnames';\nimport Col from './Col';\nimport Icon from './Icon';\n\nclass Navbar extends React.Component {\n constructor(props) {\n super(props);\n t...
javascript
chosen
[ { "from": "system", "value": "Test both clone and init static methods.\n" }, { "from": "human", "value": "/*\n * git-exec - test script\n *\n * Copyright (c) 2013 Alex J Burke\n * Licensed under the MIT license.\n */\n\n// imports\nvar fs = require('fs');\n\n// local imports\nvar Git = require('...
javascript
chosen
[ { "from": "system", "value": "Fix flaky namespace dropdown test\n\nSigned-off-by: GuessWhoSamFoo <8c93751a21b6f76ce6eea67135428b7f11f28a78@vmware.com>\n" }, { "from": "human", "value": "describe('Namespace', () => {\n beforeEach(() => {\n cy.visit('/');\n });\n\n it('namespaces navigation'...
javascript
chosen
[ { "from": "system", "value": "Add workaround that makes completion actually work.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar fs = require('fs');\nvar path = require('path');\nvar tab = require('tabalot');\nvar noop = function() {}\nvar homedir = path.resolve(process.env[(proce...
javascript
chosen
[ { "from": "system", "value": "Fix test case to adapt web standard\n" }, { "from": "human", "value": "import assert from 'power-assert';\n\nimport {element} from '../src/event';\n\ndescribe('Event helpers:', () => {\n describe('element', () => {\n let input;\n\n beforeEach(() => {\n i...
javascript
chosen
[ { "from": "system", "value": "Test that null values are also stored\n" }, { "from": "human", "value": "describe(\"Almacen\", function() {\n\n it(\"should set data in the localStorage\", function() {\n\n almacen.local.set(\"string\", \"hello\");\n almacen.local.set(\"number\", 23);\n al...
javascript
chosen
[ { "from": "system", "value": "Set backend to production backend\n" }, { "from": "human", "value": "import 'es6-symbol/implement';\nimport {Provider} from 'react-redux';\nimport store from './src/redux/store';\nimport AppViewContainer from './src/modules/AppViewContainer';\nimport React from 'rea...
javascript
chosen
[ { "from": "system", "value": "Add route declaration to route dictionary\n" }, { "from": "human", "value": "var curry = require('curry');\nvar EventEmitter = require('events').EventEmitter;\nvar registeredRoute = new EventEmitter()\n , registeredRouteError = new EventEmitter();\n\nconst PUBL...
javascript
chosen
[ { "from": "system", "value": "Update groupBy test case description.\n" }, { "from": "human", "value": "QUnit.test(\"groupBy() 1:1 0:2 1:3\", function(assert)\r\n{\r\n\tvar result = Canal.of([ 2, 3, 4 ]) //\r\n\t.groupBy(function(d)\r\n\t{\r\n\t\treturn d % 2;\r\n\t}).collect();\r\n\tassert.propE...
javascript
chosen
[ { "from": "system", "value": "Add tests for compiling regexps\n" }, { "from": "human", "value": "\"use strict\";\n\nvar Router = require(\"../router\");\n\nexports.testValidAcceptHeader = function (test) {\n\tvar results = Router.prototype._parseAcceptHeader(\"application/json\");\n\ttest.deepEq...
javascript
chosen
[ { "from": "system", "value": "Change logger middleware due the new version\n\nThe new version requires use the createLogger function" }, { "from": "human", "value": "import { createStore, applyMiddleware } from 'redux';\nimport thunkMiddleware from 'redux-thunk';\nimport loggerMiddleware from 'r...
javascript
chosen
[ { "from": "system", "value": "Refactor loadJson so it can be tested.\n" }, { "from": "human", "value": "define(['utils/ajax'], function (Ajax) {\n /**\n * Loads a JSON File and passes the content to a callback function\n * @param {string} jsonFile The location of the JSON file in wh...
javascript
chosen
[ { "from": "system", "value": "Add homebrew redux middleware to catch all errors..\n" }, { "from": "human", "value": "\nimport {createStore, applyMiddleware, compose} from 'redux'\nimport {electronEnhancer} from 'redux-electron-enhancer'\nimport createLogger from 'redux-cli-logger'\nimport create...
javascript
chosen
[ { "from": "system", "value": "Remove origin and destination fields. They are not in Helsinki API\n" }, { "from": "human", "value": "var moment = require('moment');\n\n// Returned format from original API is a bit strange and very deeply nested.\n// Original API url: http://dev.hsl.fi/siriaccess/...
javascript
chosen
[ { "from": "system", "value": "Change database name to ten20api\n" }, { "from": "human", "value": "server = require('./server')\n\n\nserver.startServer(3001, 'testdb', function() {\n\n});" }, { "from": "gpt", "value": "server = require('./server')\n\n\nserver.startServer(3001, 'ten20a...
javascript
chosen