conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use destructuring to remove noise\n" }, { "from": "human", "value": "import { h, Component } from 'preact'\nimport { bind } from './util'\n\nexport default class extends Component {\n constructor() {\n super()\n this.state.show = false\n }\n linkState(key) ...
javascript
chosen
[ { "from": "system", "value": "Add error style message and name.\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport './Loading.css';\n\nclass Loading extends Component {\n\trender() {\n\t\treturn <p>Loading timetable data.</p>;\n\t}\n}\n\nexport default Loading;\...
javascript
chosen
[ { "from": "system", "value": "Add logic for choosing which forecasts to show\n" }, { "from": "human", "value": "import React from 'react';\n\nimport Temperature from './Temperature.js';\n\nclass Weather extends React.Component {\n render = () => {\n // FIXME: After rendering, send stat...
javascript
chosen
[ { "from": "system", "value": "Add new fxn to null out chars in str range\n" }, { "from": "human", "value": "/**\n * Find indices of all occurance of elem in arr. Uses 'indexOf'.\n * @param {array} arr - Array-like element (works with strings too!).\n * @param {array_element} elem - Element to se...
javascript
chosen
[ { "from": "system", "value": "Copy prototype memebers on extend\n" }, { "from": "human", "value": "'use strict';\n\nvar extendPrototypeWithThese = function (prototype, extendThese) {\n /*\n Helper method to implement a simple inheritance model for object prototypes.\n */\n \n ...
javascript
chosen
[ { "from": "system", "value": "Test Insertion Sort: Test for sorting the array\n" }, { "from": "human", "value": "/* eslint-env mocha */\nconst InsertionSort = require('../../../src').Algorithms.Sorting.InsertionSort;\nconst assert = require('assert');\n\ndescribe('Insertion Sort', () => {\n it(...
javascript
chosen
[ { "from": "system", "value": "Fix tests by switching to es5 syntax in finding bundles\n" }, { "from": "human", "value": "/**\n * ES6 not supported here\n */\nimport Ember from \"ember\";\nimport config from 'ember-get-config';\n\nexport default Ember.Mixin.create({\n\n bundleLoader: Ember.inj...
javascript
chosen
[ { "from": "system", "value": "Add fix bug in animation\n\n" }, { "from": "human", "value": "/*! Animate.js | The MIT License (MIT) | Copyright (c) 2017 GibboK */\n; (function (animate) {\n 'use strict';\n animate.zoomOutUp = function (selector, options) {\n var keyframeset = [\n ...
javascript
chosen
[ { "from": "system", "value": "Set up localBiblio according to ReSpec's documentation:\n\nhttp://www.w3.org/respec/ref.html#localbiblio\n" }, { "from": "human", "value": "// extend the bibliographic entries\nvar localBibliography = {\n \"HYDRA-CORE\": {\n authors: [ \"Markus Lanthaler\" ],\n ...
javascript
chosen
[ { "from": "system", "value": "Use firebase to authenticate users\n" }, { "from": "human", "value": "import React, {Component} from 'react';\nimport {Button, Card, CardSection, Input} from './common';\n\nclass LoginForm extends Component {\n constructor(props) {\n super(props);\n this.stat...
javascript
chosen
[ { "from": "system", "value": "Change the expected JSON format for user projects.\n" }, { "from": "human", "value": "/**\n * Author: Josh Adam <josh.adam@phac-aspc.gc.ca>\n * Date: 2013-04-17\n * Time: 9:41 AM\n */\n\nvar username = $('#username').text();\n\nfunction Project (data) {\n \"use...
javascript
chosen
[ { "from": "system", "value": "Use periods on senteces in docs\n" }, { "from": "human", "value": "var ContactView = require('../view/Contact');\n\n/**\n * Creates a new Contact\n * @constructor\n * @arg {Object} options - Object hash used to populate instance\n * @arg {string} options.firstName -...
javascript
chosen
[ { "from": "system", "value": "Fix race condition when setTimeout callback is run\n\nThe player object may change by the time the callback is run, and\ntherefore this.player.reactions may not exist at that point.\n" }, { "from": "human", "value": "import m from 'mithril';\nimport classNames from ...
javascript
chosen
[ { "from": "system", "value": "Revert \"Revert \"Fix module resolution for npm-link'd packages\"\"\n\nThis reverts commit 8dc3d9b82be05fe3077e2cc82963a229858930b5.\n" }, { "from": "human", "value": "module.exports = {\n test: /\\.es6\\.js$|\\.js$|\\.jsx$/,\n exclude: /node_modules/,\n loader: ...
javascript
chosen
[ { "from": "system", "value": "Change relative path for sand image\n" }, { "from": "human", "value": "function Bumper(coords, context, color) {\n this.minX = coords.minX;\n this.maxX = coords.maxX;\n this.minY = coords.minY;\n this.maxY = coords.maxY;\n this.context = context;\n this.type =...
javascript
chosen
[ { "from": "system", "value": "Disable flaky dataExport e2e test\n" }, { "from": "human", "value": "const config = require('config')\n\ndescribe('/#/privacy-security/data-export', () => {\n describe('challenge \"dataExportChallenge\"', () => {\n beforeEach(() => {\n browser.get('/#/regis...
javascript
chosen
[ { "from": "system", "value": "Set packed=true for all repeated packable types\n\nWorkaround for https://github.com/dcodeIO/protobuf.js/issues/432\n" }, { "from": "human", "value": "const fs = require('fs'),\n protobuf = require('protobufjs');\n\nconst builder = protobuf.newBuilder(),\n pro...
javascript
chosen
[ { "from": "system", "value": "QS-1341: Make report optional in CardContent\n" }, { "from": "human", "value": "import React, { PropTypes, Component } from 'react';\nimport CardContent from '../ui/CardContent';\n\nexport default class CardContentList extends Component {\n static propTypes = {\n...
javascript
chosen
[ { "from": "system", "value": "Fix test-packages in browser testing\n\n" }, { "from": "human", "value": "import buildmessage from \"../utils/buildmessage.js\";\nimport {\n pathJoin,\n statOrNull,\n writeFile,\n unlink,\n} from \"../fs/files\";\n\nconst INSTALL_JOB_MESSAGE = \"installing npm d...
javascript
chosen
[ { "from": "system", "value": "Fix watch was referring to subtask with typo\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function (grunt) {\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n\n watch: {\n scss: {\n files: ['app/styles/**/*...
javascript
chosen
[ { "from": "system", "value": "Add error handling to browser requests." }, { "from": "human", "value": "/*! @license ©2013 Ruben Verborgh - Multimedia Lab / iMinds / Ghent University */\n/** Browser replacement for the request module using jQuery. */\n\nvar EventEmitter = require('events').EventE...
javascript
chosen
[ { "from": "system", "value": "Remove cacheing of the json\n" }, { "from": "human", "value": "$(document).ready(function() {\n var options = {\n chart: {\n renderTo: 'chart',\n type: 'spline',\n },\n title: {\n text: 'Recent Water Values'\n },\n xAxi...
javascript
chosen
[ { "from": "system", "value": "refactor(rasterize-list): Update test to improve speed by only writing and unlinking files once\n" }, { "from": "human", "value": "'use strict';\n\nconst expect = require('../../helpers/expect');\nconst fs = require('fs');\nconst sizeOf = re...
javascript
chosen
[ { "from": "system", "value": "Use fs.unlinkSync() to delete files\n" }, { "from": "human", "value": "/*\n * Copyright (C) 2017 Steven Soloff\n *\n * This software is licensed under the terms of the GNU Affero General Public\n * License version 3 or later (https://www.gnu.org/licenses/).\n */\n\n...
javascript
chosen
[ { "from": "system", "value": "Fix tests for ember v2.4.x\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport Application from '../../app';\nimport config from '../../config/environment';\n\nexport default function startApp(attrs) {\n let application;\n\n // use defaults, but ...
javascript
chosen
[ { "from": "system", "value": "Include slugs in ghost response\n" }, { "from": "human", "value": "// @flow\nimport GhostContentAPI from \"@tryghost/content-api\";\n\nconst ghostContentAPI =\n window.GHOST_URL &&\n window.GHOST_CONTENT_API_KEY &&\n new GhostContentAPI({\n url: window.GHOST_U...
javascript
chosen
[ { "from": "system", "value": "Fix variable typo for FLASK_BASE_URL in app constants\n" }, { "from": "human", "value": "export const FLASK_BASE_URL = process.env.FLASK_BASE_URL;\nexport const API_PATH = `${FLASK_BASE_PATH}/api/`;\n\nexport default {\n API_PATH,\n FLASK_BASE_URL\n};\n" }, ...
javascript
chosen
[ { "from": "system", "value": "Test Edge 17 instead of 16\n" }, { "from": "human", "value": "var baseKarma = require('./base-karma')\n\nmodule.exports = function(config) {\n\n var baseConfig = baseKarma(config);\n\n config.set(Object.assign(baseConfig, {\n browsers: [\n 'bs_firefox_andr...
javascript
chosen
[ { "from": "system", "value": "Revert \"check if travis works\"\n\nThis reverts commit fbd645ae10b6b8c41befe416765ea7b6bc3343d9.\n" }, { "from": "human", "value": "/* @flow */\n\nimport React from 'react'\nimport {addons} from 'react/addons'\nvar {TestUtils} = addons\nvar {createRenderer} = TestU...
javascript
chosen
[ { "from": "system", "value": "Add test for config model\n" }, { "from": "human", "value": "import {\n moduleForModel,\n test\n} from 'ember-qunit';\n\nmoduleForModel('config');\n\ntest('it exists', function(assert) {\n var model = this.subject();\n // var store = this.store();\n assert.ok(!...
javascript
chosen
[ { "from": "system", "value": "Allow function declaration name to be an Identifier node\n" }, { "from": "human", "value": "'use strict';\n\nvar Node = require('./Node');\nvar ok = require('assert').ok;\n\nclass FunctionDeclaration extends Node {\n constructor(def) {\n super('FunctionDec...
javascript
chosen
[ { "from": "system", "value": "Make store creation more flexible.\n\nThis will help us to create stores with no logging middleware later if we want (amongst other things).\n" }, { "from": "human", "value": "import TopicReducer from \"reducers/topicReducer\";\nimport thunkMiddleware from \"redux-t...
javascript
chosen
[ { "from": "system", "value": "Set `@babel/plugin-proposal-class-properties` as option in webpack\n\nFixes webpack build error due to class properties\nhttps://stackoverflow.com/a/52693007/452233\n" }, { "from": "human", "value": "const path = require('path');\nconst HtmlWebpackPlugin = require('...
javascript
chosen
[ { "from": "system", "value": "Add removeFromQueue function to cancel sending a queued event\n" }, { "from": "human", "value": "var MatrixClientPeg = require('./MatrixClientPeg');\nvar dis = require('./dispatcher');\n\nmodule.exports = {\n resend: function(event) {\n MatrixClientPeg.get...
javascript
chosen
[ { "from": "system", "value": "Make connecting to mongodb a bit more pluggy\n" }, { "from": "human", "value": "const mongoose = require('mongoose');\nconst logger = require('../logging');\n\n// connecting to db\nmongoose.Promise = global.Promise;\nmongoose.connect('mongodb://localhost');\n\nconst...
javascript
chosen
[ { "from": "system", "value": "Update is ceaal a reange\n\nSigned-off-by: Alex Ivanov <141a92417f71895e56c4a5da05f3e98fc78e2220@contributor.pw>\n" }, { "from": "human", "value": "/* eslint-disable camelcase */\n\n/**\n * Checks if a range is a cell\n * @param {GoogleAppsScript.Spreadsheet.Range} ...
javascript
chosen
[ { "from": "system", "value": "Make sure the returned results will contained LinkedIn count\n" }, { "from": "human", "value": "/*\n * Ping test suite\n */\n\nvar\n vows = require('vows'),\n assert = require('assert');\n\nvar\n quero = {},\n urls = [\n 'http://google.com',\n 'http://facebook...
javascript
chosen
[ { "from": "system", "value": "Update the home screen greeting sometimes\n" }, { "from": "human", "value": "const Marionette = require('backbone.marionette');\nconst HomeCardsView = require('./HomeCardsView.js');\n\nmodule.exports = class HomeCapabilityView extends Marionette.View {\n template =...
javascript
chosen
[ { "from": "system", "value": "Add new game methods for state/input management\n" }, { "from": "human", "value": "import GameStateManager from \"./GameStates/GameStateManager\";\n// import CommandParser from \"./Commands/CommandParser\";\nimport GenerateName from \"./Generators/NameGenerator\";\n...
javascript
chosen
[ { "from": "system", "value": "Put some property as required.\n" }, { "from": "human", "value": "import Ember from 'ember'\nimport layout from './template'\nimport PropTypesMixin, { PropTypes } from 'ember-prop-types'\nimport uuid from 'ember-simple-uuid'\n\nexport default Ember.Component.extend(...
javascript
chosen
[ { "from": "system", "value": "Remove commonSvc dependency to prevent circular dependency\n" }, { "from": "human", "value": "(function() {\n \n 'use strict';\n \n angular.module('Core')\n .service('sessionService', sessionService);\n\n sessionService.$inject = ['commonServic...
javascript
chosen
[ { "from": "system", "value": "Update to latest Cerebral, React. Removed deprecated warnings\n" }, { "from": "human", "value": "var rules = require('./helpers/rules.js');\n\nmodule.exports = function (options) {\n\n options = options || {};\n\n if (options.rules) {\n Object.keys(options.rule...
javascript
chosen
[ { "from": "system", "value": "Check process id when reloading\n" }, { "from": "human", "value": "var fs = require(\"fs\");\nvar cur_pid = parseInt(fs.readFileSync(\".muon\").toString());\nif (!isNaN(cur_pid)){\n console.log(\"Server already running: process id \"+cur_pid);\n process.kill()...
javascript
chosen
[ { "from": "system", "value": "Change tabular to 4 spaces\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n\"use strict\";\n\nconst moment = require(\"moment\");\nconst sugar = require(\"sugar\");\nconst chalk = require(\"chalk\");\nconst exec = require(\"child_process\").exec;\n\nproces...
javascript
chosen
[ { "from": "system", "value": "Add a more interesting example\n" }, { "from": "human", "value": "var git = require('edge-git');\n\nvar repo = new git.repository('./.git/');\n\nconsole.log(repo.BranchesSync());\n" }, { "from": "gpt", "value": "var git = require('edge-git');\n\nvar repo...
javascript
chosen
[ { "from": "system", "value": "Use 'body-footer' to ensure Raven is loaded after Ember.\n\n`{{content-for 'body'}}` is typically before the `vendor.js` file's\nscript tag, so this switches to using `body-footer` to ensure `Raven` is\nloaded after Ember itself.\n" }, { "from": "human", "value": "/...
javascript
chosen
[ { "from": "system", "value": "Allow commands with no arguments\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\nconst child_process = require('child_process');\nconst commander = require('commander');\nconst version = require('./package').version;\n\ncommander\n .ver...
javascript
chosen
[ { "from": "system", "value": "Complete the request and return username\n\nSigned-off-by: Siddharth Kannan <805f056820c7a1cecc4ab591b8a0a604b501a0b7@gmail.com>" }, { "from": "human", "value": "'use strict';\nmodule.exports = function (str, opts) {\n\tif (typeof str !== 'string') {\n\t\tthrow new ...
javascript
chosen
[ { "from": "system", "value": "Fix a port related issue that persists.\n" }, { "from": "human", "value": "require( 'dotenv' ).config();\nvar dropboxModule = require( './modules/dropbox.js' );\nvar googleDocsModule = require( './modules/googleDocs.js' );\nvar paypalModule = require( './modules/pay...
javascript
chosen
[ { "from": "system", "value": "Add backticks to preparing log message\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nvar BasePlugin = require('ember-cli-deploy-plugin');\n\nmodule.exports = {\n name: 'ember-cli-deploy-cloudfront',\n\n createDeployPlugin: function(o...
javascript
chosen
[ { "from": "system", "value": "Use more precise React.createClass call regex to avoid matching own code\n" }, { "from": "human", "value": "var path = require('path');\n\nmodule.exports = function (source) {\n if (this.cacheable) {\n this.cacheable();\n }\n\n var matches = 0,\n processe...
javascript
chosen
[ { "from": "system", "value": "Allow glob search pattern to be passed as a string\n" }, { "from": "human", "value": "var buildContents = require('./lib/buildContents');\nvar buildImports = require('./lib/buildImports');\nvar buildSection = require('./lib/buildSection');\nvar extend =...
javascript
chosen
[ { "from": "system", "value": "Sort functions in order of usage" }, { "from": "human", "value": "var Promise = require('bluebird');\nvar mapValues = require('lodash.mapvalues');\nvar assign = require('lodash.assign');\nvar curry = require('lodash.curry');\n\nfunction FileWebpackPlugin(files) {\n ...
javascript
chosen
[ { "from": "system", "value": "Use `'html'` as output format\n\nPer jstransformers/jstransformer#3.\n" }, { "from": "human", "value": "'use strict';\n\nvar jade = require('jade');\nvar fs = require('fs');\n\nexports.name = 'jade';\nexports.outputFormat = 'xml';\nexports.compile = function (sour...
javascript
chosen
[ { "from": "system", "value": "Read database config from file. Exit process if file not found.\n" }, { "from": "human", "value": "var _ = require('underscore');\r\n\nvar PoemsRepository = require('../lib/repositories/poems_repository.js');\r\nvar poemsRepo = new PoemsRepository();\r\n\r\nexports....
javascript
chosen
[ { "from": "system", "value": "Increase slide display interval to 10s\n" }, { "from": "human", "value": "var fullscreen = require('./fullscreen')(document.getElementById('fs'));\nvar slides = require('./slides')(document.getElementById('fs')).then(function() {\n var carousel = require('./carouse...
javascript
chosen
[ { "from": "system", "value": "Fix another bug in dagre\n" }, { "from": "human", "value": "import * as dagre from \"dagre\"\n\nexport default function() {\n let width = 1,\n height = 1;\n\n function layout(dag) {\n const g = new dagre.graphlib.Graph(),\n info = {};\n g.setGraph(in...
javascript
chosen
[ { "from": "system", "value": "Make failing test-lint/ tests easier to understand\n" }, { "from": "human", "value": "\"use strict\";\n\nconst test = require(\"ava\");\nconst childProcess = require(\"child_process\");\nconst fs = require(\"fs\");\nconst path = require(\"path\");\n\nconst ruleFiles...
javascript
chosen
[ { "from": "system", "value": "Format JavaScript files with Prettier: scripts/draft-js/__github__/src\n\nDifferential Revision: D32201648\n\nfbshipit-source-id: f94342845cbe6454bb7ae4f02814e788fb25de9f\n" }, { "from": "human", "value": "/**\n * Copyright 2004-present Facebook. All Rights Reserved...
javascript
chosen
[ { "from": "system", "value": "Set default cookie secret value\n" }, { "from": "human", "value": "module.exports = function(data) {\n\n\t/**\n\t * Read in config file and tidy up data\n\t * Prefer application to require minimum config as possible\n\t */\n\tvar config = require('../config.' + envi...
javascript
chosen
[ { "from": "system", "value": "Add secure requirement to root page.\n" }, { "from": "human", "value": "var controllers = require('./controllers');\nvar mid = require('./middleware');\n\nvar router = function(app) {\n app.get('/login', mid.requiresSecure, mid.requiresLogout, controllers.Account.l...
javascript
chosen
[ { "from": "system", "value": "Remove extra blank line for consistency\n" }, { "from": "human", "value": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root director...
javascript
chosen
[ { "from": "system", "value": "Fix measurement label not showing on first load\n\nAfter importing the label didn't show up because `defaultLabel` option was removed\n" }, { "from": "human", "value": "import MapLabel from './map-label';\nimport featureCenter from './feature-center';\nimport getMea...
javascript
chosen
[ { "from": "system", "value": "Enforce arg0 being an object\n" }, { "from": "human", "value": "import {stringify as stringifyLinks} from 'http-header-link'\n\nexport default function (req, res, next) {\n res.links = function links (linkObj, lang = false) {\n let val = this.get('Link') || ''\n...
javascript
chosen
[ { "from": "system", "value": "Add note about Babel Polyfill\n" }, { "from": "human", "value": "// https://webpack.js.org/guides/dependency-management/#require-context\nconst cache = {};\n\nfunction importAll(r) {\n r.keys().forEach((key) => {\n return cache[key] = r(key);\n });\n}\n...
javascript
chosen
[ { "from": "system", "value": "Add comment for null as default value\n" }, { "from": "human", "value": "\"use strict\";\n\nvar Vow = require( \"vow\" );\n\nmodule.exports = function( grunt ) {\n\n var filter = Array.prototype.filter,\n JSCS = require( \"./lib/jscs\" ).init( grunt );\n\n...
javascript
chosen
[ { "from": "system", "value": "Clear textarea after posting tweet\n" }, { "from": "human", "value": "import React, {Component} from 'react'\nimport {keyStringDetector} from '../registories/registory'\n\nexport default class Editor extends Component {\n\n constructor(props) {\n super(pro...
javascript
chosen
[ { "from": "system", "value": "Simplify and strengthen specialist guide hide/display page ccode.\n\nIf the page for the hash can't be found, the first page is shown,\npreventing js errors if people hack in different hashes (or click on\nold links)\n" }, { "from": "human", "value": "$(function() {...
javascript
chosen
[ { "from": "system", "value": "Make code a bit more concise.\n" }, { "from": "human", "value": "const { parse, stringify } = window.JSON;\n\nexport default {\n coerce (val) {\n return Array.isArray(val) ? val : [val];\n },\n default () {\n return [];\n },\n deserialize (val) {\n ret...
javascript
chosen
[ { "from": "system", "value": "Revert \"Resize only when UA matches iPad\"\n\nThis reverts commit d5260394049c993a4f4ddcea3cbe694212c36f38.\n" }, { "from": "human", "value": "(function() {\n var target = $('.archives li').slice(7);\n target.each(function() {\n $(this).css(\"display\", \"none...
javascript
chosen
[ { "from": "system", "value": "Replace console.log to process.stdout to write without formatting\n" }, { "from": "human", "value": "'use strict'\n\nmodule.exports = function insertInit (showErrors, showStdout) {\n var callback\n\n if (showErrors && showStdout) {\n callback = function (e, res...
javascript
chosen
[ { "from": "system", "value": "Add a nested class for nested menus\n" }, { "from": "human", "value": "\"use strict\";\n\nangular.module('arethusa.relation').directive('nestedMenu', [\n '$compile',\n 'relation',\n function($compile, relation) {\n return {\n restrict: 'A',\n scope: ...
javascript
chosen
[ { "from": "system", "value": "Return created PaymentMethod when user's 401's in /your-account/billing\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Mixin.create({\n\n errors: [],\n showError: false,\n\n syncErrors: function () {\n if (this.get('isDes...
javascript
chosen
[ { "from": "system", "value": "Remove isExecuted from CLI utils\n" }, { "from": "human", "value": "/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n/* eslint-disable no-console, global-require...
javascript
chosen
[ { "from": "system", "value": "Add conditional to check if chain is currently broken or active\n" }, { "from": "human", "value": "function refresh () {\n $(\".refresh-link\").on(\"click\", function(event) {\n event.preventDefault();\n var $target = $(event.target);\n var url = $target.a...
javascript
chosen
[ { "from": "system", "value": "Set default to once a day for now\n" }, { "from": "human", "value": "#!/bin/env node\n\nmodule.exports = function()\n{\n\tvar scope = this;\n\n\tthis.CronJob = require('cron').CronJob;\n\tthis.NewReleases = require(__dirname + '/newreleases');\n\tthis.User = require...
javascript
chosen
[ { "from": "system", "value": "Add .jsx to resolver for webpack.\n" }, { "from": "human", "value": "var path = require( 'path' );\nvar webpack = require( 'webpack' );\n\nmodule.exports = {\n\tdevtool: 'cheap-module-eval-source-map',\n\tentry: [\n\t\t'webpack-hot-middleware/client',\n\t\t'./index....
javascript
chosen
[ { "from": "system", "value": "Remove iife and eslint disable\n" }, { "from": "human", "value": "/* eslint-disable space-before-function-paren, no-var, comma-dangle, no-return-assign, max-len */\n\nimport '~/behaviors/autosize';\n\n(function() {\n describe('Autosize behavior', function() {\n ...
javascript
chosen
[ { "from": "system", "value": "Add datetime to log format\n" }, { "from": "human", "value": "'use strict'\n\nconst morgan = require('morgan')\n\n// This adds a very simple log message for each request. Morgan is a package\n// from express to do this, and we use tiny so we don't record any user\n/...
javascript
chosen
[ { "from": "system", "value": "Delete Space from empty Object" }, { "from": "human", "value": "import {getField} from \"./getField\";\n\n/**\n * Creates a new object whose fields are either equal to obj[field] or defaultValue.\n * Useful for extracting a subset of fields from an object.\n *\n ...
javascript
chosen
[ { "from": "system", "value": "Add notifications for changes in the user module" }, { "from": "human", "value": "var _ = require('underscore');\nvar Mosaic = require('mosaic-commons');\nvar App = require('mosaic-core').App;\nvar Api = App.Api;\nvar Teleport = require('mosaic-teleport');\n\n/** Th...
javascript
chosen
[ { "from": "system", "value": "Make org a dev function for now\n\n" }, { "from": "human", "value": "import angular from 'angular';\nimport uiRouter from 'angular-ui-router';\nimport organizationComponent from './organization.component';\nimport organizationDetail from './organizationDetail/organi...
javascript
chosen
[ { "from": "system", "value": "Use ES5 for test endpoint so there is no need for babel transform\n" }, { "from": "human", "value": "import glob from 'glob';\n\nimport cssHook from 'css-modules-require-hook';\ncssHook({generateScopedName: '[name]__[local]'});\n\nglob.sync('**/*-test.js', {realpath...
javascript
chosen
[ { "from": "system", "value": "Add new line to end of file (saas-265)\n" }, { "from": "human", "value": "'use strict';\n\n(function() {\n angular.module('ncsaas')\n .service('planCustomersService', ['baseServiceClass', planCustomersService]);\n\n function planCustomersService(baseServiceClas...
javascript
chosen
[ { "from": "system", "value": "Add tests for serial calls\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function (t, a, d) {\n\tvar invoked;\n\ta(t(function () {\n\t\ta(arguments.length, 0, \"Arguments\");\n\t\tinvoked = true;\n\t}), undefined, \"Return\");\n\ta(invoked, un...
javascript
chosen
[ { "from": "system", "value": "Add tests for accented characters\n" }, { "from": "human", "value": "var caps = require('../');\nvar test = require('tape');\n\ntest('works', function(t) {\n var TEST_ARRAY = [\n ['kitten', 0.0],\n ['Kitten', 1 / 6.0],\n ['KItten', 1 / 3.0],\n ['KITten'...
javascript
chosen
[ { "from": "system", "value": "Use textContent instead of innerText\n" }, { "from": "human", "value": "var html = document.getElementById(\"html\");\nvar render = document.getElementById(\"render\");\nvar toggle = document.getElementById(\"toggle\");\nvar error = document.getElementById(\"error\"...
javascript
chosen
[ { "from": "system", "value": "Use phantom.debugExit(code) to exit in debug mode\n" }, { "from": "human", "value": "/*global phantom*/\n'use strict';\n\nvar system = require('system');\nvar webpage = require('webpage');\n\nvar page = webpage.create();\nvar errd = false;\nvar timeout = null...
javascript
chosen
[ { "from": "system", "value": "Use normal function for normal test\n" }, { "from": "human", "value": "import test from 'ava';\nimport removeTrailingSeparator from '..';\n\ntest('strip trailing separator:', t => {\n\tt.is(removeTrailingSeparator('foo/'), 'foo');\n\tt.is(removeTrailingSeparator('fo...
javascript
chosen
[ { "from": "system", "value": "Send 404 errors as JSON to keep NPM happy" }, { "from": "human", "value": "const express = require('express')\nconst fs = require('fs')\nconst http = require('http')\nconst https = require('https')\nconst path = require('path')\n\nfunction startHttpServer(app, port)...
javascript
chosen
[ { "from": "system", "value": "Fix styling on flights form\n" }, { "from": "human", "value": "import React from 'react'\n\nexport function FlightsForm({ homeFloor, value, onChange }) {\n function onFlightsChanged(event) {\n const flights = parseFloat(event.target.value)\n onChange(flights)...
javascript
chosen
[ { "from": "system", "value": "Use details parser for reading pasted data" }, { "from": "human", "value": "'use strict';\n\n/**\n * @ngdoc directive\n * @name vlui.directive:pasteDataset\n * @description\n * # pasteDataset\n */\nangular.module('vlui')\n .directive('pasteDataset', function (Datas...
javascript
chosen
[ { "from": "system", "value": "Fix up node name of config\n" }, { "from": "human", "value": "let config = require(\"./config\");\nlet Token = require(\"../lib/token\");\n\n(async function() {\n\n let token = new Token(config.token);\n let value = await token.value;\n console.log(value);\...
javascript
chosen
[ { "from": "system", "value": "Add error handling, endpoints, and view engine w/ views\n" }, { "from": "human", "value": "var express = require('express');\nvar redis = require('ioredis');\nvar logger = require('morgan');\nvar cookieParser = require('cookie-parser');\nvar bodyParser = require('bo...
javascript
chosen
[ { "from": "system", "value": "Add port as an export, for testing\n" }, { "from": "human", "value": "'use strict';\n\n// Dependencies\nvar express = require('express');\nvar http = require('http');\nvar bodyparser = require('body-parser');\n\n// Config\nvar app = express();\napp.use(bodyparser.js...
javascript
chosen
[ { "from": "system", "value": "Make it less tightly coupled with socket.io\n" }, { "from": "human", "value": "var Sockets = {}\n\nSockets.Socket = function Socket (signal) {\n if(!('WebSocket' in window)) throw new Error(\"Websockets not supported in this browser\")\n\n this.connection = io...
javascript
chosen
[ { "from": "system", "value": "Update QUERY_FIELDS const to only deconstruct the query fields object\n" }, { "from": "human", "value": "const router = require('express').Router()\n\nconst { ENTITIES } = require('../../../search/constants')\n\nconst QUERY_FIELDS = require('../../constants')\n\ncon...
javascript
chosen
[ { "from": "system", "value": "Trim whitespace from podcast titles\n" }, { "from": "human", "value": "if (!cbus.hasOwnProperty(\"server\")) { cbus.server = {} }\r\n\r\n(function() {\r\n const request = require(\"request\");\r\n const x2j = require(\"xml2js\");\r\n const path = require(\"path\"...
javascript
chosen
[ { "from": "system", "value": "Allow cognito user pool authorization" }, { "from": "human", "value": "/*global module */\nmodule.exports = function validAuthType(type) {\n\t'use strict';\n\tvar authTypes = ['AWS_IAM', 'NONE', 'CUSTOM'];\n\treturn (authTypes.indexOf(type) >= 0);\n};\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Make PermissionHandler more robust to missing permission directive\n" }, { "from": "human", "value": "\"use strict\";\n\nconst Handler = require('./handler');\n\nclass PermissionHandler extends Handler {\n constructor(data={}) {\n super(data);\n ['permissions...
javascript
chosen