conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix array-like check for max length value\n" }, { "from": "human", "value": "'use strict';\n\n// MODULES //\n\nvar isInteger = require( '@stdlib/utils/is-integer' );\n\n\n// CONSTANTS //\n\nvar MAX = require( '@stdlib/math/constants/float64-max-safe-integer' );\n\n\...
javascript
chosen
[ { "from": "system", "value": "Configure ElasticSearch to use AWS config\n" }, { "from": "human", "value": "var process = require('process')\nvar elasticsearch = require('elasticsearch')\nrequire('dotenv').config({silent: process.env.NODE_ENV === 'production'})\n\nvar client = new elasticsearch.C...
javascript
chosen
[ { "from": "system", "value": "Set router location in willTransition\n\nWhen a user clicks the back button while on\nthe participate/survey/index route, in the\nwillTransition hook, set the router url\nto the old url and abort the transition instead\nof using this.replaceWith.\n" }, { "from": "human"...
javascript
chosen
[ { "from": "system", "value": ":beetle: Fix a broken line in html\n" }, { "from": "human", "value": "import m from 'mithril';\n\nexport const HomeBannerSlide = {\n view({attrs}) {\n\n const {\n slide,\n slideClass,\n sliderTransitionStyle\n } = at...
javascript
chosen
[ { "from": "system", "value": "Update GitHub API query for latest version\n" }, { "from": "human", "value": "const { GraphQLClient } = require(\"graphql-request\");\nconst { writeFileSync, existsSync, mkdirSync } = require(\"fs\");\n\nasync function fetchMembers(organisation) {\n const token = p...
javascript
chosen
[ { "from": "system", "value": "Fix for undefined on nested fields\n" }, { "from": "human", "value": "export default (doc, fields) => {\n fields.forEach(field => {\n process(doc, field.split('.'));\n })\n}\n\nconst process = (doc, parts) => {\n if (parts.length === 1) {\n if...
javascript
chosen
[ { "from": "system", "value": "Fix 'j:' issue on cookie\n" }, { "from": "human", "value": "/**\n * Created by mbinet on 3/27/17.\n */\nimport cookie from 'react-cookie'\n\nfunction getLang() {\n\n var user;\n if (user = cookie.load('user')) {\n return (user.profile.lang)\n }\n ...
javascript
chosen
[ { "from": "system", "value": "Add option for listing droplets. Remove placeholder code\n" }, { "from": "human", "value": "var cmd = require('commander')\n, fs = require('fs')\n, inquirer = require('inquirer')\n, pjson = require('../package.json')\n, request = require('request')\n\n\nvar API_URL ...
javascript
chosen
[ { "from": "system", "value": "Add trailing slash to endpoint url\n" }, { "from": "human", "value": "const hapi = require('hapi');\nconst { graphqlHapi, graphiqlHapi } = require('graphql-server-hapi');\n\nconst rootSchema = require('./graphql/schema');\nconst dataLoaders = require('./graphql/data...
javascript
chosen
[ { "from": "system", "value": "Fix long running response (server side)\n" }, { "from": "human", "value": "const router = require('express').Router();\n\nfunction longRunningResponse(req, res, timeout) {\n let index = 0;\n const parts = 'HTTP/1.1 204 No Content'.split('');\n\n res.socket.write(...
javascript
chosen
[ { "from": "system", "value": "Improve comannd line help for config option\n" }, { "from": "human", "value": "// Load optional local-config file\n\n\"use strict\"\n/* eslint-env node */\n/* jslint node: true */\n\nconst log = require(\"./log\")\nconst configDefault = require(\"./configDefault\")\...
javascript
chosen
[ { "from": "system", "value": "Add dummy ga function for development environment\n" }, { "from": "human", "value": "if (process.env.NODE_ENV === 'production' && process.env.MOCHIFY !== 'true') {\n\t(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n\t(i[r].q=i[r].q||[])...
javascript
chosen
[ { "from": "system", "value": "Remove direct comparison against undefined.\n\nUndefined can be overwritten - using type comparison instead." }, { "from": "human", "value": "/**\n * isUndefined\n * Checks if a value is undefined or not.\n *\n * @name isUndefined\n * @function\n * @param {Anything}...
javascript
chosen
[ { "from": "system", "value": "Make the tab open directly to the right of the tab the lookup was started from, instead of at the end of all the window's tabs. Also, make the created tab have set an opener tab for it (affecting what tab gets focus when you close a tab).\n" }, { "from": "human", "v...
javascript
chosen
[ { "from": "system", "value": "Extend `Signature.toString` to optionally include timestamps\n" }, { "from": "human", "value": "var NodeGit = require(\"../\");\nvar Signature = NodeGit.Signature;\n\n/**\n * Standard string representation of an author.\n *\n * @return {string} Representation of the...
javascript
chosen
[ { "from": "system", "value": "Include jQuery in Jasmine specs\n" }, { "from": "human", "value": "/**\n * jasmine\n * =======\n *\n * Test settings\n *\n * Link: https://github.com/gruntjs/grunt-contrib-jasmine\n */\n\n'use strict';\n\nmodule.exports = function (grunt) {\n return {\n dist: {\...
javascript
chosen
[ { "from": "system", "value": "Revert \"break test case, test ci\"\n\nThis reverts commit f9c54664ff70535ac49b8d54f9a94830d312abc2.\n" }, { "from": "human", "value": "'use strict';\nvar path = require('path');\nvar tape = require('tape');\nvar app = require('express')();\nvar request = require('s...
javascript
chosen
[ { "from": "system", "value": ":new: Add Site info to Config\n" }, { "from": "human", "value": "'use strict';\n\nconst path = require('path');\nconst cfenv = require('cfenv');\n\nconst env = cfenv.getAppEnv();\nenv.host = env.url.replace(`:${env.port}`, '');\n\n\nmodule.exports = {\n contentType...
javascript
chosen
[ { "from": "system", "value": "Allow customization of grouping field\n" }, { "from": "human", "value": "var _ = require('underscore'),\n StatementsByFilter = require('./StatementsByFilter'),\n AmountEntryCollection = require('../../AmountEntryCollection'),\n Statement = require('../../St...
javascript
chosen
[ { "from": "system", "value": "Add documentation for create invitation\n" }, { "from": "human", "value": "//Invitations.js: Client for the Zendesk NPS API.\n\nconst util = require('util'),\n Client = require('../client').Client;\n//defaultgroups = require('../helpers').defaultgroups;\n\nconst In...
javascript
chosen
[ { "from": "system", "value": "Make the buffer test stream write async\n\nAs suggested by @pchelolo, asynchronously finish the stream.\n" }, { "from": "human", "value": "'use strict';\n\nvar stream = require('stream');\n\nfunction hello(restbase, req) {\n var body = new stream.PassThrough();\n...
javascript
chosen
[ { "from": "system", "value": "[Chore] Add __text satitization to price and image_link\n" }, { "from": "human", "value": "/**\n * Sanitize values\n *\n * @param {String | Array<string>} value The value to be sanitized\n * @param {Object} sanitize A sanitization type from sa...
javascript
chosen
[ { "from": "system", "value": "Set default Cache Control Header max-age > 0\n" }, { "from": "human", "value": "import express from 'express';\nimport bodyParser from 'body-parser';\nimport path from 'path';\nimport handleReactRoutes from './reactRoutes';\nimport dbRoutes from './dbRoutes';\nimpor...
javascript
chosen
[ { "from": "system", "value": "Add hexo Require for hexo3\n" }, { "from": "human", "value": "var path = require('path');\nvar ejs = require('ejs');\nvar fs = require('hexo-fs');\n\nvar layout = 'layout.ejs';\nvar bodyTag = '</body>';\nvar mathjaxScript = fs.readFileSync(path.join(__dirname, 'math...
javascript
chosen
[ { "from": "system", "value": "[fix] Return empty array when passed `undefined` or `null` in amazon.Client.prototype._toArray\n" }, { "from": "human", "value": "/*\n * client.js: Base client from which all AWS clients inherit from\n *\n * (C) 2012 Nodejitsu Inc.\n *\n */\n\nvar utile = require('u...
javascript
chosen
[ { "from": "system", "value": ":bug: Change config property to app from name\n" }, { "from": "human", "value": "'use strict';\n\nvar CloudFoundry = require('cf-nodejs-client'),\n Promise = require('bluebird'),\n util = require('util'),\n Spinner = require('cli-spinner').Spinner,\n spi...
javascript
chosen
[ { "from": "system", "value": "Copy identities from context to event model\n" }, { "from": "human", "value": "var Promise = require('bluebird');\nvar deepExtend = require('deep-extend');\n\nvar AnalyticsContext = require('./AnalyticsContext');\nvar AnalyticsEventModel = require('./AnalyticsEventM...
javascript
chosen
[ { "from": "system", "value": "Fix head color -- add material\n" }, { "from": "human", "value": "import * as THREE from 'three';\n\nimport Material from '../helpers/material';\nimport MeshHelper from '../helpers/meshHelper';\nimport Helpers from '../../utils/helpers';\nimport Config from '../../d...
javascript
chosen
[ { "from": "system", "value": "Convert tabs to 4 spaces\n" }, { "from": "human", "value": "/**\n * Imports svg into items with groups\n * Stetson Alpha - Paper.js\n *\n */\n\nvar ImportSVG = function()\n{\n\t//initialize\n\tfunction initialize()\n\t{\n\n\t};\n\n\t/**\n\t *\n\t * Takes the svg d...
javascript
chosen
[ { "from": "system", "value": "Fix bug with instantiating server-side Grid\n\n`this` cannot be used within the formal parameter list.\n" }, { "from": "human", "value": "import _ from 'underscore';\n\nclass Grid {\n\n // The state of a particular game grid\n constructor({ columnCount = 7, rowCou...
javascript
chosen
[ { "from": "system", "value": "Use `!Array.isArray` since it makes more sense.\n" }, { "from": "human", "value": "'use strict';\n\nconst os = require('os');\nconst debug = require('debug')('asset-resolver');\nconst resolver = require('./lib/resolver');\n\nfunction any(promises) {\n return Promis...
javascript
chosen
[ { "from": "system", "value": "Swap word API out with Chuck Norris joke API\n" }, { "from": "human", "value": "/*\n * We are using jQuery functions as they are pretty easy to use.\n * You can do all of this stuff using vanilla javascript though\n */\n\n// $(...) will run the function you give it ...
javascript
chosen
[ { "from": "system", "value": "Fix displaying a spinner more then once\n" }, { "from": "human", "value": "// -*- coding: utf-8 -*-\n//\n// (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>\n//\n// See LICENSE comming with the source of 'trex' for details.\n//\n'use strict';\n\nvar trexDirectives = a...
javascript
chosen
[ { "from": "system", "value": "Fix error when trying to run --remove-all\n\nThe error was as follows:\r\n\r\nsudo hose --remove-all\r\n\r\n/usr/local/share/npm/lib/node_modules/hose/index.js:32\r\n if (!err) {\r\n ^\r\nReferenceError: err is not defined\r\n at /usr/local/share/npm/lib/n...
javascript
chosen
[ { "from": "system", "value": "Add methods for level calculation and progression\n" }, { "from": "human", "value": "class Formula {\n static get QUADRATIC_COEFFICIENT() { return 25; }\n static get LINEAR_COEFFICIENT() { return 100; }\n static get CONSTANT_TERM() { return -125; }\...
javascript
chosen
[ { "from": "system", "value": "Migrate ScrollView fake type to ReactNative.NativeComponent\n\nReviewed By: yungsters\n\nDifferential Revision: D7985122\n\nfbshipit-source-id: b78fc6ad84485e8aa42657c2b21d70c9f3a271d6\n" }, { "from": "human", "value": "/**\n * Copyright (c) 2015-present, Facebook, ...
javascript
chosen
[ { "from": "system", "value": "Add support to community / mylist / user links.\n" }, { "from": "human", "value": "(function(module) {\n\t\"use strict\";\n\n\tvar nico = {},\n embed = '<div class=\"embed-responsive embed-responsive-16by9\"><iframe src=\"/plugins/nodebb-plugin-niconico/embed/plugi...
javascript
chosen
[ { "from": "system", "value": "Define delete method name as string to make MSIE8 happy\n" }, { "from": "human", "value": "var HashWrapper = {\n keys: function() {\n return Object.keys(this.__value);\n },\n\n values: function() {\n var key,\n values = [];\n for (key in this.__va...
javascript
chosen
[ { "from": "system", "value": "Disable dragging marker from map\n" }, { "from": "human", "value": "\"use strict\";\n\nvar photoSingle = angular.module('photo.single', ['ionic', 'ngCordova', '500px.service', 'uiGmapgoogle-maps'])\n\nphotoSingle.controller('PhotoSingleController', ['$rootScope', '$...
javascript
chosen
[ { "from": "system", "value": "Allow user to set language_in, language_out,and compilation_level settings.\n" }, { "from": "human", "value": "var path = require('path');\nvar gcc = require('./lib/runner');\nvar RawSource = require('webpack-core/lib/RawSource');\n\nfunction ClosureCompilerPlugin(o...
javascript
chosen
[ { "from": "system", "value": "Add helper method to asign the correct css class to the general banner according to the asigned announcement level\n" }, { "from": "human", "value": "import React, {Component} from 'react'\n\nexport default class GeneralBanner extends Component {\n render() {\n ...
javascript
chosen
[ { "from": "system", "value": "Use node7's async and await methods\n" }, { "from": "human", "value": "#!/usr/bin/env node --harmony\n\nvar program = require('commander');\nvar fetch = require('node-fetch');\nvar base64 = require('base-64');\n\nprogram\n\t.arguments('<uri>')\n\t.version('0.0.2')\n...
javascript
chosen
[ { "from": "system", "value": "Add useBasename to top-level exports\n" }, { "from": "human", "value": "export createHistory from './createBrowserHistory'\nexport createHashHistory from './createHashHistory'\nexport createMemoryHistory from './createMemoryHistory'\nexport createLocation from './cr...
javascript
chosen
[ { "from": "system", "value": "FRIN23-284: Add option to disable adding target blank to full urls\n\nUses the same behaviour as in frg -> external.js\n" }, { "from": "human", "value": "/*jslint browser: true, indent: 2, todo: true, unparam: true */\n/*global jQuery,Ornament */\n\n(function (docum...
javascript
chosen
[ { "from": "system", "value": "Add short transition time for the light component\n" }, { "from": "human", "value": "import React from 'react';\nimport Radium from 'radium';\n\nimport { lightActive, lightInactive } from 'theme/variables';\n\nconst size = 18;\nconst innerPadding = 4;\n\n@Radium\ncl...
javascript
chosen
[ { "from": "system", "value": "Use notebook list's base_url [ci skip]\n" }, { "from": "human", "value": "define(function(require) {\n var $ = require('jquery');\n var Jupyter = require('base/js/namespace');\n\n function load() {\n if (!Jupyter.notebook_list) return;\n var ba...
javascript
chosen
[ { "from": "system", "value": "Revert \"Revert \"pseudoRandomBytes -> randomBytes\"\"\n\nThis reverts commit be24b3f5aabfefecf89955a79a6414c57b4f3b46.\n" }, { "from": "human", "value": "/**\n * Module dependencies\n */\n\nvar crypto = require('crypto');\n\n/**\n * 62 characters in the ascii range...
javascript
chosen
[ { "from": "system", "value": "Change JS function addKeyUp to addChangeEvent\n" }, { "from": "human", "value": "\"use strict\";\n\nvar cbo = cbo || {}\n\ncbo.feeCalculator = {\n init : function(container_id) {\n this.addKeyUp(container_id);\n },\n addKeyUp: function(container_id) {\n $('...
javascript
chosen
[ { "from": "system", "value": "Update default comment role to work on all comment fields\n\nWasn't working if you opened an \"Assign\" modal. Also before it would\nonly work a single time, and that's silly.\n" }, { "from": "human", "value": "jQuery.noConflict();\n\nvar defaultRoleName = \"role:10...
javascript
chosen
[ { "from": "system", "value": "Fix a breaking change due to the angular dependency update\n" }, { "from": "human", "value": "import angular from 'angular'\nimport 'angular-aria'\nimport 'angular-i18n/nl-nl'\nimport 'angular-sanitize'\n\nconst moduleDependencies = [\n // Main modules\n 'dpDetail...
javascript
chosen
[ { "from": "system", "value": "Use angular $parse to handle nested mode\n\nMeteorSession doesn't work with nested mode something link 'a.b.c'\r\nFix it by using angular $parse" }, { "from": "human", "value": "'use strict';\nvar angularMeteorSession = angular.module('angular-meteor.session', ['ang...
javascript
chosen
[ { "from": "system", "value": "Add checking of empty query\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nconst request = require('request')\nconst cheerio = require('cheerio')\nconst chalk = require('chalk')\nconst Spinner = require('cli-spinner').Spinner\nconst isChinese = require('i...
javascript
chosen
[ { "from": "system", "value": "Use the `exact` option in `url-regex`\n" }, { "from": "human", "value": "'use strict';\nvar urlRegex = require('url-regex');\nvar re = new RegExp('^' + urlRegex().source + '$', 'i');\n\nmodule.exports = function (url) {\n\tif (typeof url !== 'string') {\n\t\tthrow n...
javascript
chosen
[ { "from": "system", "value": "Set treePaths instead of `treeFor`." }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n name: 'Ember CLI ic-ajax',\n\n treeFor: function(name) {\n if (name !== 'vendor') { return; }\n\n return this.treeGenerator(path.join(__dirname, 'node_...
javascript
chosen
[ { "from": "system", "value": "feat: Add final route catching for handling 404 on api\n" }, { "from": "human", "value": "\"use strict\"\n\nconst express = require('express');\n\nvar scraper = require('./app/routes/scraper');\n\nconst app = express();\n\napp.use('/', scraper);\n\napp.listen(3000, ...
javascript
chosen
[ { "from": "system", "value": "Update alert banner for HashiConf Global 2021\n" }, { "from": "human", "value": "export const ALERT_BANNER_ACTIVE = true\n\n// https://github.com/hashicorp/web-components/tree/master/packages/alert-banner\nexport default {\n tag: 'Event',\n url: 'https://hashiconf...
javascript
chosen
[ { "from": "system", "value": "Add script tag to the body\n\nThis gives more benefit from using Fastboot" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ember-g-recaptcha',\n\n contentFor: function(type, config) {\n var content = '';\n ...
javascript
chosen
[ { "from": "system", "value": "Use es6 imports instead of require\n" }, { "from": "human", "value": "import {run} from '@cycle/xstream-run';\nimport {makeDOMDriver, div} from '@cycle/dom';\nimport xs from 'xstream';\n\nimport Scratchpad from './src/scratchpad';\n\nconst startingCode = `\nconst Cy...
javascript
chosen
[ { "from": "system", "value": "Use common \"--config\" argument for loading configuration.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict';\n\nconst args = require('yargs')\n .usage('Usage: $0 [args]')\n .option('cf', {\n alias: 'config-file',\n describe: 'path to a c...
javascript
chosen
[ { "from": "system", "value": "Update toJSON to return a string\n\nInstead of returning the metadata object, it should return that object\nencoded as a JSON string\n" }, { "from": "human", "value": "'use strict';\n\nvar R = require('ramda');\nvar isEmptyObj = R.pipe(R.keys, R.isEmpty);\n\nfunctio...
javascript
chosen
[ { "from": "system", "value": "Allow the reporter to be a member of the required module" }, { "from": "human", "value": "#!/usr/bin/env node\nrequire(\"ts-node/register\");\nvar path = require(\"path\");\nvar fs = require(\"fs\");\nvar Jasmine = require(\"jasmine\");\nvar Command = require(\"jasm...
javascript
chosen
[ { "from": "system", "value": "Allow cursorColor override in config\n\nThe default cursorColor for this theme is quite low-contrast (especially when opting for `cursorShape: 'UNDERLINE'|'BEAM'`). I think allowing the user to specify their preferred cursor color would be ideal." }, { "from": "human", ...
javascript
chosen
[ { "from": "system", "value": "Add \"pretty\" values - value descriptions for use in presentation.\n" }, { "from": "human", "value": "/** General application user settings.\n *\n * Each entry specifies the variable name, default value, and optional\n * third element indicates that the value shoul...
javascript
chosen
[ { "from": "system", "value": "Fix the expand/close button text\n" }, { "from": "human", "value": "require([ \"jquery\" ], function($) {\n\n \"use strict\";\n\n $(\"pre\").each(function() {\n\n if (this.firstChild.getBoundingClientRect().height > this.getBoundingClientRect().height) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add package to AuthorizationException so implementors of this don't need to import that.\n" }, { "from": "human", "value": "/**\n * @license\n * Copyright 2018 The FOAM Authors. All Rights Reserved.\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfoam.INTERFA...
javascript
chosen
[ { "from": "system", "value": "Use sinon.FakeXMLHttpRequest to test AJAX\n" }, { "from": "human", "value": "\"use strict\";\n\nvar assert= require('assert')\n\ndescribe('Zotero editing view', function () {\n var ZoteroItemView = require('../views/edit_zotero')\n , testData\n\n testData = {\n...
javascript
chosen
[ { "from": "system", "value": "Use `json` option in `got`\n" }, { "from": "human", "value": "'use strict';\nvar got = require('got');\n\nmodule.exports = function (url, cb) {\n\tgot('http://isitup.org/' + url + '.json', {\n\t\theaders: {\n\t\t\t'user-agent': 'https://github.com/sindresorhus/is-u...
javascript
chosen
[ { "from": "system", "value": "Bring the directory near to the modules definition\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Run the modules with the libraries and the services\n * @example\n let config = {\n directory: __dirname + '/',\n libraries: {\n ...
javascript
chosen
[ { "from": "system", "value": "Throw error instead of returning it.\n" }, { "from": "human", "value": "// http://cs.selu.edu/~rbyrd/math/midpoint/\n// ((x1+x2)/2), ((y1+y2)/2)\nvar point = require('turf-point');\n\n/**\n * Takes two point features and returns a point between the two.\n *\n * @mod...
javascript
chosen
[ { "from": "system", "value": "Add function to speak YES\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nmodule.exports = function (text) {\n\tif (text.length !== 0){\n\t\tconsole.log(text + ' あったかいんだからぁ');\n\t} else {\n\t\ttomaranaindakaraa();\n\t}\n}\n\nfunction tomaranaindakaraa () {...
javascript
chosen
[ { "from": "system", "value": "Reorder object definition for error data\n" }, { "from": "human", "value": "var LogEmitter = function (source) {\n this.source = source;\n};\n\nLogEmitter.prototype.info = function (message) {\n process.emit(\"gulp:log\", { level: \"info\", message: message, sourc...
javascript
chosen
[ { "from": "system", "value": "Update exported module configuration to new style\n" }, { "from": "human", "value": "'use strict';\nvar analyzers = require('./src')['analyzers'],\n codeCopter = require('./src')['code-copter'];\n\ncodeCopter.configure({\n jshint: analyzers.jshint,\n jscs: ...
javascript
chosen
[ { "from": "system", "value": "Use ES5 import to avoid babelize\n" }, { "from": "human", "value": "export default function oneliner(str) {\n return str.replace(/[\\r\\n\\t ]+/g, ' ');\n}\n\n\nconst t = oneliner(`Hey !\nThis is my text file\n with a lot of blabla and some code:\n function t(a...
javascript
chosen
[ { "from": "system", "value": "Use dateTime for passwordResetExpires field in user migration table\n" }, { "from": "human", "value": "exports.up = function(knex, Promise) {\n return Promise.all([\n knex.schema.createTable('users', function(table) {\n table.increments();\n table.stri...
javascript
chosen
[ { "from": "system", "value": "Use Chrome to test in CI\n" }, { "from": "human", "value": "/*jshint node:true*/\nmodule.exports = {\n \"framework\": \"qunit\",\n \"test_page\": \"tests/index.html?hidepassed\",\n \"disable_watching\": true,\n \"launch_in_ci\": [\n \"PhantomJS\"\n ],\n \"l...
javascript
chosen
[ { "from": "system", "value": "Tweak styled-base deprecation error message\n" }, { "from": "human", "value": "throw new Error(\n 'A new entrypoint in the `@emotion/styled` package, `@emotion/styled/base`, has replaced the `@emotion/styled-base` package. Please remove this package use `@emotion/s...
javascript
chosen
[ { "from": "system", "value": "Add existence check for dash source\n\nSafari complains about removing a non-existent child.\n" }, { "from": "human", "value": "import {browser} from '../browser';\n\nexport const filterSources = function(playerElement) {\n if (playerElement.tagName.toLowerCase() !...
javascript
chosen
[ { "from": "system", "value": "Fix wrong stackOffset / stack slicing problem\n" }, { "from": "human", "value": "define(['summernote/core/range'], function (range) {\n /**\n * History\n * @class\n */\n var History = function ($editable) {\n var stack = [], stackOffset = 0;\n var edit...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix a bug in GenValue\n" }, { "from": "human", "value": "\"use strict\"\n// H = Helpers\nlet Helpers = {\n // Iterate over generator helper\n genValue: function(Gen, Callback) {\n for(var Value of Gen){\n Callback(Value)\n }\n },\n genValues: fu...
javascript
chosen
[ { "from": "system", "value": "Fix a bug in the pager\n" }, { "from": "human", "value": "Meteor.methods({\n setPassword: function (someUserId, newPW) {\n if(!this.userId) return true\n if(Meteor.isServer)\n Accounts.setPassword(someUserId, newPW, {logout: false})\n return false\n ...
javascript
chosen
[ { "from": "system", "value": "Make flushBufferedWrites() a private method\n" }, { "from": "human", "value": "'use strict';\nvar Node = require('./Node');\n\nclass Program extends Node {\n constructor(def) {\n super('Program');\n this.body = def.body;\n }\n\n generateCode(g...
javascript
chosen
[ { "from": "system", "value": "Remove extraneous hook, since it was moved from gobble-expression to gobble-token it doesn't need an after-token hook anymore\n" }, { "from": "human", "value": "const OCURLY_CODE = 123; // {\nconst CCURLY_CODE = 125; // }\nconst OBJECT_EXP = 'ObjectExpression';\nco...
javascript
chosen
[ { "from": "system", "value": "Disable context menu entry if not on imagewq\n" }, { "from": "human", "value": "var gImageForward = {\n\n onLoad: function() {\n if ('undefined' == typeof gBrowser) {\n return;\n }\n window.removeEventListener('load', gImageForward...
javascript
chosen
[ { "from": "system", "value": "Change ICON to new loader format" }, { "from": "human", "value": "define(['mac/palette2'], function(palette) {\n\n 'use strict';\n \n return function(resource) {\n if (resource.data.length !== 128 && resource.data.length !== 256) {\n console.error('ICON r...
javascript
chosen
[ { "from": "system", "value": "Add promize polyfill by default\n" }, { "from": "human", "value": "import 'core-js/es6/object';\nimport 'core-js/es6/array';\nimport 'js-polyfills/html';\nimport 'svgxuse';\n\nimport './components/example';\n" }, { "from": "gpt", "value": "import 'core-j...
javascript
chosen
[ { "from": "system", "value": "Add new fields to the User Schema.\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\r\nvar passportLocalMongoose = require('passport-local-mongoose');\r\n\r\nvar UserSchema = mongoose.Schema({\r\n username: String,\r\n password: String\r\...
javascript
chosen
[ { "from": "system", "value": "Update ServiceWorker to only fetch specific files\n" }, { "from": "human", "value": "importScripts('serviceworker-cache-polyfill.js');\n\n// TODO: cache figures and other external resources on install\n\nself.onfetch = function(event) {\n var fetchRequest = event...
javascript
chosen
[ { "from": "system", "value": "Refactor to inline value search\n" }, { "from": "human", "value": "'use strict';\n\n// MODULES //\n\nvar indexOf = require( '@stdlib/utils/index-of' );\nvar modes = require( '@stdlib/types/ndarray/base/modes' );\n\n\n// VARIABLES //\n\nvar MODES = modes();\n\n\n// M...
javascript
chosen
[ { "from": "system", "value": "Fix map view crashing with non existent selected unit\n" }, { "from": "human", "value": "import React from 'react';\nimport isEmpty from 'lodash/isEmpty';\nimport SingleUnitOnMap from './SingleUnitOnMap';\nimport {sortByCondition} from '../helpers';\n\nexport const ...
javascript
chosen
[ { "from": "system", "value": "Correct the function name for better legibility\n" }, { "from": "human", "value": "import React from 'react';\n\nimport Dropdown from '../../../src/Dropdown/Dropdown.js';\n\nclass DropdownExample extends React.Component {\n\n handleItemSelection(item) {\n consol...
javascript
chosen
[ { "from": "system", "value": "Remove filter of `docs.js` file inside build scripts\n" }, { "from": "human", "value": "const { readdirSync, readFileSync } = require(\"fs\");\n\nconst sources = readdirSync(\"src\").reduce((result, file) => {\n if (file !== \"docs.js\") {\n result[file] = readF...
javascript
chosen
[ { "from": "system", "value": "Allow the editor to load on slow computers and connections\n\n# Require.js will abandon loading any module that takes more than 7 seconds\n# to load. For editors with slow connections and computers, this limit may\n# be reached. Since this isn't a production app, long load time...
javascript
chosen
[ { "from": "system", "value": "Return the process object when spawning a new process\n" }, { "from": "human", "value": "const {\n spawn\n} = require(\"child_process\");\n\nconst options = {\n sources: function (path) {\n return `-Dsonar.sources=\"${path}\"`;\n },\n projectName:...
javascript
chosen
[ { "from": "system", "value": "Remove the example test site. If you're not a user of that blog, the authorization will fail.\n" }, { "from": "human", "value": "\n/**\n * Module dependencies.\n */\n\nvar express = require('express');\nvar WPOAuth = require('../');\n\n/**\n * Get setting data\n */...
javascript
chosen
[ { "from": "system", "value": "Fix bind polyfill and force it on phantomjs\n" }, { "from": "human", "value": "if (!Function.prototype.bind) {\r\n Function.prototype.bind = function(oThis) {\r\n if (typeof this !== 'function') {\r\n // closest thing possible to the ECMAScript ...
javascript
chosen
[ { "from": "system", "value": "Fix wrong function name in server_chain\n" }, { "from": "human", "value": "// Update user's last activity time in redis. Field `User.last_active_ts` will be updated via cron.\n//\n\n\n'use strict';\n\n\n\nmodule.exports = function (N) {\n\n // Update last activity ...
javascript
chosen
[ { "from": "system", "value": "Split the event category into yes/no\n" }, { "from": "human", "value": "var helpful_yes = document.querySelector( '.helpful_yes' );\nvar helpful_no = document.querySelector( '.helpful_no' );\nvar helpful_text = document.querySelector( '.helpful__question' );\n\nfunc...
javascript
chosen
[ { "from": "system", "value": "Handle google api client authentication\n" }, { "from": "human", "value": "/** @jsx React.DOM */\n\nvar GoogleApiAuthForm = React.createClass({\n render: function () {\n return (\n <form role=\"form\">\n <div className=\"form-grou...
javascript
chosen
[ { "from": "system", "value": "Add \"immediate start\" instead of past\n" }, { "from": "human", "value": "import React from \"react\";\nimport { Button, Text } from \"react-native\";\nimport { observer } from \"mobx-react\";\nimport moment from \"moment\";\n\nexport default context => {\n const...
javascript
chosen
[ { "from": "system", "value": "Add '/logout' route that logs out then redirects to splash page\n" }, { "from": "human", "value": "const user = require('../../db/user.js')\nconst router = require('express').Router()\n\ncreateUserSession = (req, res, user) => {\n req.session.user = user\n /...
javascript
chosen