conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add 1 more checklist item about publish\n" }, { "from": "human", "value": "const readline = require('readline')\n\nconsole.log(`Preparing to publish version: ${process.env.npm_package_version}`)\n\nconst rl = readline.createInterface({ input: process.stdin, output: ...
javascript
chosen
[ { "from": "system", "value": "Revert changes to client masking\n" }, { "from": "human", "value": "import superagent from 'superagent';\nimport config from '../config';\n\nconst methods = ['get', 'post', 'put', 'patch', 'del'];\n\nfunction formatUrl(path) {\n const adjustedPath = path[0] !== '/'...
javascript
chosen
[ { "from": "system", "value": "Fix styled-components API for ProjectDescription\n" }, { "from": "human", "value": "import React from 'react';\nimport styled from 'styled-components';\nimport Linkify from 'linkifyjs/react';\n\nimport { generateTimeRange } from '../../utils/date.utils';\nimport { S...
javascript
chosen
[ { "from": "system", "value": "Fix deployment script to use env. port\n" }, { "from": "human", "value": "require('shelljs/global');\n\nconst platform = {\n path: 'sashimi-platform',\n buildPath: 'public'\n};\nconst webapp = {\n path: 'sashimi-webapp',\n buildPath: 'dist'\n};\n\nlet statusBuil...
javascript
chosen
[ { "from": "system", "value": "Set underscored to true so that authorId becomes author_id and is consistent with other column names\n" }, { "from": "human", "value": "import Sequelize from 'sequelize';\nimport database from '../';\nimport User from './user';\n\nconst blogPostDatabaseDefinition = ...
javascript
chosen
[ { "from": "system", "value": "Fix login after using event-target\n" }, { "from": "human", "value": "/**\n * Licensed under AGPL v3\n * (https://github.com/plentymarkets/plenty-cms-library/blob/master/LICENSE)\n * ===================================================================================...
javascript
chosen
[ { "from": "system", "value": "Allow noConcurrentCalls to work with non-async λs.\n" }, { "from": "human", "value": "\"use strict\";\n\n/*\n* Creates a version of λ that cannot be executed concurrently.\n*\n* Returns the Promise returned by λ.\n*/\nmodule.exports = λ => {\n let locked = false...
javascript
chosen
[ { "from": "system", "value": "Clear current suite on config change.\n" }, { "from": "human", "value": "import { Action } from '../actions/nightwatch'\n\nconst initialState = {}\n\nexport default function nightwatch(state = initialState, action) {\n switch (action.type) {\n case Action....
javascript
chosen
[ { "from": "system", "value": "Remove other Google Analytics reference\n" }, { "from": "human", "value": "// =============================================\n//\n// WWW.QUIS.CC\n// ---------------------------------------------\n//\n// By Chris Hill-Scott, except where noted.\n//\n//...
javascript
chosen
[ { "from": "system", "value": "Refactor DOM manipulation to proper hook\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport ReactDOM from 'react-dom';\nimport echarts from 'echarts';\nimport { arrayEqual } from '../_utils/ArrayUtils';\n\nexport default class EChar...
javascript
chosen
[ { "from": "system", "value": "Enable node.js to support both http and https\n" }, { "from": "human", "value": "const http = require(\"http\"),\n zlib = require(\"zlib\"),\n fs = require(\"fs\"),\n path = require(\"path\"),\n isURL = require(\"is-url\");\n\nvar langdata = re...
javascript
chosen
[ { "from": "system", "value": "Fix missed reference to with-action\n" }, { "from": "human", "value": "import React from 'react'\nimport { displayName } from '../src/addons/with-action'\n\nit('gets a stateless component name', function () {\n const name = displayName(function Button () {})\n\n e...
javascript
chosen
[ { "from": "system", "value": "Fix typo w/ loading in clickable-square\n" }, { "from": "human", "value": "BEST.module('famous:tests:scope', 'HEAD', {\n behaviors: {\n '#surface' : {\n 'content' : 'This square should be blue. \\n\\n Above square should be gray.',\n ...
javascript
chosen
[ { "from": "system", "value": "Print the messages we sent.\n" }, { "from": "human", "value": "// Defines the top-level angular functionality. This will likely be refactored\n// as I go.\nvar pyrcApp = angular.module(\"pyrcApp\", []);\n\npyrcApp.controller(\"ircCtrl\", function($scope) {\n $sco...
javascript
chosen
[ { "from": "system", "value": "Replace app wrapper with React Fragment\n" }, { "from": "human", "value": "import * as React from \"react\";\nimport {BuildSnapshotContainer} from \"./components/BuildSnapshotContainer\";\nimport {Header} from \"./components/Header\";\n\n/**\n * Main App that is Ren...
javascript
chosen
[ { "from": "system", "value": "Add form for variable replacement\n" }, { "from": "human", "value": "class Variable {\n constructor(name, placeholder, description) {\n this.name = name\n this.value = placeholder\n this.description = description\n }\n\n bind(value) {\n return new Va...
javascript
chosen
[ { "from": "system", "value": "Update Settings model to also read from environment variables\n" }, { "from": "human", "value": "var Singleton = require('../utils/singleton'),\n Path = require('path'),\n fs = require('fs'),\n _ = require('lodash'),\n logger = require('../utils/logger')...
javascript
chosen
[ { "from": "system", "value": "Add more testing to ensure function is equivalent to prior code\n" }, { "from": "human", "value": "import test from 'tape-catch';\nimport { inferAll } from '..';\n\ntest('inferAll()', t => {\n t.deepEqual(inferAll([{'a.b': 1}]), {'a.b': 'integer'}, 'should work on ...
javascript
chosen
[ { "from": "system", "value": "Set up login component to log the user in correctly, need to set up an alert to the user\n" }, { "from": "human", "value": "import React, {Component} from 'react';\r\n\r\nclass Home extends Component {\r\n handleSubmit(event) {\r\n event.preventDefault();\...
javascript
chosen
[ { "from": "system", "value": "Set express's timeout duration to indefinite\n" }, { "from": "human", "value": "\"use strict\";\n\nlet {writeFileToDisk, deleteFileFromDisk, createNewFolder, openDirectory, copyFile, moveFile, getUSB, storeTimestamp} = require(\"../controllers/filemgmt.controller.js...
javascript
chosen
[ { "from": "system", "value": "Add default behavior for State Color Map Component in case State is not defined in ColorMap set\n" }, { "from": "human", "value": "/*!\n Copyright (C) 2017 Google Inc.\n Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n*/\n\n(funct...
javascript
chosen
[ { "from": "system", "value": "Update requirejs config to include requirejs plugins correctly\n" }, { "from": "human", "value": "require.config({\n\tbaseUrl: 'js/lib',\n\tpaths: {\n\t\tapp: '../app',\n\t\troute: '../routes',\n\t\ttpl: '../templates'\n\t}\n});\n\nrequire(['route/home'], function()...
javascript
chosen
[ { "from": "system", "value": "Set the order of the tiles\n" }, { "from": "human", "value": "(function(){\n console.log('Hello, World!');\n})();\n" }, { "from": "gpt", "value": "(function(){\n function toArray(xs){\n return Array.prototype.slice.call(xs);\n };\n\n v...
javascript
chosen
[ { "from": "system", "value": "Load nunjucks env and update template path\n\n- follow pattern `module-dir/tpl-file-name.html`\n" }, { "from": "human", "value": "import test from 'ava';\nimport jsdom from 'jsdom';\nimport nunjucks from 'nunjucks';\n\nimport { Accordion } from './Accordion';\n\ntes...
javascript
chosen
[ { "from": "system", "value": "Fix expandPath() utility when no * is used\n" }, { "from": "human", "value": "'use strict';\n\nconst { flatten } = require('./flatten');\n\n// Take a dot-notation path that can contain `*` and expand it to all\n// possible paths within `obj`\n// For example, `{a: [{...
javascript
chosen
[ { "from": "human", "value": "Add test helper to check an array has all values within a range\n" }, { "from": "gpt", "value": "beforeEach(function() {\n this.addMatchers({\n toBeLessThan: function(expected) {\n return this.actual < expected;\n },\n toHaveAllValuesInRange: function ...
javascript
chosen
[ { "from": "system", "value": "Read port from env for heroku comp\n" }, { "from": "human", "value": "// Module dependencies\r\nvar express = require('express');\r\nvar namespace = require('express-namespace');\r\nvar fs = require('fs');\r\nvar passport = require('passport');\r\n\r\nvar http = req...
javascript
chosen
[ { "from": "system", "value": "Support URL parameters in isomorphic-unfetch\n\nFixes #140." }, { "from": "human", "value": "function r(m){return m && m.default || m;}\nmodule.exports = global.fetch = global.fetch || (\n\ttypeof process=='undefined' ? r(require('unfetch')) : (function(url, opts) {...
javascript
chosen
[ { "from": "system", "value": "Add failing test for radio checked property\n" }, { "from": "human", "value": "import { moduleForComponent, test } from 'ember-qunit';\nimport { componentDisabledTest } from './-general-helpers';\n\nmoduleForComponent('mdl-radio', 'Unit | Component | mdl radio', {\n...
javascript
chosen
[ { "from": "system", "value": "Include offending items in equalPosition matcher failing message\n" }, { "from": "human", "value": "exports.toEqualPositions = function(expected) {\n /**\n We don't care about the other fields, only the positions and that the\n indexes correspond (e.g. the h ...
javascript
chosen
[ { "from": "system", "value": "Use History API to set the selected filters in the url\n" }, { "from": "human", "value": "import qs from 'qs';\n\nexport default (obj) => {\n const stringified = qs.stringify(obj, { encode: false });\n location.hash = stringified;\n};\n" }, { "from": "gpt"...
javascript
chosen
[ { "from": "system", "value": "Revert logic for current block update\n" }, { "from": "human", "value": "\"use strict\";\n\nvar assign = require(\"lodash\").assign;\nvar initialState = require(\"./initial-state\").currentBlock;\nvar validateBlock = require(\"../validate/validate-block\");\n\nmodul...
javascript
chosen
[ { "from": "system", "value": "Connect component to posts application state\n" }, { "from": "human", "value": "import _ from 'lodash';\nimport { FETCH_POSTS } from '../actions';\n\nexport default function(state = {}, action) {\n switch (action.type) {\n case FETCH_POSTS:\n return _mapKey...
javascript
chosen
[ { "from": "system", "value": "Add personal info form with sex option\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nclass PersonalInformationSettingContent extends Component {\n isActive = () => {\n return 'modal-tab-content ' + ((this.props.active === ...
javascript
chosen
[ { "from": "system", "value": "Make sure site generation works with newer ClojureScript\n" }, { "from": "human", "value": "\nvar cljsLoad = require(\"./cljs-load\");\n\nvar srcFile = \"outsite/public/js/main.js\";\nvar outputDirectory = \"outsite/public/js/out/\";\nvar devFile = \"reagentdemo/dev...
javascript
chosen
[ { "from": "system", "value": "Use different method to get user\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport Base from 'ember-simple-auth/authenticators/base';\n\nconst { RSVP } = Ember;\n\nexport default Base.extend({\n\n store: Ember.inject.service(),\n\n restore(data...
javascript
chosen
[ { "from": "system", "value": "Use numbers not strings in %, plus need inverse percentage\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Component.extend({\n tagName: \"badge\",\n classNameBindings: [\"name\", \"value\"],\n imagePath: function() {\n\n }....
javascript
chosen
[ { "from": "system", "value": "Improve search functionality without requiring strict match\n" }, { "from": "human", "value": "var $rows = $('#omx-table td');\n$('#search').keyup(function() {\n \n var val = '^(?=.*\\\\b' + $.trim($(this).val()).split(/\\s+/).join('\\\\b)(?=.*\\\\b') + ').*$'...
javascript
chosen
[ { "from": "system", "value": "Use inline source map for dev mode\n" }, { "from": "human", "value": "var _ = require('lodash');\nvar path = require('path');\nvar webpack = require('webpack');\nvar getWebpackConfig = require('./webpack.config.js');\n\nvar devConfig = _.assign(getWebpackConfig(), {...
javascript
chosen
[ { "from": "system", "value": "Update for English Intent Classifier Bug Fix\n" }, { "from": "human", "value": "import { PAGE_ACCESS_TOKEN } from './token';\n\nconst apiai = require('apiai');\nconst FBMessenger = require('fb-messenger');\n\nconst messenger = new FBMessenger(PAGE_ACCESS_TOKEN);\nco...
javascript
chosen
[ { "from": "system", "value": "Manage basic state in an Animation\n" }, { "from": "human", "value": "var validProps = [\n 'before',\n 'render',\n 'done',\n 'args',\n 'pauseThreshold',\n 'duration',\n];\n\nclass Animation {\n constructor (obj) {\n var i, name;\n\n ...
javascript
chosen
[ { "from": "system", "value": "Remove incorrect (and unused) code.\n" }, { "from": "human", "value": "import {Unauthorized} from '../api-errors'\n\n// ===================================================================\n\n// TODO: Token permission.\nexport async function create () {\n // The use...
javascript
chosen
[ { "from": "system", "value": "Fix docs build on Windows\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nif (!process.env.DEBUG) {\n process.env.DEBUG = \"phenomic:*\"\n}\n\n// still in src/, handy to play\nif (__filename.indexOf(\"phenomic/src\") > 1) {\n require(\"babel-register\")\...
javascript
chosen
[ { "from": "system", "value": "Switch back to var syntax for all functions\n" }, { "from": "human", "value": "import { select, local } from \"d3-selection\";\nvar myLocal = local(),\n noop = function (){};\n\nexport default function (tagName, className){\n var create = noop,\n render = n...
javascript
chosen
[ { "from": "system", "value": ":new: Add a styling class to flint-status\n" }, { "from": "human", "value": "'use babel'\n\nimport {jsx, createClass} from 'vanilla-jsx'\n/** @jsx jsx */\n\nexport default createClass({\n renderView() {\n return <flint-status>\n Flint: <span ref=\"status\">...
javascript
chosen
[ { "from": "system", "value": "Extend SW functionality with RPC call and window opening\n" }, { "from": "human", "value": "self.addEventListener('install', function(event) {\n // Automatically take over the previous worker.\n event.waitUntil(self.skipWaiting());\n});\n\nself.addEventListener('p...
javascript
chosen
[ { "from": "system", "value": "feat: Add appData/plugins to plugin paths\n" }, { "from": "human", "value": "var path = require('path');\nvar paths = module.paths.map(formatPath);\nvar globalDir = formatPath(getGlobalDir());\nvar appDataDir = formatPath(process.env && process.env.APPDATA);\n\nif (...
javascript
chosen
[ { "from": "system", "value": "Stop propagating click to parents" }, { "from": "human", "value": "/* global define */\n\ndefine([\n 'jquery',\n 'views/reply-form-view'\n], function ($, ReplyFormView) {\n 'use strict';\n\n var ReplyableView = {\n renderReplyBox: function (event) {\n ev...
javascript
chosen
[ { "from": "system", "value": "Add flavour text for assembling burger\n" }, { "from": "human", "value": "import Entity, { printMessage, action, time, state } from \"Entity.js\";\nimport { addItem, removeItem, isInInventory } from 'inventory.js';\n\nexport class Prep extends Entity {\n name() {\n...
javascript
chosen
[ { "from": "system", "value": "Fix `yarn text:browser` not loading any test\n" }, { "from": "human", "value": "\"use strict\";\n\nconst path = require(\"path\");\nconst config = require(\"./webpack.config.js\");\n\nconfig.entry = {\n\t\"js/bundle.test.js\": `mocha-loader!${path.join(__dirname, \"...
javascript
chosen
[ { "from": "system", "value": "Enable cookie jar for better performance\n" }, { "from": "human", "value": "/**\n * Utility class\n */\nexport default class Util {\n\n /**\n * Creates request configuration based on an url and go config\n * \n * @param {string} url The url to create c...
javascript
chosen
[ { "from": "human", "value": "Add animation toggle script to beta.\n" }, { "from": "gpt", "value": "function toggleAnimation() {\n\tvar state = my_getcookie(\"AnimatePMD\");\n\tvar btn = $(\"#ToggleAnimation\");\n\tif (state == 1) {\n\t\tconsole.log(\"Disabled Animation\");\n\t\tmy_setcookie(\"An...
javascript
chosen
[ { "from": "system", "value": "Add react-call-return to publish list" }, { "from": "human", "value": "'use strict';\n\nconst dependencies = ['fbjs', 'object-assign', 'prop-types'];\n\n// TODO: enumerate all non-private package folders in packages/*?\nconst projects = [\n 'react',\n 'react-art',...
javascript
chosen
[ { "from": "system", "value": "Update Accordion to respect arbitrary user-defined props.\n" }, { "from": "human", "value": "// @flow\n\nimport React, { Component, type Node } from 'react';\nimport { Provider } from 'mobx-react';\nimport { createAccordionStore } from '../accordionStore/accordionSt...
javascript
chosen
[ { "from": "system", "value": "Allow to use logger on production by adding `redux-logger` key in localStorage\n" }, { "from": "human", "value": "import {createHistory} from 'history';\nimport {createStore, applyMiddleware, compose, combineReducers} from 'redux';\nimport thunkMiddleware from 'redu...
javascript
chosen
[ { "from": "system", "value": "Remove the creation of a function in map render\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { BaseChart } from 'react-jsx-highcharts';\n\nclass HighchartsMapChart extends Component {\n st...
javascript
chosen
[ { "from": "system", "value": "Remove .ts files from testMatch\n" }, { "from": "human", "value": "export default {\n roots: [\n \"<rootDir>/src\"\n ],\n testMatch: [\n \"<rootDir>/src/tests/*.test.ts\",\n \"<rootDir>/src/tests/*.test.tsx\"\n ],\n transform: {\n \"^.+\\\\.(ts|tsx)...
javascript
chosen
[ { "from": "system", "value": "tests/component-addon: Use alternative blueprint test helpers\n" }, { "from": "human", "value": "'use strict';\n\nvar setupTestHooks = require('ember-cli-blueprint-test-helpers/lib/helpers/setup');\nvar BlueprintHelpers = require('ember-cli-blueprint-test-help...
javascript
chosen
[ { "from": "system", "value": "Use HTTPS instead of HTTP\n" }, { "from": "human", "value": "angular.module('backend', [])\n\n //.constant('BACKEND_URL', 'http://localhost:5010/assess/');\n .constant('BACKEND_URL', 'http://codeassesser-charl.rhcloud.com/assess/');" }, { "from": "gpt"...
javascript
chosen
[ { "from": "system", "value": "Test cases for key validator\n" }, { "from": "human", "value": "const sinon = require('sinon');\nconst expect = require('chai').expect;\nconst assert = require('chai').assert;\nconst needle = require('needle');\n\nconst config = require('../config');\nconst validato...
javascript
chosen
[ { "from": "system", "value": "fix(events): Update init according to pub-sub-es6\n" }, { "from": "human", "value": "import { PubSubEs6, config } from 'pub-sub-es6';\nimport { env } from '-/config';\n\nif (env.development) {\n config.enableDebugger = true\n config.trace = true\n}\n\nglobal.P...
javascript
chosen
[ { "from": "system", "value": "Fix CP-90 Review the popover for copy button\n\nSince we are not able to read in the clipboard without autorization, we keep the copied state for 2 seconds.\n" }, { "from": "human", "value": "import React, { useState } from 'react';\nimport PropTypes from 'prop-type...
javascript
chosen
[ { "from": "system", "value": "Read production config from env.\n" }, { "from": "human", "value": "const devConfig = require('../config/default.json')\nconst productionConfig = require('../config/production.json')\n\nconst dotenv = require('dotenv')\nconst path = require('path')\n\ndotenv.config(...
javascript
chosen
[ { "from": "system", "value": "Make the alt attribute for avatar image better\n" }, { "from": "human", "value": "import { readOnly } from '@ember/object/computed';\nimport Component from '@glimmer/component';\n\nexport default class UserAvatar extends Component {\n get width() {\n if (this.ar...
javascript
chosen
[ { "from": "system", "value": "Switch experiment to using Facebook with HTTPS\n" }, { "from": "human", "value": "const io = require('socket.io'),\n winston = require('winston');\n\nwinston.remove(winston.transports.Console);\nwinston.add(winston.transports.Console, {'timestamp': true});\n\nc...
javascript
chosen
[ { "from": "system", "value": "Set registration form popup smaller (but not too much for good render on desktop) to fit better with mobile devices\n" }, { "from": "human", "value": "/*\n * Author: Pierre-Henry Soria <ph7software@gmail.com>\n * Copyright: (c) 2013-2016, Pierre-Henry Sor...
javascript
chosen
[ { "from": "system", "value": "Replace ternary by default value\n" }, { "from": "human", "value": "import React, { Component } from 'react'\n\nimport Card from '../Card'\n\nconst DEBOUNCE_MS = 500\nconst DEFAULT_DOMAIN = 'https://stripe.com'\n\nexport default class extends Component {\n state = ...
javascript
chosen
[ { "from": "system", "value": "Add support for intent slot's value as a object\n" }, { "from": "human", "value": "'use strict';\n\nconst _ = require('underscore');\n\nfunction buildSlots(slots) {\n const res = {};\n _.each(slots, (value, key) => {\n res[key] = {\n name: key,\n valu...
javascript
chosen
[ { "from": "system", "value": "Check that options exist before checking if attribution is available\n" }, { "from": "human", "value": "var APIKeyCheck = require('./apiKeyCheck');\nvar Geocoder = require('leaflet-geocoder-mapzen/src/core');\n\nmodule.exports = Geocoder;\n\nmodule.exports.geocoder ...
javascript
chosen
[ { "from": "system", "value": "Remove agenda view from calendar\n" }, { "from": "human", "value": "import React from 'react';\nimport BigCalendar from 'react-big-calendar';\nimport moment from 'moment';\nimport 'react-big-calendar/lib/css/react-big-calendar.css'\n\nBigCalendar.setLocalizer(\n Bi...
javascript
chosen
[ { "from": "system", "value": "Fix bash output displaying <br> instead of returning.\n" }, { "from": "human", "value": "import React from 'react';\nvar AU = require('ansi_up');\nvar ansi_up = new AU.default();\n\nclass BashOutput extends React.Component {\n updateHTML(text) {\n return ...
javascript
chosen
[ { "from": "system", "value": "Check only response code instead of code and response text\n" }, { "from": "human", "value": "$(document).ajaxError(function(event, jXHR) {\n if (jXHR.status === 403 && jXHR.responseText === 'Unauthenticated') {\n var message = gettext(\n 'You h...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary animations in iframes\n" }, { "from": "human", "value": "const executeScripts = () => {\n chrome.tabs.executeScript({\n file: 'animations.js',\n allFrames: true,\n matchAboutBlank: true,\n runAt: 'document_end'\n ...
javascript
chosen
[ { "from": "system", "value": "Make command block do something\n" }, { "from": "human", "value": "(function(ext) {\n // Cleanup function when the extension is unloaded\n ext._shutdown = function() {};\n\n // Status reporting code\n // Use this to report missing hardware, plugin or uns...
javascript
chosen
[ { "from": "system", "value": "Add action to reset tree\n" }, { "from": "human", "value": "const updateStructure = newState => ({ type: 'UPDATE_VERT_STRUCTURE', newState });\n\nconst highlightNode = nodeId => (dispatch, getState) => {\n setTimeout(() => dispatch(unHighlightNode(nodeId)), getStat...
javascript
chosen
[ { "from": "system", "value": "Add a comment with a link to PR\n\n" }, { "from": "human", "value": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nfunction Clock( autoStart ) {\n\n\tthis.autoStart = ( autoStart !== undefined ) ? autoStart : true;\n\n\tthis.startTime = 0;\n\tthis.old...
javascript
chosen
[ { "from": "system", "value": "Increase cluster-test timeout for slow CI machines.\n" }, { "from": "human", "value": "var helper = require('./specHelper');\nvar cluster = require('cluster');\nvar http = require('http');\n\ndescribe(\"clustering\", function() {\n\n beforeEach(function() {\n he...
javascript
chosen
[ { "from": "system", "value": "Add some functionality to the map datatype\n" }, { "from": "human", "value": "// Constructor\nfunction Map() {\n this.value = undefined;\n}\n\n// Static Methods\nMap.isMap = (map) => map instanceof Map;\n\n// Prototype Methods\nMap.prototype.value = function() {\...
javascript
chosen
[ { "from": "system", "value": "Rename loader to simpler name\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n // Tell Webpack where to find loaders; the last entry allows it to find the\n // (local) Traceur module. Omit this configuration option in your own project.\n r...
javascript
chosen
[ { "from": "system", "value": "Tweak test code for config base\n" }, { "from": "human", "value": "\nseajs.config({\n base: './base/'\n})\n\n\ndefine(function(require) {\n\n var test = require('../../../test')\n var a = require('a')\n\n test.assert(a.name === 'a', a.name)\n\n\n // relative\n ...
javascript
chosen
[ { "from": "system", "value": "Fix pre func use in benchmark\n" }, { "from": "human", "value": "function pad( str, len ) {\n\n\tlet res = str;\n\twhile ( res.length < len ) {\n\n\t\tres += ' ';\n\n\t}\n\n\treturn res;\n\n}\n\nfunction runBenchmark( name, preFunc, func, maxTime, maxIterations = In...
javascript
chosen
[ { "from": "system", "value": "Update function to keep defaultValue and Value in sync in config forms\n" }, { "from": "human", "value": "define(['knockout', 'underscore', 'viewmodels/widget'], function (ko, _, WidgetViewModel) {\n /**\n * registers a text-widget component for use in forms\n...
javascript
chosen
[ { "from": "system", "value": "Remove debug info in product history\n" }, { "from": "human", "value": "import { inject, NewInstance } from 'aurelia-framework';\nimport { ProjectApi } from './api';\nimport { DialogService } from 'aurelia-dialog';\nimport { HistoryDialog } from './history-dialog';\...
javascript
chosen
[ { "from": "system", "value": "Make auth work, remote is needed\n" }, { "from": "human", "value": "var pull = require('pull-stream')\n\nmodule.exports = function (opts) {\n return {\n name: 'noauth',\n create: function (_opts) {\n return function (stream, cb) {\n stream.address...
javascript
chosen
[ { "from": "system", "value": "Remove console.log call from js\n" }, { "from": "human", "value": "$('a[href^=\"#\"]').on('click', function(evt) {\n console.log(this, this.hash)\n evt.preventDefault();\n $('html, body').stop().animate({\n 'scrollTop': $(this.hash).offset().top\n }...
javascript
chosen
[ { "from": "system", "value": "Build gmf apps directly into examples-hosted directory\n" }, { "from": "human", "value": "const path = require('path');\nconst ls = require('ls');\nconst webpack = require('webpack');\nconst HtmlWebpackPlugin = require('html-webpack-plugin');\n\nconst plugins = [];\...
javascript
chosen
[ { "from": "system", "value": "Work around a rounding error in the 60fps test\n" }, { "from": "human", "value": "QUnit.test(\"CanGetLiveTicks\", function(assert) {\n var someGame = new TameGame.StandardGame();\n var someObject = someGame.createObject();\n var someScene = someGame.createS...
javascript
chosen
[ { "from": "system", "value": "Fix for when roomplanner can't determine the center for a room.\n\n" }, { "from": "human", "value": "/*\n * Module code goes here. Use 'module.exports' to export things:\n * module.exports.thing = 'a thing';\n *\n * You can import it from another modules like this:\...
javascript
chosen
[ { "from": "system", "value": "Fix themes getting nuked by purgecss\n" }, { "from": "human", "value": "const IN_PRODUCTION = process.env.NODE_ENV === 'production'\n\nclass TailwindVueExtractor {\n\tstatic extract(content) {\n\t\tconst contentWithoutStyleBlocks = content.replace(/<style[^]+?<\\/st...
javascript
chosen
[ { "from": "system", "value": "Add creatorId association creation-hook to room service\n\n" }, { "from": "human", "value": "const { authenticate } = require('feathers-authentication').hooks;\nconst genRandomName = require('../../hooks/gen-rand-room-name.js');\n\nmodule.exports = {\n before: {\n ...
javascript
chosen
[ { "from": "system", "value": "Add explanatory comment for why an object lookup is used vs a string lookup.\n" }, { "from": "human", "value": "const integerToChar = Array.prototype.reduce.call(\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",\n (memo, char, idx) => {\n ...
javascript
chosen
[ { "from": "system", "value": "[chore] Define uglify (minify) grunt task\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.initConfig({\n\n jshint: {\n files: ['*.js', 'client/app/*.js', 'server/**/*.js', 'database/**/*.js'],\n options: {\n ignores...
javascript
chosen
[ { "from": "system", "value": "Add jshint to test task\n" }, { "from": "human", "value": "var grunt = require('grunt');\nrequire('load-grunt-tasks')(grunt);\n\ngrunt.initConfig({\n babel: {\n options: {\n modules: 'common'\n },\n dist: {\n files: [{\n \"expand\": true,...
javascript
chosen
[ { "from": "system", "value": "Add watch task to grunt\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n grunt.initConfig({\n\n pkg: grunt.file.readJSON('package.json'),\n\n meta: {\n version: '<%= pkg.version %>'\n },\n\n jasmine: {\n sources: 'src/...
javascript
chosen
[ { "from": "system", "value": "Fix config so that color legend shows up correctly\n" }, { "from": "human", "value": "var VIZABI_MODEL = {\n \"state\": {\n \"time\": {\n \"startOrigin\": \"1993\",\n \"endOrigin\": \"2012\",\n \"dim\": \"year\",\n \"delay\": 1\n },\n \...
javascript
chosen
[ { "from": "system", "value": "Fix the header title for AddIncomeContainer\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport { connect } from 'react-redux';\nimport { NavigationExperimental } from 'react-native';\n\nconst {\n Header: NavigationHeader,\n} = Navi...
javascript
chosen
[ { "from": "system", "value": "Move onError callback to a method\n" }, { "from": "human", "value": "var irc = require('irc');\n\nfunction Bot(settings) {\n this.settings = settings;\n console.log('Connecting to IRC server ' + settings.irc.host + ' with nick ' +\n settings.irc.nick);\n\n t...
javascript
chosen
[ { "from": "system", "value": "Update checks for refs before doing anything\n" }, { "from": "human", "value": "\"use strict\";\n\nmodule.exports = function(ref, path, val) {\n var db = path ? ref.child(path) : ref;\n\n if(val === false) {\n return db.remove();\n }\n\n return db...
javascript
chosen
[ { "from": "system", "value": "Convert filename to string before opening it" }, { "from": "human", "value": "var rc = require('rc');\nvar fs = require('fs');\nvar path = require('path');\n\nvar Slap = require('./slap');\n\nvar opts = rc(require('../package').name);\nvar slap = new Slap(opts);\n\n...
javascript
chosen
[ { "from": "system", "value": "Bring back the hating for Django Pipeline's processing of template names :)\n" }, { "from": "human", "value": "require('js-yaml');\nvar path = require('path');\n\nmodule.exports = function (grunt) {\n grunt.loadNpmTasks('grunt-contrib-jst');\n grunt.loadNpmTasks('...
javascript
chosen