conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add authentication hook to all methods (except create)\n" }, { "from": "human", "value": "const { authenticate } = require('@feathersjs/authentication').hooks;\n\nconst { hashPassword, protect } = require('@feathersjs/authentication-local').hooks;\n\nconst gravatar ...
javascript
chosen
[ { "from": "system", "value": "fix(build): Fix build by reverting changes\n" }, { "from": "human", "value": "module.exports = {\n assets: {\n files: [{\n expand: true,\n dot: true,\n dest: '<%= distDir %>',\n src: [\n '<%= appDi...
javascript
chosen
[ { "from": "system", "value": "Add import of location reducer\n" }, { "from": "human", "value": "import { combineReducers } from 'redux';\n\nimport { TemperatureBreachConfigReducer } from './TemperatureBreachConfigReducer';\nimport { SensorReducer } from './SensorReducer';\n\nexport const Entitie...
javascript
chosen
[ { "from": "system", "value": "Fix tests for correct environment config\n" }, { "from": "human", "value": "/*global $, assert, trigger*/\n\n'use strict';\n\ndescribe('Albums create dialog', function () {\n this.timeout(20000);\n\n it('should create new album', function (done) {\n var user;\n...
javascript
chosen
[ { "from": "system", "value": "Add custom strapiID type to yup\n" }, { "from": "human", "value": "'use strict';\n\nconst { yup } = require('strapi-utils');\n\nconst strapiID = yup.lazy(value =>\n typeof value === 'number' ? yup.number().integer() : yup.string()\n); // https://github.com/jquense/...
javascript
chosen
[ { "from": "system", "value": "Fix ActionHandler tests (support of Factory)\n" }, { "from": "human", "value": "var gRex = require('../../index.js'),\n Transaction = require(\"../../src/transaction/transaction\"),\n handlers = require(\"../../src/transaction/actionhandler\"),\n Element = ...
javascript
chosen
[ { "from": "system", "value": "[dist] Use simple format to better show that humanReadableUnhandledException is now the default message format.\n" }, { "from": "human", "value": "'use strict';\n\nconst winston = require('../');\n\n//\n// TODO: THIS IS BROKEN & MUST BE FIXED BEFORE 3.0\n// This sho...
javascript
chosen
[ { "from": "system", "value": "Include current playback rate in prompt.\n\nPrevent setting playback rate to 0." }, { "from": "human", "value": "var media = document.querySelectorAll('video, audio');\nvar rate = prompt('Speed?','');\nArray.prototype.forEach.call(media, function(player) {\n playe...
javascript
chosen
[ { "from": "system", "value": "Add coordinates column to table\n" }, { "from": "human", "value": "module.exports = (sequelize, Sequelize) => {\n const Comment = sequelize.define('comments', {\n id: {\n type: Sequelize.INTEGER,\n primaryKey: true,\n allowNull: false,\n auto...
javascript
chosen
[ { "from": "system", "value": "Use host headers to proxy request\n" }, { "from": "human", "value": "var http = require('http');\n\n\nhttp.createServer(function (req, res) {\n var proxyRequest = http.request({\n 'hostname': 'www.google.com'\n\n }, function(proxyResponse) {\n\n delete proxy...
javascript
chosen
[ { "from": "system", "value": "Remove back auth initialize function to make test work\n" }, { "from": "human", "value": "import CustomAuthenticator from '../authenticators/custom';\nimport CustomAuthorizer from '../authorizers/custom';\n\nexport default {\n name: 'authentication',\n before: 'si...
javascript
chosen
[ { "from": "system", "value": "Use dev env while building for production\n\nThis yields better errors.\n" }, { "from": "human", "value": "'use strict';\nvar fs = require('fs');\nvar path = require('path');\nvar merge = require('webpack-merge');\nvar webpack = require('webpack');\n\nmodule.exports...
javascript
chosen
[ { "from": "system", "value": "Fix error in recent rebase\n" }, { "from": "human", "value": "\"use strict\";\n\nannotationApp.service('morphRetriever', function($http) {\n this.getData = function(callback) {\n var result;\n var request = $.ajax({\n url: './static/analyses.json',\n ...
javascript
chosen
[ { "from": "system", "value": "Create url from user input\n" }, { "from": "human", "value": "const request = require('request');\nconst yargs = require('yargs');\n\n// 68 Studencheskaya street Engels\n\nconst argv = yargs\n .options({\n a: {\n demand: true,\n alias: 'address',\n ...
javascript
chosen
[ { "from": "system", "value": "Test for render without crashing with empty function.\n" }, { "from": "human", "value": "/* eslint prefer-arrow-callback: 0, func-names: 0, 'react/jsx-filename-extension': [1, { \"extensions\": [\".js\", \".jsx\"] }] */\n\nimport React from 'react';\nimport assert f...
javascript
chosen
[ { "from": "system", "value": "Use tabs to split request and response.\n" }, { "from": "human", "value": "const React = require('react')\nconst {Card, CardActions, CardHeader, CardText} = require('material-ui/Card')\nconst FlatButton = require('material-ui/FlatButton').default\n\n/* eslint-disabl...
javascript
chosen
[ { "from": "system", "value": "Stop loading the notifications every time\n" }, { "from": "human", "value": "import notificationActions from '../flux/notificationActions'\nwindow.addEventListener('error', notificationActions.logError)\nnotificationActions.startProgress(1, 'Testing Progress Bars', ...
javascript
chosen
[ { "from": "system", "value": "Drop data on server relaunch\n" }, { "from": "human", "value": "/**\n * Default model configuration\n * (sails.config.models)\n *\n * Unless you override them, the following properties will be included\n * in each of your models.\n *\n * For more info on Sails model...
javascript
chosen
[ { "from": "system", "value": "Add ajax call for upvotes\n" }, { "from": "human", "value": "$(document).ready(function() {\n\n $(\"a.up-vote-answer\").click(function(event) {\n event.preventDefault();\n console.log(\"we here\");\n }\n );\n\n});" }, { "from": "gpt", "valu...
javascript
chosen
[ { "from": "system", "value": "Simplify test data creation in dummy app\n" }, { "from": "human", "value": "import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\nexport default class FilteredRoute extends Route {\n @service store;\n\n async beforeModel...
javascript
chosen
[ { "from": "system", "value": "Add properties width and height to rectngle\n" }, { "from": "human", "value": "var rectangle = (function (parent) {\n var rectangle = Object.create(parent);\n\n Object.defineProperty(rectangle, 'init', {\n value: function (xCoordinate, yCoordinate, fill...
javascript
chosen
[ { "from": "system", "value": "Use try/catch for initiating WebSocket\n" }, { "from": "human", "value": "import Socket from './socket'\nimport { actions } from '../store/actions'\nimport {\n supportsWebSockets,\n supportsGetUserMedia\n} from '../utils/feature-detection'\n\nconst {\n setToken,\...
javascript
chosen
[ { "from": "system", "value": "Disable passwordless sms mode for now\n" }, { "from": "human", "value": "import ContainerManager from './container_manager';\nimport { LockModes } from '../control/constants';\nimport renderCrashed from '../crashed/render';\nimport renderPasswordlessEmail from '../p...
javascript
chosen
[ { "from": "system", "value": "Update Marbles.State: Add willUpdate/didUpdate hooks\n" }, { "from": "human", "value": "//= require ./core\n\n(function () {\n\"use strict\";\n\n/*\n * State object mixin\n *\n * Requires Object `state` and Array `__changeListeners` properties\n */\n\nMarbles.State ...
javascript
chosen
[ { "from": "system", "value": "Correct require to point to models/game-info.js.\n" }, { "from": "human", "value": "var GameInfo = require('module');\n\n'use stricts';\n\n/*\n * Render th first page\n */\n exports.index = function(req, res){\n res.render('index'{\n user : req.user || null\n...
javascript
chosen
[ { "from": "system", "value": "Make site be more responsive to all changes to input box\n" }, { "from": "human", "value": "var maxLength = 20;\nvar pendingRequest = undefined;\n\nfunction updateResults(e) {\n if (e.which === 0) {\n return;\n }\n var query = $(\"#query\").val();\n if (pen...
javascript
chosen
[ { "from": "system", "value": "Work on placing pins on map\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport {\n AppRegistry,\n StyleSheet,\n Text,\n View,\n Navigator,\n TabBarIOS,\n Dimensions,\n Image,\n TouchableHighlight\n} from 'react-native';\n\n...
javascript
chosen
[ { "from": "system", "value": "Disable logging while running tests\n" }, { "from": "human", "value": "var _ = require('underscore');\n\nmodule.exports = function(opts) {\n \n var config = {\n base_url: '/database/:dbname/table/:table',\n grainstore: {datasource: global.environ...
javascript
chosen
[ { "from": "system", "value": "Add workaround to display DB error log.\n" }, { "from": "human", "value": "import { UniqueViolationError } from 'objection-db-errors'\nimport { FeathersError, Conflict, GeneralError } from '@feathersjs/errors'\n\nconst errorHandler = (ctx) => {\n if (!ctx.error) {\...
javascript
chosen
[ { "from": "system", "value": "Add separator in logfile and application start time\n" }, { "from": "human", "value": "'use strict'\n\nconst config = require('./config')\nconst db = require('./db')\nconst app = require('../http/app')\n\ndb.init(config.dbUrl, 'shortlinks').then(() => {\n app.liste...
javascript
chosen
[ { "from": "system", "value": "Add better visible subarea colors\n" }, { "from": "human", "value": "'use strict';\n\n/** @type {import('sequelize-cli').Migration} */\nmodule.exports = {\n async up(queryInterface, Sequelize) {\n queryInterface.bulkInsert(\"Subareas\", [{\n id: 1,\n n...
javascript
chosen
[ { "from": "system", "value": "Use API Deep Merge in all w4t\n" }, { "from": "human", "value": "/**\n * Copyright (c) 2014 by Center Open Middleware. All Rights Reserved.\n * Titanium Appcelerator 3.3.0GA\n * Licensed under the terms of the Apache Public License\n * Please see the LICENSE include...
javascript
chosen
[ { "from": "system", "value": "Fix The bug in createCategory, Now can save subcategories with no problem\n" }, { "from": "human", "value": "/**\n * Created by meysamabl on 11/1/14.\n */\n\n$(document).ready(function () {\n// $('#picture').change(function () {\n// $(\"#catForm\").ajaxFor...
javascript
chosen
[ { "from": "system", "value": "Put subscription on autorun in postPage.\n" }, { "from": "human", "value": "Template.postPage.onCreated( () => {\n var t = Template.instance();\n t.subscribe('listForId',FlowRouter.getParam('id'));\n});\n\nTemplate.postPage.helpers({\n post: () => {\n ...
javascript
chosen
[ { "from": "system", "value": "Use this.emitChange() instead of old API" }, { "from": "human", "value": "/**\n * Copyright 2014, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\n'use strict';\nvar createStore = require('fluxible-app...
javascript
chosen
[ { "from": "system", "value": "Add a default value to resolve async helper\n\nThis allows passing an array or null in to ensure some expected value\nwill exist when this is `@use`ed in another component and alleviating the\nneed for an interim getter.\n" }, { "from": "human", "value": "import { t...
javascript
chosen
[ { "from": "system", "value": "Add tests: load(), dismiss(), notify()\n" }, { "from": "human", "value": "(function() {\n\n 'use strict';\n\n describe('angular-feedback', function() {\n\n beforeEach(module('angular-feedback'));\n\n /*\n var feedbackProvider;\n\n b...
javascript
chosen
[ { "from": "system", "value": "Remove -y option from zip\n" }, { "from": "human", "value": "import 'instapromise';\n\nimport fs from 'fs';\nimport logger from 'gulplog';\nimport path from 'path';\nimport spawnAsync from '@exponent/spawn-async';\n\nconst paths = {\n template: path.resolve(__dirna...
javascript
chosen
[ { "from": "system", "value": "Add environment variable check for DEVURL\n" }, { "from": "human", "value": "const webpack = require('webpack');\nconst BrowserSyncPlugin = require('browsersync-webpack-plugin');\n\nconst config = require('./config');\n\nmodule.exports = {\n output: {\n pathinfo...
javascript
chosen
[ { "from": "system", "value": "Add foundational config, for high priority config.\n\nThis allows setup such as typescript to always be in front,\nremoving the potential for user errors.\n" }, { "from": "human", "value": "var Path = require('path')\nglobal.CONFIG = require('./index.json')\nCONFIG....
javascript
chosen
[ { "from": "system", "value": "Update example to include callback\n" }, { "from": "human", "value": "var temp = require('../lib/temp'),\n fs = require('fs'),\n util = require('util'),\n exec = require('child_process').exec;\n\nvar myData = \"foo\\nbar\\nfoo\\nbaz\";\n\ntemp.open('mypre...
javascript
chosen
[ { "from": "system", "value": "Update example with class and style attributes\n" }, { "from": "human", "value": "import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport YoutubeEmbedVideo from 'youtube-embed-video';\n\nReactDOM.render(<YoutubeEmbedVideo size=\"large\" videoId=\"R...
javascript
chosen
[ { "from": "system", "value": "Document that the test:features Gulp task also supports tags.\n" }, { "from": "human", "value": "// Use the gulp-help plugin which defines a default gulp task\n// which lists what tasks are available.\nvar gulp = require('gulp-help')(require('gulp'));\n\n// Sequenti...
javascript
chosen
[ { "from": "system", "value": "Make actions and properties module conform to plugin-api\n" }, { "from": "human", "value": "const Plugin = require('imdone-api')\nconst _path = require('path')\nconst { statSync } = require('fs')\n\nmodule.exports = class ExtensionPlugin extends Plugin {\n construc...
javascript
chosen
[ { "from": "system", "value": "Use auth.credentials.user for policy checks\n" }, { "from": "human", "value": "const Boom = require('boom');\n\nexports.register = function (server, options, next) {\n if (!options) options = {};\n const policies = options.policies || [];\n\n // General che...
javascript
chosen
[ { "from": "system", "value": "Fix implementation for SpiderMonkey (firefox)\n" }, { "from": "human", "value": "function render(world) {\n var rendering = '';\n for (var y = world.boundaries()['y']['min']; y <= world.boundaries()['y']['max']; y++) {\n for (var x = world.boundaries()['x']['mi...
javascript
chosen
[ { "from": "system", "value": "Check if checkbox is not checked.\n" }, { "from": "human", "value": "import WrapperBuilder from './wrapper';\nimport { shallow, mount } from 'enzyme';\nimport React from 'react';\n\nconst CheckedFixture = () => (\n <input type=\"checkbox\" defaultChecked value=\"co...
javascript
chosen
[ { "from": "system", "value": "WIP: Refactor function to return a promise instead of a callback\n\nReplaced creation of custom mongo connection with existing mongoose connection object\n\nOHM-762\n" }, { "from": "human", "value": "\nimport mongodb from 'mongodb'\nimport { config } from './config'...
javascript
chosen
[ { "from": "system", "value": "Fix storybook story lint errors\n" }, { "from": "human", "value": "import React from 'react';\nimport { storiesOf } from '@storybook/react';\nimport withReadme from 'storybook-readme/with-readme';\nimport Readme from './readme.md';\n\nimport Accordion from './Accord...
javascript
chosen
[ { "from": "system", "value": "Add a cronjob that runs every minute but dont start it yet\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Module dependencies.\n */\nvar cron = require('cron'),\n\tpingdom = require('pingdom-api');\n\nexports.init = function(){\n\tconsole.log('initttttt...
javascript
chosen
[ { "from": "system", "value": "Allow selecting elements for animation\n" }, { "from": "human", "value": "var $ = require('wetfish-basic');\n\nvar animate =\n{\n status: false,\n\n init: function()\n {\n \n },\n\n start: function()\n {\n $('.workspace').addClass('hi...
javascript
chosen
[ { "from": "system", "value": "Fix BEM preset; ignoreComments --> false\n" }, { "from": "human", "value": "var _ = require('lodash');\n\n/**\n * Sets options\n * @param {Object} [options]\n * @param {String[]} [options.ignoreAttributes]\n * @param {String[]} [options.compareAttributesAsJSON]\n * ...
javascript
chosen
[ { "from": "system", "value": "Index for attachment filepath to prevent doubles\n" }, { "from": "human", "value": "module.exports = [\n {\n collection: 'attachments',\n spec: { key: 1 },\n options: { unique: true }\n },\n {\n collection: 'entries',\n spec: { locationId: 1 },\n ...
javascript
chosen
[ { "from": "system", "value": "Use identity instead of global id.\n" }, { "from": "human", "value": "/**\n * DashboardController\n *\n * @description :: Server-side logic for managing Dashboards\n * @help :: See http://links.sailsjs.org/docs/controllers\n */\n\nmodule.exports = {\n inde...
javascript
chosen
[ { "from": "system", "value": "Add noop connect* methods to the test backend\n" }, { "from": "human", "value": "class TestBackend {\n constructor(manager) {\n this.actions = manager.getActions();\n }\n\n setup() {\n this.didCallSetup = true;\n }\n\n teardown() {\n this.didCallTeardo...
javascript
chosen
[ { "from": "system", "value": "Revert text builder to 'pre'\n" }, { "from": "human", "value": "export function textViewBuilder(node) {\n var view = document.createElement(\"div\");\n var textView = document.createElement(\"div\");\n textView.style.whiteSpace = \"pre-wrap\";\n\n view.appendChi...
javascript
chosen
[ { "from": "system", "value": "Fix prevent multipass inside customizer\n" }, { "from": "human", "value": "'use strict';\n\nimport emptyFunction from '../utils/empty-function';\n\nfunction initializeShopifyPlatform(context, currentConfig, hull) {\n\n const { customerId, accessToken, callbackUrl }...
javascript
chosen
[ { "from": "system", "value": "Add a simple version of strike\n" }, { "from": "human", "value": "const BasicCard = require('../BasicCard');\n\nclass Strike extends BasicCard {\n\tconstructor(suit, number) {\n\t\tsuper('strike', suit, number);\n\t}\n}\n\nmodule.exports = Strike;\n" }, { "f...
javascript
chosen
[ { "from": "system", "value": "Fix issue dealing with empty responses in response interceptor" }, { "from": "human", "value": "'use strict';\n\nangular.module( 'ngynServerConnection' )\n .value( 'defaultResponseInterceptors', {\n jsonNetStripper: function( hubName, methodName, response ) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add machine name to heap dump file name\n" }, { "from": "human", "value": "/**\n * Created by ronyadgar on 29/11/2015.\n */\n\nvar heapdump = require('heapdump');\nvar logger = require('./logger/logger')(module);\nvar fs = require('fs');\nvar config = require('./../...
javascript
chosen
[ { "from": "system", "value": "Move audio check code for another pull request\n" }, { "from": "human", "value": "/*\n * Copyright 2020 Google LLC\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 ...
javascript
chosen
[ { "from": "system", "value": "Clean up using servers listening and error events\n" }, { "from": "human", "value": "'use strict';\n\nconst { EventEmitter } = require('events');\n\nconst logger = require('./logger')('server-impl.js');\nconst migrator = require('../migrator');\nconst getApp = requi...
javascript
chosen
[ { "from": "system", "value": "Change custom stroke override method\n\nPeeking into the fabric source, it looks like the `_stroke` method we're\noverriding in the `highlighted_stroke` mixin has been renamed to\n`_renderStroke`. Making sure we override the correct method, we start\nseeing our customized strok...
javascript
chosen
[ { "from": "system", "value": "Correct check for undefined variable\n\nThe code was comparing the result of `typeof` with a variable named `undefined`\r\n\r\nAs typeof returns a string it should compare to `'undefined'`" }, { "from": "human", "value": "var nullEvents = require('./nullEvents.js');...
javascript
chosen
[ { "from": "system", "value": "Fix assetManager not being instantiated\n" }, { "from": "human", "value": "'use strict';\n\nvar assert = require('assert')\nvar handlebars = require('handlebars')\nvar cssInjector = require('../wrappers/cssInjector')\nvar assetManager = require('./assetMana...
javascript
chosen
[ { "from": "system", "value": "Switch back to ES5 variable syntax." }, { "from": "human", "value": "document.addEventListener(\"turbolinks:load\", function() {\n function inventoryButtonClickHandler(e) {\n e.preventDefault();\n let formInputs = document.getElementById('form-inputs');\n ...
javascript
chosen
[ { "from": "system", "value": "Add support for retina images\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport md5 from 'md5';\n\nexport default Ember.Component.extend({\n tagName: 'img',\n attributeBindings: ['src', 'alt', 'title'],\n classNames: ['gravatar-image'],\n siz...
javascript
chosen
[ { "from": "system", "value": "Add lcov report to buster-istanbul coverage.\n" }, { "from": "human", "value": "module.exports.unit = {\n environment: 'node',\n rootPath: process.cwd(),\n sources: [\n 'lib/**/*.js'\n ],\n tests: [\n 'test/**/*.js'\n ],\n extensions: [\n require('bu...
javascript
chosen
[ { "from": "system", "value": "tests/index: Use Polly.js instead of Pretender\n" }, { "from": "human", "value": "import { module, test } from 'qunit';\nimport { setupApplicationTest } from 'ember-qunit';\nimport { visit, currentURL } from '@ember/test-helpers';\n\nimport { setupPretender } from '...
javascript
chosen
[ { "from": "system", "value": "Enable allowTaggedTemplates options in no-unused-expressions rule\n\n" }, { "from": "human", "value": "\nmodule.exports = {\n extends: [\n 'eslint-config-airbnb-base/rules/best-practices'\n ],\n rules: {\n // Enforce that class methods use `this`\n // ht...
javascript
chosen
[ { "from": "system", "value": "Fix deleting file attachments without a draft.\n\nFile attachment deletion was broken without a draft, since destroy()\ndoesn't call ready() first, causing the draft to never be created. Now\ndestroy() does an ensureCreated() on the draft.\n" }, { "from": "human", "...
javascript
chosen
[ { "from": "system", "value": "Use clearer icon for camera switching in MediaDevices experiment\n" }, { "from": "human", "value": "import React from 'react';\nimport Icon from '../../../Icon';\n\nconst MediaDevicesControls = ({ snaps, areMultipleVideoDevices, handleVideoDeviceChange }) => (\n <d...
javascript
chosen
[ { "from": "system", "value": "Revert \"GCW-1826 Disable off canvas scroll\"\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Component.extend({\n\n foundation: null,\n\n currentClassName: Ember.computed(\"className\", function(){\n return this.get(\"clas...
javascript
chosen
[ { "from": "system", "value": "Convert from a promises based callback scheme to a nested callback based scheme to support chrome.\n" }, { "from": "human", "value": "var extURL = chrome.extension.getURL(\"tabs.html\");\n\nfunction openMyPage() {\n\tbrowser.windows.getCurrent({}).then(function(wind...
javascript
chosen
[ { "from": "system", "value": "Add initial implementation of lines\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport * as d3 from 'd3';\n\nclass Drawing extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n drawing: nu...
javascript
chosen
[ { "from": "system", "value": "Use domain name instead of localhost when it's available to make webpack works with local domain names\n" }, { "from": "human", "value": "process.traceDeprecation = true;\nconst path = require('path');\nconst webpack = require('webpack');\nconst WebpackCommon = requ...
javascript
chosen
[ { "from": "system", "value": "Change separator with shadow view on ios\n" }, { "from": "human", "value": "import { Platform, StyleSheet } from 'react-native';\nimport { colors } from '../../styles';\n\nconst styles = StyleSheet.create({\n root: {\n height: 1,\n backgroundColor: colors.gre...
javascript
chosen
[ { "from": "system", "value": "Fix: Use process.env.NODE to find node executable\n" }, { "from": "human", "value": "const fs = require('fs');\nconst path = require('path');\n\nconst exec = require('child_process').exec;\nconst nodepath = process.env._;\nconst version = process.versions.v8;\nconst...
javascript
chosen
[ { "from": "system", "value": "Send language to templates class on constructor\n" }, { "from": "human", "value": "module.exports = function(multiLang){\n\n const MoviePoster = require('./movie-poster')(multiLang);\n\n function selectTemplate(templateName) {\n let template = null;\n\n swit...
javascript
chosen
[ { "from": "system", "value": "Fix return dest stream from pipe\n" }, { "from": "human", "value": "var PassThrough = require('stream').PassThrough\nvar inherits = require('util').inherits\n\nfunction SeriesStream () {\n PassThrough.apply(this, arguments)\n this._current = null\n this._queue = ...
javascript
chosen
[ { "from": "system", "value": "Change requirement to MANAGE SERVER\n" }, { "from": "human", "value": "const Commando = require('discord.js-commando')\n\nmodule.exports =\nclass Command extends Commando.Command {\n constructor(client, info) {\n info.group = 'rover';\n info.guildOn...
javascript
chosen
[ { "from": "system", "value": "Exit when using the default npm registry\n" }, { "from": "human", "value": "var opener = require('opener');\nvar http = require('http');\nvar fs = require('fs');\nvar url = require('url');\nvar exec = require('child_process').execSync;\n\nvar registry = exec('npm co...
javascript
chosen
[ { "from": "system", "value": "Check for iPhone, iPad and iPod\n" }, { "from": "human", "value": "module.exports = {\n\tinit: function() {\n\t\tvar client = this\n\t\tfunction isClient(name) {\n\t\t\tvar agent = window.navigator.userAgent,\n\t\t\t\tindex = agent.indexOf(name)\n\t\t\tif (index < 0...
javascript
chosen
[ { "from": "system", "value": "Call native initialization from js\n" }, { "from": "human", "value": "var bridge = require('vigour-native/lib/bridge')\nvar env = require('vigour-native/lib/env')\n// var name = 'plugin'\nvar id = 'vigour-native-plugin'\nvar supportedPlatforms = [\n 'android',\n '...
javascript
chosen
[ { "from": "system", "value": "Add origin to option setting failure\n" }, { "from": "human", "value": "'use strict'\n\nvar commentMarker = require('mdast-comment-marker')\n\nmodule.exports = commentconfig\n\n// Modify `processor` to read configuration from comments.\nfunction commentconfig() {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove const in strict-mode for 0.10.x.\n" }, { "from": "human", "value": "'use strict'\n\nconst standard = require('standard')\nconst format = require('util').format\nconst assign = require('object-assign')\nconst loaderUtils = require('loader-utils')\n\nmodule.exp...
javascript
chosen
[ { "from": "system", "value": "Fix indention - Remove console.log()" }, { "from": "human", "value": "var through2 = require('through2');\nvar File = require('vinyl');\nvar path = require('path');\n\nmodule.exports = function (filename, baseDir) {\n var ins = through2()\n var out = false\n\n...
javascript
chosen
[ { "from": "system", "value": "Deploy shouldn't work if other tasks fail\n" }, { "from": "human", "value": "var conf = require(\"./server/conf\"),\n app = require(\"./server/app\"),\n log = conf.log;\n\n \n\napp.listen(conf.PORT, function() {\n log.info(\"Server_listening on port %s...
javascript
chosen
[ { "from": "system", "value": "Fix capitalization of included Request module\n" }, { "from": "human", "value": "var debug = require( 'debug' )( 'wpcom-vip' );\nvar request = require( './lib/util/request' );\n\n// Modules\n\n\nfunction WPCOM_VIP( token ) {\n this.req = new Request( th...
javascript
chosen
[ { "from": "system", "value": "Add cli options using commander\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\nconsole.log('Hello World!');" }, { "from": "gpt", "value": "#!/usr/bin/env node\n\n'use strict';\n\nconst program = require('commander');\n\nprogra...
javascript
chosen
[ { "from": "system", "value": "Use a Map to accelerate seen object lookups.\n" }, { "from": "human", "value": "exports.encode = exports.stringify = function (value) {\n var values = [value];\n var table = [];\n\n for (var v = 0; v < values.length; ++v) {\n value = values[v];\n if (value ...
javascript
chosen
[ { "from": "system", "value": "Disable new yellow componentWillMount() lifecycle warnings\n" }, { "from": "human", "value": "import {\n AppRegistry,\n StatusBar,\n} from 'react-native';\n\nimport Finance from './Finance';\n\nStatusBar.setBarStyle('light-content', true);\n\nAppRegistry.registerC...
javascript
chosen
[ { "from": "system", "value": "Add comments and call _super\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nvar imagemin = require('broccoli-imagemin');\n\nmodule.exports = {\n name: 'ember-cli-imagemin',\n\n included: function(app) {\n this.app = app;\n\n var...
javascript
chosen
[ { "from": "system", "value": "Bring in the first function." }, { "from": "human", "value": "var fs = require('fs');\nvar rest = require(__dirname + \"/lib/rest\");\nvar unzip = require(\"unzip2\");\n\nmodule.exports = {\n hello: function() {\n\t return \"Hi!\"\n }\n}" }, { "from": "gp...
javascript
chosen
[ { "from": "system", "value": "Support for recursion and depth\n" }, { "from": "human", "value": "const path = require('path');\nconst fs = require('fs');\n\n\nfunction findFile(cwd, pattern, cb) {\n fs.readdir(cwd, function(err, files){\n if(err) {\n console.log(\"Error in reading dir\"...
javascript
chosen
[ { "from": "system", "value": "Refactor to use a regex pattern that trims the URL and recognizes\nenclosing single/double quotes.\n" }, { "from": "human", "value": "\"use strict\";\nconst pattern = /^\\s*(\\d+)(?:\\s*;(?:\\s*url\\s*=)?\\s*(.+)?)?$/i;\n\n\n\nconst parseMetaRefresh = content =>\n{\...
javascript
chosen
[ { "from": "system", "value": "Use the spread operator instead of lodash/toArray.\n" }, { "from": "human", "value": "'use strict';\n\nconst os = require('os');\nconst toarray = require('lodash/toArray');\nconst defaults = require('lodash/defaults');\nconst map = require('lodash/map');\nconst debu...
javascript
chosen
[ { "from": "system", "value": "Fix error when password is missing\n" }, { "from": "human", "value": "'use strict'\n\nconst tokens = require('../database/tokens')\nconst config = require('../utils/config')\nconst KnownError = require('../utils/KnownError')\nconst ignoreCookie = require('../utils/i...
javascript
chosen
[ { "from": "system", "value": "Add --list option to typical\n\nThe option, when enabled, will print all available recipes from the\ncurrent working directory. It will not run any recipes.\n" }, { "from": "human", "value": "#! /usr/bin/env node\nlet program = require('commander')\nlet configResolv...
javascript
chosen
[ { "from": "system", "value": "Create an Can abstraction layer over the red-black tree api\n" }, { "from": "human", "value": "var can = require('can/util/util');\nvar RBTree = require('./lib/rbtree');\n\n// Add event utilities\ncan.extend(RBTree.prototype, can.event);\n\n// Trigger a \"add\" even...
javascript
chosen