conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Update build script to build templates in all template subdirectories\n" }, { "from": "human", "value": "import gulp from 'gulp';\nimport babel from 'gulp-babel';\n\nconst paths = {\n es6: 'src/**/*.js',\n templates: 'src/**/templates/*'\n};\n\n// Compile ES20...
javascript
chosen
[ { "from": "system", "value": "Add support for more than one subdomain." }, { "from": "human", "value": "var parseDomain = require(\"parse-domain\");\n\nfunction getDomainDataFromHost(host) {\n var defaultSubdomain = \"www\";\n\n var subdomainAliases = {\n \"local\": defaultSubdomain...
javascript
chosen
[ { "from": "system", "value": "Add comment to router context\n" }, { "from": "human", "value": "/*\nThis component is the map view. It shows the user the possible routes he/she can take to arrive at the destination\n*/\n\nvar React = require('react');\n\nvar MapView = React.createClass({\n conte...
javascript
chosen
[ { "from": "system", "value": "Change env var name to match our new standard\n\nThis environment variable was not getting used previously, and was only\nput in because we knew we would eventually start using it. However, when\nwe started using it we decided to simply make it 'CODE_VERSION' instead\nof 'DEPLO...
javascript
chosen
[ { "from": "system", "value": "Change back to original: Animations should depend on the DE.\n" }, { "from": "human", "value": "'use strict';\n\nconst $ = require('jquery'),\n remote = require('remote');\n\nlet main = remote.getCurrentWindow();\n\n$(function(){\n $('.tools .close').on('click...
javascript
chosen
[ { "from": "system", "value": "Remove the delay on main.js\n" }, { "from": "human", "value": "altboiler.config({\n action: '',\n content: Assets.getText('loader/main.html'),\n css: Assets.getText('loader/styles.css')\n})\n\n// This is a little overkill\n// // Add an artificial delay\n// WebApp...
javascript
chosen
[ { "from": "system", "value": "Disable the score updater until a replacement can be implemented\n" }, { "from": "human", "value": "require('dotenv').config();\nconst { job } = require('cron');\nconst app = require('./app');\nconst logger = require('./lib/logger');\nconst nflScoreUpdater = require...
javascript
chosen
[ { "from": "system", "value": "Remove all on* attributes in freeze-dry.\n" }, { "from": "human", "value": "function removeNode(node) {\n node.parentNode.removeChild(node)\n}\n\nexport default async function removeScripts({rootElement}) {\n const scripts = Array.from(rootElement.querySelecto...
javascript
chosen
[ { "from": "system", "value": "Add owner to the search field placeholder text.\n" }, { "from": "human", "value": "/*global $,app*/\n\napp.views.front = function () {\n app.hooks.crumbs.update();\n\n app.hooks.search.val('').attr('placeholder', 'Enter address, address range, account number, or i...
javascript
chosen
[ { "from": "system", "value": "Fix error in watch mode" }, { "from": "human", "value": "/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\nvar DependenciesBlock = require(\"./DependenciesBlock\");\n\nfunction AsyncDependenciesBlock(name, modu...
javascript
chosen
[ { "from": "system", "value": "Fix isFunction failure message differences\n\nThe toString representation of functions has changed slightly between\nNode 8 and Node 10. Node 10 retains the original whitespace between\nthe function keyword and the opening braces while Node 8 always inserts\na blank.\n" }, ...
javascript
chosen
[ { "from": "system", "value": "Set empty array as a default for the corePresets and frameworkPresets\n" }, { "from": "human", "value": "import path from 'path';\nimport loadPresets from './presets';\nimport serverRequire from './serverRequire';\n\nconst noopWrapper = config => config;\n\nfunction...
javascript
chosen
[ { "from": "system", "value": "Destroy session if user is not found\n" }, { "from": "human", "value": "var P = require('bluebird');\nvar user = require('./user');\nvar users = require('./db').get('users');\nP.promisifyAll(users);\n\nmodule.exports = function(req, res, next) {\n if (!req.session....
javascript
chosen
[ { "from": "system", "value": "Remove unneeded moment locales from bundle\n" }, { "from": "human", "value": "/* eslint-disable no-var */\n\nvar autoprefixer = require('autoprefixer');\nvar path = require('path');\n\nmodule.exports = {\n module: {\n loaders: [\n {\n test: /\\.png$/...
javascript
chosen
[ { "from": "system", "value": "Add track art to Jamendo connector\n" }, { "from": "human", "value": "'use strict';\n\n/* global Connector */\n\nConnector.playerSelector = '#app-player';\n\nConnector.currentTimeSelector = '.hidden-xs > .js-player-position';\n\nConnector.durationSelector = '.hidden...
javascript
chosen
[ { "from": "system", "value": "Pandora: Add support for new website\n\nResolved #1068.\nResolves #1194.\n" }, { "from": "human", "value": "'use strict';\n\n/* global Connector */\n\nConnector.playerSelector = '#playbackControl';\n\nConnector.trackArtImageSelector = '.playerBarArt';\n\nConnector.a...
javascript
chosen
[ { "from": "system", "value": "Add $ function to module level-editor\n" }, { "from": "human", "value": "'use strict';\n\nfunction checkKey(e) {\n e = e || window.event;\n /*let dir = keyToDirection(e.keyCode);\n if (dir.direction != ''){\n currentLevel.pig.tryMove(dir);\n // ++globalSteps...
javascript
chosen
[ { "from": "system", "value": "Fix asset `asyncErrorHandling`, use valid global instance of `wTools`\n" }, { "from": "human", "value": "\nrequire( 'wTesting' );\nconst _ = require( 'wTools' );\n_.include( 'wConsequence' );\n\n//\n\nfunction asyncErrorHandling( test )\n{\n _.Consequence.UncaughtT...
javascript
chosen
[ { "from": "system", "value": "Change maximum nested list level to 1\n" }, { "from": "human", "value": "import { Map } from 'immutable';\nimport { DefaultDraftBlockRenderMap } from 'draft-js';\n\nimport { BLOCK_TYPE } from '../api/constants';\n\n// Maximum level of nesting for unordered and order...
javascript
chosen
[ { "from": "system", "value": "Change conditional on addUser if statements to check whether member pointer is undefined or points to a user\nChange member properties in problem model back to async:true to allow loading of data by other users\n" }, { "from": "human", "value": "import Ember from 'e...
javascript
chosen
[ { "from": "system", "value": "Fix loading of modules by only their name\n" }, { "from": "human", "value": "var findup = require('findup'),\n path = require('path');\n\nvar local = require('./local');\n\nfunction find(dir, file, callback) {\n var name = file.split('/')[0],\n modulePa...
javascript
chosen
[ { "from": "system", "value": "Enable links in list group\n" }, { "from": "human", "value": "var React = require('react');\nvar classNames = require('classnames');\n\nvar ListItem = React.createClass({\n propTypes: {\n active: React.PropTypes.bool,\n href: React.PropTypes...
javascript
chosen
[ { "from": "system", "value": "Include an uglified version when compiling\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n var requirejsOptions = require('./config');\n\n requirejsOptions.optimize = 'none';\n\n // Project configuration.\n grunt.initConfig({\n pkg: ...
javascript
chosen
[ { "from": "system", "value": "Use basic HTTP authentication instead of headers\n" }, { "from": "human", "value": "var Request = require(\"request\");\n\nfunction OAuth(clientId, clientSecret, redirectUri, opt_opts) {\n this.clientId = clientId;\n this.clientSecret = clientSecret;\n this...
javascript
chosen
[ { "from": "system", "value": "Return { events } instead of array\n" }, { "from": "human", "value": "\nconst dal = require('./dal'); // Data access layer\nconst loggers = require('../../services/logs/loggers');\n\nconst status = require('http-status-codes');\n\nexports.getRecent = (req, res, next...
javascript
chosen
[ { "from": "system", "value": "Make sure the markers get ouput\n" }, { "from": "human", "value": "\nrequire('ti-mocha');\n\nvar should = require('should');\n\ndescribe('Smoke tests', function () {\n it('should work', function () {\n true.should.be.true;\n });\n});\n\ndescribe('Require', func...
javascript
chosen
[ { "from": "system", "value": "Add the ObjectId to a job request that is missing it\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\n// var mongoose = require('../models/mongoose');\nconst config = require('../config');\n\n// Redis\nconst Re...
javascript
chosen
[ { "from": "system", "value": "Call start() in file:/// test if not file:///" }, { "from": "human", "value": "Batman.ready(function() {\n \n module('Batman.Request');\n \n test('creation', function() {\n var request = Batman.Request({url: 'stubs.js'});\n ok(request.isReq...
javascript
chosen
[ { "from": "system", "value": "Set GAS_ESTIMATE_MULTIPLIER to 1.25 (seems to prevent tx failure)\n" }, { "from": "human", "value": "\"use strict\";\n\nvar BigNumber = require(\"bignumber.js\");\n\nBigNumber.config({ MODULO_MODE: BigNumber.EUCLID, ROUNDING_MODE: BigNumber.ROUND_HALF_DOWN });\n\nmo...
javascript
chosen
[ { "from": "system", "value": "Add ± to the symbols\n" }, { "from": "human", "value": "module.exports = {\n error: {\n length: 'Length should be a valid positive number',\n password: 'Password should be a valid string'\n },\n regex: {\n digits: '(\\\\d.*)',\n letters: '([a-zA-Z].*)...
javascript
chosen
[ { "from": "system", "value": "Revert \"Attempt to catch IE console logs with Stephane's fix\"\n\nThis reverts commit 39088b4e1d5ae0986db615be82ab5dabb1610fe8.\n" }, { "from": "human", "value": "//To get sjhint to ignore protrator calls ad this to .jshint \"browser\",\"element\",\"by\",\"expect\"...
javascript
chosen
[ { "from": "system", "value": "BB-3925: Add offer button unavailable on Quote create\n" }, { "from": "human", "value": "define([\n 'jquery',\n './select2-view'\n], function($, Select2View) {\n 'use strict';\n\n var Select2AutocompleteView;\n Select2AutocompleteView = Select2View.ex...
javascript
chosen
[ { "from": "system", "value": "Add ogv as a video type\n" }, { "from": "human", "value": "module.exports = {\n isPlayable,\n isVideo,\n isAudio,\n isPlayableTorrent\n}\n\nvar path = require('path')\n\n/**\n * Determines whether a file in a torrent is audio/video we can play\n */\nfunction isP...
javascript
chosen
[ { "from": "system", "value": "Update configuration to load heroku db settings\n" }, { "from": "human", "value": "module.exports = {\n 'database': {\n 'host': 'localhost',\n 'user': 'choirmaster',\n 'password': 'choirmaster',\n 'database': 'choirmaster'\n },\n\n 'authentication': {...
javascript
chosen
[ { "from": "system", "value": "Remove directory hierarchy test code\n" }, { "from": "human", "value": "define(\n\t['backbone', 'views/filenameview', 'collections/files', 'app'],\n\tfunction(Backbone, FilenameView, Files, app) {\n\tvar FilesView = Backbone.View.extend({\n\t\ttagName: 'ul',\n\n\t\t...
javascript
chosen
[ { "from": "system", "value": "[local-sync] Update DeleteSentMessage task for ordering\n" }, { "from": "human", "value": "const SyncbackTask = require('./syncback-task')\n\nclass DeleteSentMessageGMAIL extends SyncbackTask {\n description() {\n return `DeleteSentMessage`;\n }\n\n async run(...
javascript
chosen
[ { "from": "system", "value": "Introduce a timeout before tests to fix loading issues.\n\nThis should fix sourcemap resolution issues in most browsers." }, { "from": "human", "value": "/* globals requirejs, require */\n\nvar moduleName, shouldLoad;\n\nQUnit.config.urlConfig.push({ id: 'nojshint',...
javascript
chosen
[ { "from": "system", "value": "Revert Closure Compiler Tests @bug W-2848338@\n" }, { "from": "human", "value": "(function(){var rrrrr = \"ARRRRRRRR\";\nfunction dress() {\n return\"like a pirate\"\n}\nwindow.dress = dress;\nvar five = 6, rrrrr2 = \"ARRRRRRRR\";\nfunction dressPiratesOfTheCarribe...
javascript
chosen
[ { "from": "system", "value": "Remove unneeded instance from example\n" }, { "from": "human", "value": "var Redular = require('../index');\n\nvar redular = new Redular();\nvar redular2 = new Redular();\n\nredular.defineHandler('goodbye', function(name){\n console.log('Goodbye!');\n});\n\nredular...
javascript
chosen
[ { "from": "system", "value": "Add saveUser method to the route\n" }, { "from": "human", "value": "'use strict';\n\nimport validate from 'express-validation';\nimport express from 'express';\n\nimport { updateUserSchema } from './userValidation';\n\nimport {\n updateUser,\n removeUser,\n getUs...
javascript
chosen
[ { "from": "system", "value": "Delete e Put no POO - User\n" }, { "from": "human", "value": "\nconst userRouter = function(app){\n const _ = require('lodash');\n var User = require('../model/user');\n var UserList = require('../model/repository.users');\n\n var repository = new UserLi...
javascript
chosen
[ { "from": "system", "value": "Add timeout since webpack wont reload on computer without it\n" }, { "from": "human", "value": "import webpack from 'webpack';\nimport WebpackDevServer from 'webpack-dev-server';\nimport config from '../config';\nimport webpackConfig from './webpack/development_hot'...
javascript
chosen
[ { "from": "system", "value": "Repair auth for dispatch rules\n" }, { "from": "human", "value": "'use strict';\n\nvar auth = require('../../auth/auth.service');\nvar express = require('express');\nvar controller = require('./dispatch-rule.controller');\n\nvar router = express.Router();\n\nrouter....
javascript
chosen
[ { "from": "system", "value": "Remove product specific method from vent constructor. [rev: matthew.gordon2]\n" }, { "from": "human", "value": "define([\n 'backbone'\n], function(Backbone) {\n\n var Vent = function(router){\n _.bindAll(this, 'fireResize');\n\n $(window).on('res...
javascript
chosen
[ { "from": "system", "value": "Change the input entry to 'lib/index.js'\n" }, { "from": "human", "value": "import path from 'path';\n\nexport default {\n cache: true,\n target: 'web',\n entry: path.resolve(__dirname, 'src/index.jsx'),\n output: {\n path: path.join(__dirname, 'd...
javascript
chosen
[ { "from": "system", "value": "Make wrapped console compatible in oldIE" }, { "from": "human", "value": "var config = require('./config')\n\nvar logStack = []\n\nmodule.exports = {\n getLogStack: function () {\n return logStack\n },\n\n error: function(msg, data) {\n return this.log('%c'...
javascript
chosen
[ { "from": "system", "value": "Support playoff lines at different Bovada URL\n" }, { "from": "human", "value": "const axios = require('axios');\nconst BovadaParser = require('../services/BovadaParser');\n\nmodule.exports.getLines = async () => BovadaParser.call((await axios.get(\n 'https://www.b...
javascript
chosen
[ { "from": "system", "value": "Update helper and change var to const\n" }, { "from": "human", "value": "Template.editQuestionsGroup.helpers({\n\tekloreQuestionsLinked() {\n\t\treturn EkloreQuestions\n\t\t\t.find({\n\t\t\t\t'questionGroupId': this._id\n\t\t\t});\n\t}\n});\n\nTemplate.editQuestions...
javascript
chosen
[ { "from": "system", "value": "Remove async and add function wrapper\n\nRemoved an unnecessary async from a function and add a wrapper for\ncatching async error\n" }, { "from": "human", "value": "import healthCheck from './healthcheck';\n\n// eslint-disable-next-line consistent-return\nexport def...
javascript
chosen
[ { "from": "system", "value": "Add input field to control volume\n" }, { "from": "human", "value": "import React from 'react'\nimport {compose, withState} from 'recompose'\n\nimport {clickable} from '../style.css'\nimport {Audio, View, Text} from '../components'\n\nlet Player = compose(\n withSt...
javascript
chosen
[ { "from": "system", "value": "Add a timestamp to each report\n" }, { "from": "human", "value": "/*global Firebase, grecaptcha*/\n;(function() {\n var form = document.querySelector('.al-form > form');\n var captchaIsValid = false;\n window.initCaptcha = function() {\n var captcha = docume...
javascript
chosen
[ { "from": "system", "value": "Add reference for UUID generator code" }, { "from": "human", "value": "// if you checked \"fancy-settings\" in extensionizr.com, uncomment this lines\n\n// var settings = new Store(\"settings\", {\n// \"sample_setting\": \"This is how you use Store.js to remembe...
javascript
chosen
[ { "from": "system", "value": "Use facingMode: user when retrieving user video\n" }, { "from": "human", "value": "import * as NotifyActions from './NotifyActions.js'\nimport * as SocketActions from './SocketActions.js'\nimport * as StreamActions from './StreamActions.js'\nimport * as constants fr...
javascript
chosen
[ { "from": "system", "value": "Fix arguments in example task from src/tasks\n" }, { "from": "human", "value": "module.exports = (function() {\n\n 'use strict';\n\n const Nodal = require('nodal');\n\n class DummyTask extends Nodal.Task {\n\n exec(app, callback) {\n\n console.log('Dummy ...
javascript
chosen
[ { "from": "system", "value": "Remove active flag from all options before setting current.\n\nRapidly changing presets could result in multiple options selected\nsimultaneously.\n" }, { "from": "human", "value": "function updateColor(input) {\n var value = input.val();\n\n console.log(\"Updat...
javascript
chosen
[ { "from": "system", "value": "Make lodash an external for real\n" }, { "from": "human", "value": "var webpack = require('webpack');\nvar ExtractTextPlugin = require('extract-text-webpack-plugin');\n\nmodule.exports = {\n devtool: 'source-map',\n entry: {\n 'tree-chooser': './src/index.js',\...
javascript
chosen
[ { "from": "system", "value": "Test out way rep as well\n" }, { "from": "human", "value": "describe('XML', function() {\n describe('#rep', function() {\n it('converts a node to jxon', function() {\n expect(iD.format.XML.rep({ id: 'n-1', type: 'node', lat: 38, lon: -77 }))\n ...
javascript
chosen
[ { "from": "system", "value": "Add method chaining to Undoer\n" }, { "from": "human", "value": "// See <http://chris-spencer.co.uk/2012/12/20/The-Mighty-Undoer>\n\nfunction Undoer() {\n this.actions = []\n}\n\nUndoer.prototype.record = function (f) {\n this.actions.push(f)\n}\n\nUndoer.prototyp...
javascript
chosen
[ { "from": "system", "value": "Fix catalog proptype on homepage\n" }, { "from": "human", "value": "import React from 'react'\nimport PropTypes from 'prop-types'\nimport { translate } from 'react-i18next'\n\nimport Link from '../link'\nimport Section from './section'\nimport CatalogPreview from '....
javascript
chosen
[ { "from": "system", "value": "Drop Ember v1.11/1.12 compatibility code\n\nWe don't support these old Ember versions anymore, so we can drop this codepath now\n" }, { "from": "human", "value": "'use strict';\n\n/* eslint-env node */\n\nlet TEST_SELECTOR_PREFIX = /data-test-.*/;\n\nfunction isTest...
javascript
chosen
[ { "from": "system", "value": "Remove unused var :police_car: :pencil:\n" }, { "from": "human", "value": "\"use strict\";\n\nvar assert = require(\"assert\"),\n Processor = require(\"../src/processor\");\n\ndescribe(\"modular-css\", function() {\n describe(\"issue 56\", function() {\n ...
javascript
chosen
[ { "from": "system", "value": "Add route for line map editor\n" }, { "from": "human", "value": "// -*- tab-width: 2 -*-\nvar express = require('express')\nvar router = express.Router()\n\n/* GET home page. */\nrouter.get('/', function (req, res) {\n res.render('admin_home')\n})\n\nrouter.get('/:...
javascript
chosen
[ { "from": "system", "value": "Update tests with new files.\n" }, { "from": "human", "value": "'use strict';\n\nvar path = require('path');\nvar assert = require('yeoman-generator').assert;\nvar helpers = require('yeoman-generator').test;\nvar os = require('os');\n\ndescribe('ironhide-webapp:app'...
javascript
chosen
[ { "from": "system", "value": "Implement account creation, fetching a user\n\n[#122423511]\n" }, { "from": "human", "value": "var express = require('express');\nvar passport = require('passport');\n\nvar User = require('../models/userModel');\nvar app = express.Router();\n\napp.get('/', function(...
javascript
chosen
[ { "from": "system", "value": "fix(form): Update placeholder language in location field to reflect new mouse/tap interaction\n\nRefs conveyal/trimet-mod-otp#131\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport PropTypes from 'prop-types'\n\nimport LocationField ...
javascript
chosen
[ { "from": "system", "value": "Refactor login hook and re-enable success check\n" }, { "from": "human", "value": "protractor.expect = {\n challengeSolved: function (context) {\n describe('(shared)', () => {\n beforeEach(() => {\n browser.get('/#/score-board')\n })\n\n it...
javascript
chosen
[ { "from": "system", "value": "Add tests for dynamic add and manual trigger\n" }, { "from": "human", "value": "function openDemo (browser) {\n browser.url(\"http://localhost:8080/docs/index.html\")\n}\n\nmodule.exports = {\n\n \"Open demo page\" : function (browser) {\n openDemo(brow...
javascript
chosen
[ { "from": "system", "value": "Fix app-header when there is no user bug\n" }, { "from": "human", "value": "import { Meteor } from 'meteor/meteor';\nimport { check } from 'meteor/check';\nimport Folders from '../folders';\n\nMeteor.publish('allFolders', () => {\n return Folders.find();\n});\n\nMe...
javascript
chosen
[ { "from": "system", "value": "Make rendering little more solid by waiting for half a second\n" }, { "from": "human", "value": "// This script needs to be run using phantomjs\n//\n// Example usage:\n// ~/.phantomjs/2.1.1/darwin/bin/phantomjs phantomjs/get.js\n\nvar page = require('webpage').creat...
javascript
chosen
[ { "from": "system", "value": "Replace div with wrapper class\n" }, { "from": "human", "value": "import * as React from \"react\";\n\n/**\n * Container Component for BuildSnapshots.\n * \n * @param {*} props input property containing an array of build data to be\n * rendered through BuildSnapshot...
javascript
chosen
[ { "from": "system", "value": "Add XDE version to intercom\n\nfbshipit-source-id: 269f2fc\n" }, { "from": "human", "value": "// This assumes that you are in a web context and that Intercom has\n// been included via a `<script>` tag and is available as a global.\n// If that isn't the case, the fun...
javascript
chosen
[ { "from": "system", "value": "Fix page size text when 'All' is selected\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react';\n\nconst propTypes = {\n pageSize: PropTypes.number.isRequired,\n totalSize: PropTypes.number.isRequired,\n onChange: PropTypes.func....
javascript
chosen
[ { "from": "system", "value": "Add all conditions for Rock paper sucore\n" }, { "from": "human", "value": "function y(){\nvar a=prompt(\"Jouer\");\nvar b = Math.floor((Math.random() * 3) + 1);\n\nif(b==1){\n b=\"pierre\";\n} else if (b==2){\n b=\"papier\";\n} else {\n b=\"ciseaux\";\n}\n" }...
javascript
chosen
[ { "from": "system", "value": "Fix progress bar: length must be \"outdated files\", not \"total files\"\n" }, { "from": "human", "value": "var path = require('path');\nvar childProcess = require('child_process');\nvar ProgressBar = require('progress');\n\nexports.dest = function(patte...
javascript
chosen
[ { "from": "system", "value": "Add state as being anything\n" }, { "from": "human", "value": "/* @flow */\n\nconst hasFunctionNature = (maybe: any) => typeof maybe === 'function'\nconst hasStringNature = (maybe: any) => typeof maybe === 'string'\n\ntype Reducer = (state: any, action: Object) => a...
javascript
chosen
[ { "from": "system", "value": "Set paymenttype correctly when selecting an account to pay to\n" }, { "from": "human", "value": "import React from 'react';\nimport { useSelector, useDispatch } from 'react-redux';\nimport { SELECT_PAYMENT_TYPE } from '../actiontypes';\n\nfunction Paymenttypes(props...
javascript
chosen
[ { "from": "system", "value": "Add simple proprety and rule tests\n" }, { "from": "human", "value": "// jshint ignore: start\njest.autoMockOff();\n\nconst lib = require('../lib'),\n Value = lib.Value,\n Property = lib.Property,\n Rule = lib.Rule,\n render = lib.render;\n\ndesc...
javascript
chosen
[ { "from": "system", "value": "Test Heap Sort: Sort the array\n" }, { "from": "human", "value": "/* eslint-env mocha */\nconst HeapSort = require('../../../src').algorithms.Sorting.HeapSort;\nconst assert = require('assert');\n\ndescribe('HeapSort', () => {\n it('should have no data when empty i...
javascript
chosen
[ { "from": "system", "value": "Unplug unit tests before moving them.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n\"use strict\";\n\nvar chproc = require('child_process');\nvar proc = require('process');\n\nfunction run(tests, callback)\n{\n if ( ! tests.length ) {\n // n...
javascript
chosen
[ { "from": "system", "value": "Add tests for serializing `undefined`\n" }, { "from": "human", "value": "'use strict';\n\nvar serialize = require('../lib/serialize'),\n expect = require('chai').expect;\n\ndescribe('serialize', function () {\n it('should be a function', function () {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix file not found error\n" }, { "from": "human", "value": "\"use strict\";\n\nfunction audio(url) {\n return new Audio(url);\n}\n\nconst red = audio(\"https://s3.amazonaws.com/freecodecamp/simonSound1.mp3\");\nconst blue = audio(\"https://s3.amazonaws.com/freecode...
javascript
chosen
[ { "from": "system", "value": "Format response of dbList to exclude test and admin db and upate JSON body\n" }, { "from": "human", "value": "var Promise = require('bluebird'),\n db;\n\nmodule.exports = { \n list : List,\n setDb : SetDB,\n getDb : GetDB\n};\n\nfunction List() {\n return new...
javascript
chosen
[ { "from": "system", "value": "Add license statement to js\n" }, { "from": "human", "value": "var clickTouch = function(){\r\n\tvar isDown = false;\r\n\t\r\n\tfunction createEvent(mouseEvent, name) {\r\n\t\tvar myEvent = document.createEvent('CustomEvent');\r\n\t\tmyEvent.initEvent(name, true, tr...
javascript
chosen
[ { "from": "system", "value": "Add window.getselection() mock to commentTree test\n\nJsdom does not support window.getSelection(), which is used by the\neditor. So in any test fully mounting lego-editor to the dom,\nthis needs to be mocked.\n" }, { "from": "human", "value": "import React from 're...
javascript
chosen
[ { "from": "system", "value": "Remove the source maps link from the bundles\n\nWe don’t serve the maps, and their absence generates a 404 error sometimes\n" }, { "from": "human", "value": "/* eslint-env node */\n\nconst webpack = require('webpack');\nconst packageJson = require('./package.json');...
javascript
chosen
[ { "from": "system", "value": "Build production without any devtool (no source-map)\n" }, { "from": "human", "value": "/**\n * webpack configuration for react-to-mdl\n */\nconst webpack = require('webpack');\nconst path = require('path');\nconst libraryName = 'react-to-mdl';\n\n// export config\...
javascript
chosen
[ { "from": "system", "value": "Add test for metadata appearing on fastbootInfo\n" }, { "from": "human", "value": "var expect = require('chai').expect;\nvar path = require('path');\nvar alchemistRequire = require('broccoli-module-alchemist/require');\nvar FastBootInfo = alchemistRequire('fastboot-...
javascript
chosen
[ { "from": "system", "value": "Use source maps and uglify\n" }, { "from": "human", "value": "import webpack from \"webpack\";\nimport path from \"path\";\n\nexport default {\n devtool: \"eval\",\n entry: [\n \"webpack-dev-server/client?http://localhost:3000\",\n \"webpack/hot/...
javascript
chosen
[ { "from": "system", "value": "Add source maps for easier in-browser debugging.\n" }, { "from": "human", "value": "var path = require(\"path\");\n\nvar config = {\n entry: [\"./app.tsx\"],\n\n /*\n * The combination of path and filename tells Webpack what name to give to\n * the final bundl...
javascript
chosen
[ { "from": "system", "value": "Enable .map extension in CompressionPlugin to ship compressed source maps as well\n" }, { "from": "human", "value": "const TerserPlugin = require('terser-webpack-plugin')\nconst CompressionPlugin = require('compression-webpack-plugin')\nconst OptimizeCSSAssetsPlugin...
javascript
chosen
[ { "from": "system", "value": "Delete analog reading of the light sensor\n" }, { "from": "human", "value": "const rpio = require('rpio')\n\nconst VIBRA = 11, LED = 12, LIGHT = 13\n\nrpio.open(LED, rpio.OUTPUT, rpio.LOW)\nrpio.open(VIBRA, rpio.INPUT)\nrpio.open(LIGHT, rpio.INPUT)\n\nfunction main(...
javascript
chosen
[ { "from": "system", "value": "Fix unit test.\nSandbox console width.\n" }, { "from": "human", "value": "\nvar sandbox = require('nodeunit').utils.sandbox;\nvar path = require('path');\nvar context = {\n\tprocess: process,\n\tmodule: {\n\t\texports: {}\n\t},\n\trequire: require,\n\tconsole: conso...
javascript
chosen
[ { "from": "system", "value": "Make sure refreshToken is included in initialState\n" }, { "from": "human", "value": "import { REHYDRATE } from 'redux-persist/constants'\nimport * as ACTION_TYPES from '../constants/action_types'\n\nconst initialState = {\n isLoggedIn: false,\n accessToken: null,...
javascript
chosen
[ { "from": "system", "value": "Fix LCOV coverage reporting for toHTML=false\n\nReport coverage data for each file to window._$blanket_LCOV" }, { "from": "human", "value": "//lcov_reporter\n(function (){\n //takes the option: toHTML {boolean}\n\n var body = document.body;\n\n var appendHt...
javascript
chosen
[ { "from": "system", "value": "Test with AJAX and json\n" }, { "from": "human", "value": "document.getElementById(\"ayuda\").setAttribute(\"aria-current\", \"page\");\n\nvar aside = document.getElementById(\"complementario\");\nvar button = document.createElement(\"BUTTON\");\nvar text = document...
javascript
chosen
[ { "from": "system", "value": "Copy assets after dist folder has been created\n\nThe production build script fails when it tries to copy the content of the assets folder to a non-existing folder." }, { "from": "human", "value": "require('shelljs/global');\n\nconst package = require('../package.js...
javascript
chosen
[ { "from": "system", "value": "Fix is ajax change in custom actions\n" }, { "from": "human", "value": "import client from './client'\nimport superagent from 'superagent'\n\nexport default {\n getCustomActions (callback) {\n client.get('/api/data/custom-actions', callback)\n },\n\n newCustom...
javascript
chosen
[ { "from": "system", "value": "Add user signup feature using json web token\n" }, { "from": "human", "value": "const models = require('../models');\n\nmodule.exports = {\n createUser(req, res) {\n return models.User\n .create({\n firstName: req.body.firstName,\n lastName: r...
javascript
chosen
[ { "from": "system", "value": "Remove compile flag and change it with „mode“ enum.\n" }, { "from": "human", "value": "const minimist = require('minimist');\n\n\n// prepare CLI arguments\nconst argv = minimist(process.argv.slice(2), {\n boolean: [\"dev\", \"debug\", \"d\", \"v\", \"lint\"]\n});...
javascript
chosen
[ { "from": "system", "value": "Add the test of get\n" }, { "from": "human", "value": "/* global straw, describe, it, chai */\n\nvar expect = chai.expect;\n\ndescribe('straw.service.http', function () {\n 'use strict';\n\n it('is a object', function () {\n expect(straw.service.http).t...
javascript
chosen