conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Return file if it isn't a png\n" }, { "from": "human", "value": "'use strict';\n\nvar ExecBuffer = require('exec-buffer');\nvar isPng = require('is-png');\nvar optipng = require('optipng-bin').path;\nvar through = require('through2');\n\n/**\n * optipng imagemin plu...
javascript
chosen
[ { "from": "system", "value": "Remove \"html\" from the inputFormats list\n\nAll HTML is not reshape." }, { "from": "human", "value": "'use strict'\n\nconst reshape = require('reshape')\n\nexports.name = 'reshape'\nexports.inputFormats = ['reshape', 'html']\nexports.outputFormat = 'html'\n\nexpor...
javascript
chosen
[ { "from": "system", "value": "Write the lgin controller to pass the tests\n" }, { "from": "human", "value": "const jwt = require('jsonwebtoken')\nconst userModel = require('../../models/users')\nconst { buildResponse } = require('../../utils/responseService')\n\nmodule.exports = (req, res) => {\...
javascript
chosen
[ { "from": "system", "value": "Fix the name of a test helper export to match the actual function name\n" }, { "from": "human", "value": "Package.describe({\n name: 'jacksingleton:accounts-sandstorm-dev',\n\n version: '0.0.2',\n\n summary: 'Stubs Sandstorm user headers and provides helper metho...
javascript
chosen
[ { "from": "system", "value": "Convert relative apiURL paths to absolute paths\n" }, { "from": "human", "value": "var packageJSON = require(\"../../../package.json\");\n\nvar config = {\n // @@ENV gets replaced by build system\n environment: \"@@ENV\",\n // If the UI is served through a proxie...
javascript
chosen
[ { "from": "system", "value": "Make record-pendant the default notification action. Prod testing is great :sadnerd:\n" }, { "from": "human", "value": "console.log('Started', self);\nself.addEventListener('install', function(event) {\n self.skipWaiting();\n console.log('Installed', event);\n...
javascript
chosen
[ { "from": "system", "value": "Set port as an environment variable\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar weechat = require('weechat'),\n notify = require('osx-notifier'),\n client;\n\nvar properties = {\n server: process.env.SERVER,\n port: 8001,\n password...
javascript
chosen
[ { "from": "system", "value": "Add `strict` mode to consider warnings as errors\n\nThis is a first approach to fix issue #38. It would be good improve\noutput to make it more uniform with `mocha` errors, but at least it\ndoes the job :-)\n" }, { "from": "human", "value": "var CLIEngine = require(...
javascript
chosen
[ { "from": "system", "value": "Throw TypeError when input isn't a string\n\nThis prevents a pretty common error when giving the function a number would always return `false`. This is especially confusing since the parameter in question is named `number`." }, { "from": "human", "value": "'use stri...
javascript
chosen
[ { "from": "system", "value": "Check if windows, then load pty_win.js if unix* then load pty.js\n" }, { "from": "human", "value": "module.exports = require('./lib/pty_win.js');\n" }, { "from": "gpt", "value": "var os = process.platform === 'win32' ? '_win' : '';\nmodule.exports = requ...
javascript
chosen
[ { "from": "system", "value": "Replace direct hasOwnProperty with Object.prototype access\n" }, { "from": "human", "value": "'use strict'\n/* eslint no-proto: 0 */\nmodule.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties)\n\nfunction setProtoOf...
javascript
chosen
[ { "from": "system", "value": "Remove .render() - JSTransformer should do that" }, { "from": "human", "value": "/**\n * jstransformer-toffee <https://github.com/jstransformers/jstransformer-toffee>\n *\n * Copyright (c) 2015 Charlike Mike Reagent, contributors.\n * Released under the MIT license....
javascript
chosen
[ { "from": "system", "value": "Add failing test for dynamic imports\n" }, { "from": "human", "value": "const matchSourceExpression = require('../lib/matchSourceExpression');\nconst expect = require('./unexpected-with-plugins');\n\nconst parse = require('../lib/parseJavascript');\n\ndescribe('pars...
javascript
chosen
[ { "from": "system", "value": "Make things more consistent, fix changing props\n" }, { "from": "human", "value": "React.BackboneMixin = {\n componentDidMount: function(domNode) {\n // Whenever there may be a change in the Backbone data, trigger a reconcile.\n var model = this.getMode...
javascript
chosen
[ { "from": "system", "value": "Add webp support to redirector.\n" }, { "from": "human", "value": "const http = require('http');\n\nconst notFound = (res) => {\n res.statusCode = 404;\n res.end();\n};\n\nconst movedPermanently = (res, location) => {\n res.statusCode = 301;\n res.setHeader('Loc...
javascript
chosen
[ { "from": "system", "value": "Remove destroy card from game controller\n" }, { "from": "human", "value": "define([\n\n 'Backbone',\n\n //Templates\n 'text!templates/project-page/closeGameTemplate.html'\n], function(\n\n Backbone,\n\n //Template\n closeGameTemplate\n){\n var GameController...
javascript
chosen
[ { "from": "system", "value": "Select textarea contents on click\n" }, { "from": "human", "value": "document.addEventListener('DOMContentLoaded', function() {\n\tgetSource();\n});\n\nfunction getSource() {\n\tdocument.getElementById('source').innerText = \"Loading\";\n\tchrome.tabs.query({active:...
javascript
chosen
[ { "from": "system", "value": "Make test hooks optonal to run example/fib.jsx\n" }, { "from": "human", "value": "/*\n\ttest launcher invoked by jsx --test\n*/\nfunction $__jsx_runTests(testClass, tests) {\n\tif (!testClass) return; // skip if there's no test class\n\n\tif(tests.length === 0) {\n\...
javascript
chosen
[ { "from": "system", "value": "Adjust example code for imageForSize helper\n\nThe imageForSize method seems be accessible through the `helpers` namespace which doesn't reflect in the docs." }, { "from": "human", "value": "/**\n * @namespace ImageHelpers\n */\nexport default {\n\n /**\n * Gener...
javascript
chosen
[ { "from": "system", "value": "Test that nodes contain the methods we use\n" }, { "from": "human", "value": "chrome.extension.sendMessage({}, function(response) {\n var readyStateCheckInterval = setInterval(function() {\n if (document.readyState === \"complete\") {\n clearInterval(readyS...
javascript
chosen
[ { "from": "system", "value": "Allow for loading from inside a web component\n\nWalk up to the root to find url, don't depend on document's location\n" }, { "from": "human", "value": "/*\n * Copyright 2012 The Toolkitchen Authors. All rights reserved.\n * Use of this source code is governed by a ...
javascript
chosen
[ { "from": "system", "value": "Enable setting cache option when defining CouchDB conenction\n" }, { "from": "human", "value": "var cradle = require('cradle'),\n logger = require('./logger'),\n db;\n\nmodule.exports.create_connection = function (options) {\n if (typeof(options) === 'string'...
javascript
chosen
[ { "from": "system", "value": "Change Preact from React :(\n" }, { "from": "human", "value": "'use strict';\n\nconst path = require('path');\nconst webpack = require('webpack');\nconst validator = require('webpack-validator');\n\nmodule.exports = validator({\n entry: path.join(__dirname, 'src', ...
javascript
chosen
[ { "from": "system", "value": "Exit linking mode after creating a booking\n" }, { "from": "human", "value": "/* This file is part of Indico.\n * Copyright (C) 2002 - 2019 European Organization for Nuclear Research (CERN).\n *\n * Indico is free software; you can redistribute it and/or\n * modify ...
javascript
chosen
[ { "from": "system", "value": ":wrench: Remove unnecessary minified ES module\n" }, { "from": "human", "value": "const merge = require('webpack-merge');\nconst webpack = require('webpack');\n\nconst baseConfig = require('./webpack.base.config');\n\nconst prodConfig = merge(baseConfig, {\n\tdevtoo...
javascript
chosen
[ { "from": "system", "value": "Fix entry title for create-title command\n" }, { "from": "human", "value": "const BaseCommand = require(\"./BaseCommand.js\");\n\n/**\n * Command for creating entries\n * @class CreateEntryCommand\n * @augments BaseCommand\n */\nclass CreateEntryCommand extends Base...
javascript
chosen
[ { "from": "system", "value": "Install jquery-mockjax with npm instead of bower.\n" }, { "from": "human", "value": "module.exports = {\n // Hack for previous versions of Ember CLI\n normalizeEntityName: function() {},\n\n afterInstall: function() {\n return this.addBowerPackageToProject('jq...
javascript
chosen
[ { "from": "system", "value": "[docs] Use captureMessage instead of exception\n" }, { "from": "human", "value": "import React from 'react';\nimport * as Sentry from '@sentry/browser';\n\nexport default class Error extends React.Component {\n static getInitialProps({ res, err }) {\n const stat...
javascript
chosen
[ { "from": "system", "value": "Add shortcut and changes[SEARCH_KEY_NAME] checks\n" }, { "from": "human", "value": "\"use strict\";\n\nimport { SEARCH_KEY_NAME } from \"./constants\";\n\n// Enable chromereload by uncommenting this line:\nimport \"./lib/livereload\";\n\nimport createMenu from \"./l...
javascript
chosen
[ { "from": "system", "value": "Add '/' to the start of English language path [Skip CI]\n" }, { "from": "human", "value": "import React from 'react';\nimport {Link} from 'gatsby';\n\nimport {routes} from '../../src/i18n';\n\nconst LLink = ({locale, children, to, prefetch, ...props}) => {\n if (!p...
javascript
chosen
[ { "from": "system", "value": "Add binaryType for ws protocol" }, { "from": "human", "value": "'use strict'\nvar pick = require('lodash.pick')\nvar url = require('url')\nvar connect = require('pull-ws/client')\nvar util = require('../util')\n\nmodule.exports = function (params, cb) {\n params = ...
javascript
chosen
[ { "from": "system", "value": "Align proof of work to the api change in openpgpjs\n" }, { "from": "human", "value": "importScripts('openpgp.worker.min.js');\n\nsha256 = window.openpgp.crypto.hash.sha256;\n\nvar iterateOverSHA = function(seed) {\n var i;\n for (i = 0; i < 1024; i++) {\n var x...
javascript
chosen
[ { "from": "system", "value": "Remove method render title from menu component\n" }, { "from": "human", "value": "var builder = require('focus').component.builder;\nvar React = require('react');\nvar type = require('focus').component.types;\nvar popinProperties = require('../mixin/popin-behaviour'...
javascript
chosen
[ { "from": "system", "value": "Fix bug where dependencies aren't part of the context\n" }, { "from": "human", "value": "import lodash from 'lodash';\n\nexport function listeningTo(storeNames, getterMethodName = 'getStateFromDependencies') {\n return decorator;\n\n function decorator(fn) {\n...
javascript
chosen
[ { "from": "system", "value": "Fix typo after file renaming\n" }, { "from": "human", "value": "/* global fetch */\n\nimport React from 'react';\nimport 'whatwg-fetch';\n\nexport default class UserStatisticPage extends React.Component {\n constructor(props) {\n super(props);\n this.state = ...
javascript
chosen
[ { "from": "system", "value": "Make pageUri equal to process.cwd() in Node.js\n" }, { "from": "human", "value": "/**\n * The fake sandbox of browser environment\n */\n\nexports.document = {\n\n getElementById: function(id) {\n // Return the fake loader script node\n if (id === \"seajsnode\...
javascript
chosen
[ { "from": "system", "value": "Add request path to logging\n" }, { "from": "human", "value": "import {unauthorized} from 'boom'\nimport Logger from '@modulus/logger'\n\nimport Config from '../../config'\n\nlet logger = Logger('handlers/auth')\n\nfunction validate(token, callback) {\n if (token =...
javascript
chosen
[ { "from": "system", "value": "Change listen port to 8000\n" }, { "from": "human", "value": "var path = require('path');\nvar webappengine = require('webappengine');\n\nwebappengine({\n port: 80,\n routes: [\n {\n type: 'server',\n route: '/',\n serve...
javascript
chosen
[ { "from": "system", "value": "Remove Save on Quit Logic\n" }, { "from": "human", "value": "'use strict'\n\nclass Protocol {\n constructor(initialAddress) {\n this.initialAddress = initialAddress\n }\n}\n\nlet init = address => {\n \n}\n\n// Save on Exit\n\nprocess.stdin.resume()\n\nlet qui...
javascript
chosen
[ { "from": "system", "value": "Change precedence of loader config stringifier\n" }, { "from": "human", "value": "/**\n * @param {Object} loaderConfig Loader configuration from Webpack config\n * @returns {string}\n */\nfunction stringifyLoaderConfig(loaderConfig) {\n var stringified = null;\n\n ...
javascript
chosen
[ { "from": "system", "value": "Change is checked when either condition or watch changes\n" }, { "from": "human", "value": "var Gaffa = require('gaffa');\r\n\r\n\r\nfunction executeBehaviour(behaviour, value){\r\n behaviour.gaffa.actions.trigger(behaviour.actions.change, behaviour);\r\n}\r\n\r\...
javascript
chosen
[ { "from": "system", "value": "Define hooks on model options\n" }, { "from": "human", "value": "const Sequelize = require('sequelize')\nconst bcrypt = require('bcrypt')\nconst sequelize = require('./../db')\n\nconst userAttributes = {\n 'email': {\n 'type': Sequelize.TEXT,\n 'allowNull'...
javascript
chosen
[ { "from": "system", "value": "Add style as prop to highlight button\n" }, { "from": "human", "value": "import React from 'react';\nimport * as styles from './Home.scss';\n\nconst Help = ({ activate }) => {\n return (\n <button className={styles.helpButton} onClick={activate}>Help</button>\n ...
javascript
chosen
[ { "from": "system", "value": "Edit search function to only return modules that are mapped to the exact NUS module code entered by user\n" }, { "from": "human", "value": "import { Meteor } from 'meteor/meteor';\nimport { Match, check } from 'meteor/check';\n\n\nMeteor.publish('modules', function(...
javascript
chosen
[ { "from": "system", "value": "Fix logic condition mess in request header checks\n" }, { "from": "human", "value": "/*\n * Copyright (c) 2014-2020 Bjoern Kimminich.\n * SPDX-License-Identifier: MIT\n */\n\nconst models = require('../models/index')\nconst insecurity = require('../lib/insecurity')\...
javascript
chosen
[ { "from": "system", "value": "Fix failing build under node.js 6\n" }, { "from": "human", "value": "const { expect } = require(\"chai\")\n\ndescribe(\"Chevrotain Webpacking support\", () => {\n it(\"Can be webpacked without any special configuration when the grammar and tokens are defined in t...
javascript
chosen
[ { "from": "system", "value": "Add workaround for atomic writes in watch mode\n" }, { "from": "human", "value": "let chokidar = require('chokidar');\n\nclass Task {\n /**\n * Create a new task instance.\n *\n * @param {Object} data\n */\n constructor(data) {\n this.da...
javascript
chosen
[ { "from": "system", "value": "Add a custom matcher to check the presence of specific classes\n" }, { "from": "human", "value": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain ...
javascript
chosen
[ { "from": "system", "value": "Remove superfluous jQuery import, and remove console.log\n" }, { "from": "human", "value": "'use strict';\nimport backbone from 'backbone';\nimport $ from 'jquery';\nconsole.log(backbone);\nexport class Hello extends backbone.View {\n render() {\n this.$el...
javascript
chosen
[ { "from": "system", "value": "Add pause/resume examples on demo\n" }, { "from": "human", "value": "import React from 'react'\nimport ReactDOM from 'react-dom'\nimport VoicePlayer from './voice-player'\n\nclass Demo extends React.Component {\n state = {\n play: true,\n pause: false\n }\n\...
javascript
chosen
[ { "from": "system", "value": "Allow caller to set flags\n" }, { "from": "human", "value": "import {compile} from 'google-closure-compiler-js';\nimport logger from './logger';\n\nexport default function closure(flags = {}) {\n return {\n name: 'closure-compiler-js',\n transformBu...
javascript
chosen
[ { "from": "system", "value": "Make eslint comment more specific\n" }, { "from": "human", "value": "import React from 'react'\nimport ReactDom from 'react-dom'\nimport { AppContainer } from 'react-hot-loader'\nimport App from './components/App'\n\nconst render = (Component) => {\n ReactDom.rende...
javascript
chosen
[ { "from": "system", "value": "Update to ES6 modules for entry\n" }, { "from": "human", "value": "import {Route, Redirect, Switch, Prompt, withRouter} from 'react-router'\nimport {Link, NavLink} from 'react-router-dom'\nimport {connect} from 'react-redux'\nimport model from './model'\nimport {act...
javascript
chosen
[ { "from": "system", "value": "Use hashHistory in router when served on GH pages\n" }, { "from": "human", "value": "import React from 'react';\nimport { render } from 'react-dom';\nimport { browserHistory } from 'react-router';\nimport { syncHistoryWithStore } from 'react-router-redux';\nimport i...
javascript
chosen
[ { "from": "system", "value": "Throw if bond object is missing\n" }, { "from": "human", "value": "import Joi from 'joi';\n\nimport { calcPrice, calcYield } from './bond';\n\nconst schema = Joi.object().keys({\n settlement: Joi.date().max(Joi.ref('maturity')).required(),\n maturity: Joi.date().r...
javascript
chosen
[ { "from": "system", "value": "Increase each item of the lVal by rVal when lVal is an array and rVal is a plain value.\n" }, { "from": "human", "value": "\nvar Operator = require(\"dice-js/operator\");\n\nOperator.define(\"Addition\", {\n symbol: \"+\",\n operation: function (lVal, rVal) {\...
javascript
chosen
[ { "from": "system", "value": "Fix name of font size map\n" }, { "from": "human", "value": "/* ***********************************************************************************************\n\n Unify Project\n\n Homepage: unify-project.org\n License: MIT + Apache (V2)\n Copyright: 20...
javascript
chosen
[ { "from": "system", "value": "Add tests for rendered target\n" }, { "from": "human", "value": "var test = require('tap').test;\nvar RenderedTarget = require('../../src/sprites/rendered-target');\nvar Sprite = require('../../src/sprites/sprite');\n\ntest('clone effects', function (t) {\n // Cr...
javascript
chosen
[ { "from": "system", "value": "Javascript: Test with a simplified expression\n" }, { "from": "human", "value": "function setAriaCurrent() {\n\tvar title = document.title.trim();\n\tif title === \"Comunidad hispanohablante de NVDA\") {\n\t\tdocument.getElementById(\"inicio\".setAttribute(\"aria-cu...
javascript
chosen
[ { "from": "system", "value": "Add more paths to jest ignore\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n coveragePathIgnorePatterns: ['/node_modules/', '<rootDir>/packages/react-native-web/src/vendor/'],\n modulePathIgnorePatterns: ['<rootDir>/packages/react-native-...
javascript
chosen
[ { "from": "system", "value": "Add columns to prop tree\n" }, { "from": "human", "value": "/**\n * @class NetProfile.tree.Property\n * @extends Ext.tree.Panel\n */\nExt.define('NetProfile.tree.Property', {\n\textend: 'Ext.tree.Panel',\n\talias: 'widget.propertytree',\n\trequires: [\n\t\t'NetProfi...
javascript
chosen
[ { "from": "system", "value": "CHANGE start command for RN to allow --quiet\n" }, { "from": "human", "value": "#!/usr/bin/env node\n/* eslint-disable no-console */\nimport path from 'path';\nimport program from 'commander';\nimport Server from '../server';\n\nprogram\n .option('-h, --host <host>...
javascript
chosen
[ { "from": "system", "value": "Fix detection classes to support workers (no head, body document etc)\n" }, { "from": "human", "value": "/*\n===============================================================================================\n\n \tUnify Project\n\n\t\tHomepage: unify-project.org\n\t...
javascript
chosen
[ { "from": "system", "value": "Fix Unexpected 'else' after 'return' (no-else-return)\n" }, { "from": "human", "value": "'use strict';\n\nvar AblySubscriber = function AblySubscriber(options) {\n this.test = options.test;\n if (options.hasOwnProperty('variant')) {\n this.variant = opt...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix invoking possibly null function in destroy\n" }, { "from": "human", "value": "'use strict';\n\nvar InstallFlow = require('../elements/install-flow.js');\n\nvar Installation = class {\n constructor(variant, title) {\n this.flow = new InstallFlow(variant...
javascript
chosen
[ { "from": "system", "value": "Fix unable to load react-dom/server module\n" }, { "from": "human", "value": "const { join } = require(\"path\");\nconst plugins = require(\"./plugins\");\nconst config = require(\"config\");\n\nmodule.exports = plugins({\n assetPrefix: config.assetPrefix,\n distD...
javascript
chosen
[ { "from": "system", "value": "Improve CSS elements clean up script\n" }, { "from": "human", "value": "/*\n * Clean up unnecessary elements from 'Sign In' path based pages.\n */\n(function (d) {\n\n d.querySelector(\".header_nav\").style.display = 'none';\n\n d.querySelector(\"#page_content...
javascript
chosen
[ { "from": "system", "value": "Remove vet check for desktop notifications in AppTokenUtil.\n" }, { "from": "human", "value": "const AppTokenUtil = {\n getAppTokensBasedOnQuery: getAppTokensBasedOnQuery\n};\n\nfunction getAppTokensBasedOnQuery(query, desktopAppId) {\n let userDisabledMap = new M...
javascript
chosen
[ { "from": "system", "value": "Fix JSDoc references to class name" }, { "from": "human", "value": "/**\n * Copyright (C) 2018 Glayzzle (BSD3 License)\n * @authors https://github.com/glayzzle/php-parser/graphs/contributors\n * @url http://glayzzle.com\n */\n\"use strict\";\n\nconst Node = require(...
javascript
chosen
[ { "from": "system", "value": "Add global vars to server-side test helper\n\nSome global properties are required by modules, so we need to set them to default values in the setup for server-side tests.\n" }, { "from": "human", "value": "var requirejs = require('requirejs');\nvar path = require('p...
javascript
chosen
[ { "from": "system", "value": "Increase perfs when loading a product's page" }, { "from": "human", "value": "'use strict';\n\nvar set_taxon_select = function(selector){\n if ($(selector).length > 0) {\n $(selector).select2({\n placeholder: Spree.translations.taxon_placeholder,\n mul...
javascript
chosen
[ { "from": "system", "value": "Remove axios and unused function\n\n" }, { "from": "human", "value": "import axios from 'axios';\n\nexport const liveRootUrl = 'https://bolg-app.herokuapp.com/posts/';\n\nexport const states = {\n LOADING: 0,\n EDITING: 1,\n SAVED: 2,\n ERROR: 3,\n EDITING_OFFL...
javascript
chosen
[ { "from": "system", "value": "Hide headings with no visible items when filtering\n" }, { "from": "human", "value": "(function ($) {\n jQuery.expr[':'].contains = function (obj, index, meta){\n return (obj.textContent || obj.innerText || \"\").toUpperCase().indexOf(meta[3].toUpperCase()) >= 0...
javascript
chosen
[ { "from": "system", "value": "Check that this.ticksToDowngrade is defined\n" }, { "from": "human", "value": "\nStructureController.prototype.isTimingOut = function () {\n if (!this.level || !CONTROLLER_DOWNGRADE[this.level]) {\n return false\n }\n return CONTROLLER_DOWNGRADE[this.level] - ...
javascript
chosen
[ { "from": "system", "value": "Remove search bar when project page is launched\n\nExplicitly remove the search bar when the project page is launched. Some\npages remove this element when the page is navigated away from, but this\ntechnique does not work for the splash page. I believe this is because\nit is a...
javascript
chosen
[ { "from": "system", "value": "Use toLowerCase instead of _.camelCase\n" }, { "from": "human", "value": "import _ from 'lodash';\nimport requireDirectory from 'require-directory';\n\nfunction renamer(name) {\n return _.camelCase(name);\n}\n\nexport default requireDirectory(module, __dirname, { r...
javascript
chosen
[ { "from": "system", "value": "Rename \"not-italic\" utility to \"roman\"\n" }, { "from": "human", "value": "import defineClasses from '../util/defineClasses'\n\nexport default function() {\n return defineClasses({\n 'italic': { 'font-style': 'italic' },\n 'not-italic': { 'font-style': 'no...
javascript
chosen
[ { "from": "system", "value": "Change default API port to 8000\n" }, { "from": "human", "value": "\"use strict\";\n\nrequire('babel-register')({ only: /src/ });\n\nvar request = require('request')\n , server = require('../src/server')\n , apiURL = process.env.EDITORSNOTES_API_URL || 'http://127...
javascript
chosen
[ { "from": "system", "value": "Select form part accepts any type of value as option\n" }, { "from": "human", "value": "import React from 'react'\nconst el = React.createElement\n\nexport const selectInput = function ({ options, multiple = false, nullLabel=\"\" }) {\n if (!multiple) options = [['...
javascript
chosen
[ { "from": "system", "value": "Check if \"body\" on \"response\" is actually defined before accessing it\n\nCatched this error when testing with a dummy API key.\r\n```\r\nTypeError: Cannot read property 'errors' of undefined\r\n at ResponseError.toString (.../node_modules/@sendgrid/helpers/classes/respon...
javascript
chosen
[ { "from": "system", "value": "Support for Mousedetectors connected in Verisure systems\n" }, { "from": "human", "value": "import defaultIcon from './default-icon';\nimport domainIcon from './domain-icon.js';\nimport hass from './home-assistant-js-instance';\n\nconst { util: { temperatureUnits } ...
javascript
chosen
[ { "from": "system", "value": "Improve error message for options validation\n" }, { "from": "human", "value": "'use strict';\n\n\nconst { validate } = require('../validation');\n\n\n// Validation for main options\nconst validateOptions = function ({ options }) {\n const schema = {\n type: 'ob...
javascript
chosen
[ { "from": "system", "value": "Add tests for Trie add, search, and find methods\n" }, { "from": "human", "value": "var Trie = require('../app/trie');\n\ndescribe('Trie', function() {\n var trie;\n\n beforeEach(function() {\n trie = new Trie();\n });\n\n it('should be an object', function()...
javascript
chosen
[ { "from": "system", "value": "Test passing in custom endpoint array\n" }, { "from": "human", "value": "import test from 'ava'\nimport Onionoo from '../'\n\ntest('Onionoo is a function', t => {\n t.is(typeof Onionoo, 'function')\n})\n\ntest('Onionoo cannot be invoked without \\'new\\'', t => {\n...
javascript
chosen
[ { "from": "system", "value": "Use compatible min Firefox version\n" }, { "from": "human", "value": "const path = require('path');\nconst fs = require('fs');\n// eslint-disable-next-line\nconst manifest = require('../dist/chrome/manifest.json');\n\nfs.writeFileSync(\n path.join(__dirname, '../...
javascript
chosen
[ { "from": "system", "value": "Fix panel close when click on it\n\n" }, { "from": "human", "value": "import Component from '@ember/component';\n\nexport default Component.extend({\n displayedColumnsPanel: false,\n hasToggleableColumns: false,\n\n handleClick(event) {\n if (event.target.clos...
javascript
chosen
[ { "from": "system", "value": "Allow to pass an `onClick` action that will be invoked with the original event\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport Droppable from 'ember-drag-drop/mixins/droppable';\n\nexport default Ember.Component.extend(Droppable, {\n className...
javascript
chosen
[ { "from": "system", "value": "Add callback schema for Foursquare authentication\n" }, { "from": "human", "value": "const Joi = require('joi')\n\nexports.create = Joi.object({\n location: Joi.object({\n latitude: Joi.number().required(),\n longitude: Joi.number().required()\n }),\n place...
javascript
chosen
[ { "from": "system", "value": "Add line to not translate the lyche datepicker\n" }, { "from": "human", "value": "/* Datepicker for lyche reservation form */\n\n$(function() {\n $('#lyche-datepicker').datepicker( {\n monthNames: [ \"Januar\", \"Februar\", \"Marts\", \"April\", \"Maj\", \...
javascript
chosen
[ { "from": "system", "value": "Revert \"Export with UMD as 'clappr' and 'Clappr'\"\n" }, { "from": "human", "value": "/* eslint-disable no-var */\nvar path = require('path')\nvar webpack = require('webpack')\nvar Clean = require('clean-webpack-plugin')\n\nvar webpackConfig = require('./webpack-ba...
javascript
chosen
[ { "from": "system", "value": "Use webpack plugins and constants for environment\n" }, { "from": "human", "value": "\"use strict\";\n\nmodule.exports = {\n entry: \"./home\",\n output: {\n filename: \"build.js\",\n library: \"home\"\n },\n\n watch: true,\n\n watchOptions: {\n aggreg...
javascript
chosen
[ { "from": "system", "value": "Remove trailing comma. Thanks standardjs 😤" }, { "from": "human", "value": "const path = require('path')\n\nmodule.exports = {\n entry: './docs/App.jsx',\n output: {\n filename: './docs/bundle.js'\n },\n devServer: {\n inline: true,\n contentBase: path...
javascript
chosen
[ { "from": "system", "value": "Use correct value from status.\n" }, { "from": "human", "value": "// Set up necessary events and startup stuff\n$(document).ready(function() {\n\n $.when(QueueSong.findAll(), Status.findOne()).then(function(queueSongs, status) {\n\n window.mpdClient = {\n s...
javascript
chosen
[ { "from": "system", "value": "Add editMode event and helper\n" }, { "from": "human", "value": "Template.leanCanvas.created = function () {\n // Get reference to template instance\n const instance = this;\n\n // Add edit mode reactive variable\n const editMode = new ReactiveVar(false);\n}\n\n...
javascript
chosen
[ { "from": "system", "value": "Set absolute url for assets.\n" }, { "from": "human", "value": "/*eslint-disable no-var*/\nvar getConfig = require(\"hjs-webpack\");\nvar config = require(\"./presentation/config\");\n\nvar webpackConfig = getConfig({\n in: \"./index.jsx\",\n out: \"dist\",\n cle...
javascript
chosen
[ { "from": "system", "value": "Disable the style checking for now\n\n" }, { "from": "human", "value": "'use strict';\n\nvar path = require('path');\nvar webpack = require('webpack');\nvar autoprefixer = require('autoprefixer');\nvar ExtractTextPlugin = require(\"extract-text-webpack-plugin\");\nv...
javascript
chosen
[ { "from": "system", "value": "Exclude invalid file from validation\n" }, { "from": "human", "value": "var path = require('path')\n\nmodule.exports = {\n entry: './index.js',\n target: 'node',\n output: {\n path: path.join(__dirname),\n filename: 'dist.js'\n },\n module: {\n loaders...
javascript
chosen
[ { "from": "system", "value": "Enable country/province borders and labels\n" }, { "from": "human", "value": "/*\n** Copyright 2013 Google Inc.\n**\n** Licensed under the Apache License, Version 2.0 (the \"License\");\n** you may not use this file except in compliance with the License.\n** You may...
javascript
chosen
[ { "from": "system", "value": "Fix typo in website script.\n" }, { "from": "human", "value": "/*\n * Copyright 2011 Twitter, Inc.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a cop...
javascript
chosen
[ { "from": "system", "value": "Add geocode delay to prevent DDOS\n" }, { "from": "human", "value": "class GeocodeAPI {\n constructor(geocodeCache) {\n this.cache = geocodeCache;\n }\n\n async getGeocode(cityName, postCode) {\n const location = this.makeLocation(cityName, po...
javascript
chosen