Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
function that makes the wheel spin
function rotateFunction() { var min = 1024; var max = 9999; var deg = Math.floor(Math.random() * (max - min)) + min; document.getElementById('box').style.transform = "rotate(" + deg + "deg)"; var element = document.getElementById('mainbox'); element.classList.remove('animate'); setTimeout(f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function spinWheel() {\n // Rotate the spinner arrow\n rotation = (rotation + 12) % 360;\n arrow.setAttributeNS(null, \"transform\", \"rotate(\"+rotation+\",150,150)\");\n // Highlight the slice the arrow is above\n var newSlice = Math.floor(rotation / (360/numSlices));\n if (newSlice != currentSlice) {\n ...
[ "0.8116148", "0.79659086", "0.7857433", "0.77364004", "0.7736055", "0.7362735", "0.72764486", "0.72577846", "0.7248477", "0.7240495", "0.71729445", "0.7007103", "0.6978493", "0.69162196", "0.6890178", "0.6876866", "0.67674285", "0.6712242", "0.66863275", "0.6683169", "0.66782...
0.0
-1
To perform Server side insert/update/delete operation
function save(url, data, hasAction) { if (!hasAction) { url = url + 'saveChanges'; } return $http.post(url, data).then(function (results) { data = results.data; return data; }).catch(function (ex) { throw ex;...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function serverDB() {\n\n /**\n * GET parameter\n * @type {object}\n */\n var data = prepareData( { del: key }, user, password );\n\n // send dataset key to server interface\n if ( self.socket ) useWebsocket( data, onResponse ); else useHttp( data, onResponse );\...
[ "0.61276644", "0.61202306", "0.5780118", "0.5706676", "0.5695957", "0.56039673", "0.55870914", "0.5522567", "0.5522521", "0.5460507", "0.53991175", "0.5395969", "0.5385457", "0.5377517", "0.53357613", "0.53357613", "0.53292316", "0.5327486", "0.5327486", "0.5327486", "0.53114...
0.0
-1
it inits the image canvas to draw on. It sets up the events to respond to (click, mouse on, etc.) it is also the place where the data is sent via socket.io
async function initCanvas(sckt, imageUrl, oldImage) { socket = sckt; userId = document.getElementById('who_you_are').value; // this isn't working for some reason room = document.getElementById('roomNo').value; selectCamera('Room'); //sets up original values for use for each client let flag = f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initCanvas(sckt, imageUrl) {\n room=roomNo;\n socket = sckt;\n let flag = false,\n prevX, prevY, currX, currY = 0;\n let canvas = $('#canvas');\n let cvx = document.getElementById('canvas');\n let img = document.getElementById('image');\n let ctx = cvx.getContext('2d');\n im...
[ "0.7730842", "0.7094081", "0.68212616", "0.65759593", "0.65700775", "0.64671576", "0.64510214", "0.64255697", "0.63993853", "0.63710254", "0.6361172", "0.6315473", "0.6306193", "0.6290534", "0.6289295", "0.62535805", "0.62452394", "0.61629826", "0.6147932", "0.61470073", "0.6...
0.6808372
3
called when to clear the current canvas for new a drawing
function resetCanvas(){ ctx.clearRect(0, 0, canvas.width, canvas.height); // Restore the transform ctx.restore(); // Clears the specific canvas completely for new drawing }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearCanvas() {\n drawingContext.clearRect(0, 0, canvasWidth, canvasHeight);\n }", "clearCanvas(){\n\t\tthis.ctx.save();\n\t\tthis.ctx.clearRect(0,0,this.canvas.width,this.canvas.height);\n\t\tthis.ctx.restore();\n\t}", "function clearCanvas(){\n\t\t\tctx.clearRect(0, 0, canvas.width, canvas...
[ "0.8589131", "0.8467042", "0.8408486", "0.8390245", "0.8385534", "0.8342247", "0.83386904", "0.83176255", "0.82841426", "0.8277673", "0.827302", "0.82594043", "0.82581776", "0.82549125", "0.8243102", "0.8240989", "0.8237806", "0.82364625", "0.82349086", "0.8230623", "0.820516...
0.0
-1
called when it is required to draw the image on the canvas. We have resized the canvas to the same image size so ti is simpler to draw later
function drawImageScaled(img, canvas, ctx) { let scale = Math.min(canvas.width / img.width, canvas.height / img.height); // get the top left position of the image ctx.clearRect(0, 0, canvas.width, canvas.height); let x = (canvas.width / 2) - (img.width / 2) * scale; let y = (canvas.height / 2) - (im...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {\n // clear the canvas\n that.canvas.width = that.canvas.width;\n\n // check if we have a valid image\n if (that.image.width * that.image.height > 0) {\n context.drawImage(that.image, 0, 0, that.width, that.height);\n } else {\n // center the error icon\n context.draw...
[ "0.73235726", "0.7072685", "0.7072685", "0.70359516", "0.6964817", "0.69553554", "0.68891704", "0.6887662", "0.68747216", "0.68745345", "0.6860673", "0.68423545", "0.6841353", "0.68366957", "0.6824188", "0.6823579", "0.68141407", "0.6803383", "0.6793603", "0.6778748", "0.6775...
0.61690885
67
this is called when we want to display what we (or any other connected via socket.io) draws on the canvas note that as the remote provider can have a different canvas size (e.g. their browser window is larger) we have to know what their canvas size is so to map the coordinates
async function drawOnCanvas(image, ctx, canvasWidth, canvasHeight, prevX, prevY, currX, currY, color, thickness, dashed=false) { //get the ration between the current canvas and the one it has been used to draw on the other computer let ratioX= cvx.width/canvasWidth; let ratioY= cvx.height/canvasHeight; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderCanvas() {\n\t\tif (drawing) {\n\t\t\tctx.moveTo(lastPos.x, lastPos.y);\n\t\t\tctx.lineTo(mousePos.x, mousePos.y);\n\t\t\tctx.stroke();\n\t\t\tlastPos = mousePos;\n\t\t}\n\t}", "function renderCanvas() {\n\t\tif (drawing) {\n\t\t\tctx.moveTo(lastPos.x, lastPos.y);\n\t\t\tctx.lineTo(mousePos.x, mou...
[ "0.6723663", "0.6723663", "0.6723663", "0.6723663", "0.6689109", "0.66520095", "0.66318166", "0.661741", "0.65736616", "0.6551152", "0.6542767", "0.6450827", "0.64051735", "0.6402234", "0.63843316", "0.63594186", "0.6357922", "0.63155", "0.6298244", "0.62909216", "0.62813073"...
0.0
-1
TODO: Create a function that returns a license badge based on which license is passed in If there is no license, return an empty string
function renderLicenseBadge(licenses) { if (licenses === "APM[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)") { return "[APM][![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)"; } else i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function badge(licenseChoice) {\n// badge information\n// TODO: Create a function that returns the license link\nlet licenseString = \" \"\nif (licenseChoice === 'MIT'){\n licenseString = `![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg)`\n}\nelse if (licenseChoice === 'Apache 2.0'){\n ...
[ "0.8846047", "0.87373054", "0.8734679", "0.8721812", "0.87123156", "0.8703444", "0.8692887", "0.8675393", "0.8668157", "0.8668149", "0.86367834", "0.8634979", "0.860582", "0.8603878", "0.86032885", "0.86013776", "0.8588732", "0.8587691", "0.8566995", "0.85597104", "0.8559633"...
0.8452248
39
Function to setup the response markDown skeleton and answer placeholders TODO: Create a function to initialize app
function returnMarkDown(responses) { //Create a destructuring the object for the responses for each user entry const {project, description, installation, usage, licenses, tests, contributing, gitHub, email } = responses; const licenseString = renderLicenseBadge(licenses); return ` # Professional README: $...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n inquirer\n .prompt(questions)\n .then(appData => {\n console.log(appData);\n generateMarkdown(appData);\n });\n}", "function init() {\n // Pass in questions to inquirer.prompt and then grabbing the user answers\n inquirer.prompt(questions).then(response => {\n console.l...
[ "0.6510164", "0.6224284", "0.62182885", "0.6192407", "0.6111945", "0.6046855", "0.6020527", "0.6009776", "0.60045815", "0.5996619", "0.59721255", "0.5958487", "0.5945753", "0.59330505", "0.5893523", "0.5885316", "0.58753145", "0.5871832", "0.5858695", "0.58482987", "0.5847131...
0.0
-1
if value is a function, invoke it with args, otherwise return it as object if value is undefined, will return undefined
function resolveValue(value, ...args) { if (typeof value === "function") { return value(...args); } else { return value; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "tryInvoke(value, ...args) {\n if (value === null) {\n return null;\n }\n else if (value === UNDEF) {\n throw new MonteOptionError('Value not initialized.');\n }\n\n try {\n return isFunc(value) ? value.call(this, ...args) : value;\n }\n catch (e) {\n if (console && console....
[ "0.7101803", "0.6993886", "0.6940897", "0.68156296", "0.6651396", "0.661615", "0.65037775", "0.65037775", "0.65037775", "0.65037775", "0.65037775", "0.65037775", "0.65037775", "0.6498376", "0.6373962", "0.6292613", "0.619484", "0.5970673", "0.59453213", "0.592843", "0.5885674...
0.72190434
0
Taunt. Each of Colonist Chapman's nonStar Alliance neighbors gains, "Reap: Gain 1A."
setupCardAbilities(ability) { this.persistentEffect({ targetController: 'any', match: (card, context) => card.type === 'creature' && context.source.neighbors.includes(card) && !card.hasHouse('staralliance'), effect: ability.effe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getSynergy(){\n return 0.25 + 0.75 * (this.getActivePlayingPlayers().length / 11) ** 2;\n }", "function netPromoterScore(sede, generation) {\n var ratings = data[sede][generation]['ratings'];\n var array = [];\n for (var i = 0 ; i < ratings.length;i++) {\n var promoters = ratings[i]['nps']['promo...
[ "0.59386736", "0.57638013", "0.5651998", "0.56440765", "0.56169707", "0.56032073", "0.5602682", "0.5581515", "0.55715567", "0.5554654", "0.55492634", "0.5508127", "0.5486514", "0.54785466", "0.5474174", "0.5471805", "0.5466742", "0.5464912", "0.5459632", "0.54583615", "0.5443...
0.0
-1
Creates an instance of ExtractionResultController.
constructor() { super(ExtractionResult); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function actionCreateExpeditionCenter() {\n Action.call(this);\n\n this.minimum_elevation = 2;\n\n this.name = \"expedition-center\";\n this.type = \"target\";\n this.target = \"land\";\n this.new_unit_type = 'expedition-center';\n\n this.nextSelection = \"target\";\n this.min_distance = 1;\n this.max_dis...
[ "0.48591992", "0.47696862", "0.4694689", "0.4559893", "0.45272592", "0.44371143", "0.43934274", "0.43888316", "0.43568876", "0.431687", "0.43167228", "0.42791232", "0.42293522", "0.4225217", "0.4185911", "0.4179992", "0.41760424", "0.41551647", "0.41475797", "0.41450208", "0....
0.51233536
0
Return a firebase namespace object. In production, this will be called exactly once and the result assigned to the 'firebase' global. It may be called multiple times in unit tests.
function createFirebaseNamespace() { var apps_ = {}; var factories = {}; var appHooks = {}; // A namespace is a plain JavaScript Object. var namespace = { // Hack to prevent Babel from modifying the object returned // as the firebase namespace. __esModule: true, initi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createFirebaseNamespace() {\n var apps_ = {};\n var factories = {};\n var appHooks = {};\n // A namespace is a plain JavaScript Object.\n var namespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n __esModule: true,\...
[ "0.7396058", "0.7396058", "0.7395023", "0.73853666", "0.73261255", "0.7325864", "0.7325686", "0.7305236", "0.73001844", "0.72946507", "0.72926885", "0.7241198", "0.7237989", "0.7228324", "0.7228324", "0.71012306", "0.70843583", "0.6664544", "0.59658456", "0.591994", "0.585930...
0.7282356
11
Called by App.delete() but before any services associated with the App are deleted.
function removeApp(name) { var app = apps_[name]; callAppHooks(app, 'delete'); delete apps_[name]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async delete() {\r\n const services = Array.from(this.instances.values());\r\n await Promise.all([\r\n ...services\r\n .filter(service => 'INTERNAL' in service) // legacy services\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n ...
[ "0.6529951", "0.63229233", "0.61973095", "0.5973669", "0.5904189", "0.5874682", "0.58137155", "0.58137155", "0.58137155", "0.58137155", "0.58137155", "0.58137155", "0.57807356", "0.5741414", "0.57388115", "0.5734138", "0.57299674", "0.57051516", "0.5684808", "0.56539464", "0....
0.0
-1
Get the App object for a given name (or DEFAULT).
function app(name) { name = name || DEFAULT_ENTRY_NAME; if (!contains(apps_, name)) { error('no-app', { name: name }); } return apps_[name]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function app(name) {\r\n name = name || DEFAULT_ENTRY_NAME;\r\n if (!util.contains(apps, name)) {\r\n throw ERROR_FACTORY.create(\"no-app\" /* NO_APP */, { appName: name });\r\n }\r\n return apps[name];\r\n }", "function app(name) {\r\n name = name || DEFAULT_ENTR...
[ "0.85640514", "0.85640514", "0.85640514", "0.85640514", "0.85640514", "0.8555891", "0.854544", "0.854544", "0.8414088", "0.8414088", "0.8414088", "0.8391061", "0.83666664", "0.81375676", "0.81375676", "0.8126068", "0.8126068", "0.8126068", "0.8126068", "0.80918074", "0.803431...
0.83690786
19
Return an array of all the nondeleted FirebaseApps.
function getApps() { // Make a copy so caller cannot mutate the apps list. return Object.keys(apps_).map(function (name) { return apps_[name]; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getApps() {\r\n return Array.from(_apps.values());\r\n}", "function destroyFirebaseApps() {\n var deletions = _firebase.default.apps.map(function (app) {\n return app.delete();\n });\n Ember.RSVP.all(deletions).then(function () {\n return run(function () {\n // NOOP to delay...
[ "0.6482602", "0.6231479", "0.62088907", "0.62088907", "0.6073565", "0.6062356", "0.60584325", "0.60584325", "0.60584325", "0.60584325", "0.60584325", "0.60584325", "0.6056177", "0.6056177", "0.6056177", "0.6044587", "0.6036813", "0.6036813", "0.6036813", "0.6036813", "0.60368...
0.5984391
35
Register a Firebase Service. firebase.INTERNAL.registerService() TODO: Implement serviceProperties.
function registerService(name, createService, serviceProperties, appHook, allowMultipleInstances) { // Cannot re-register a service that already exists if (factories[name]) { error('duplicate-service', { name: name }); } // Capture the service factory for later service instan...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RegisterService() { }", "function registerService(name, createService, serviceProperties, appHook, allowMultipleInstances) {\n // Cannot re-register a service that already exists\n if (factories[name]) {\n error('duplicate-service', { name: name });\n }\n // Captur...
[ "0.7038455", "0.7001225", "0.7001225", "0.6969678", "0.6955652", "0.6955286", "0.6955286", "0.69436747", "0.6939398", "0.6939398", "0.6939398", "0.69334453", "0.69334453", "0.69001436", "0.6895383", "0.6895383", "0.6863721", "0.68226594", "0.68226594", "0.657825", "0.63509023...
0.68870986
16
Patch the toplevel firebase namespace with additional properties. firebase.INTERNAL.extendNamespace()
function extendNamespace(props) { util.deepExtend(namespace, props); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extendNamespace(props) {\n Object(_firebase_util__WEBPACK_IMPORTED_MODULE_1__[\"deepExtend\"])(namespace, props);\n }", "function extendNamespace(props) {\n Object(_firebase_util__WEBPACK_IMPORTED_MODULE_1__[\"deepExtend\"])(namespace, props);\n }", "function extendNamespace(props)...
[ "0.7601572", "0.7601572", "0.7601572", "0.7601572", "0.75983995", "0.75983995", "0.75533146", "0.7525545", "0.7525545", "0.7478086", "0.74745446", "0.74745446", "0.7244001", "0.66542375", "0.6581733", "0.6581733", "0.6549842", "0.6549842", "0.64319474", "0.64125645", "0.62906...
0.63201916
24
Map the requested service to a registered service name (used to map auth to serverAuth service when needed).
function useAsService(app, name) { if (name === 'serverAuth') { return null; } var useService = name; var options = app.options; return useService; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function serviceName (ctx) {\n const {mu, server} = ctx\n\n const handle = pattern(mu)\n\n // set up the component\n component({name}, ctx)\n\n // set up API routes for services\n\n server.route({\n method: 'GET',\n path: '/service-name/one',\n handler: handle({role: name, cmd: 'one'})\n })\n\n //...
[ "0.63204885", "0.62828773", "0.62656265", "0.6240066", "0.62210745", "0.61622226", "0.61622226", "0.61622226", "0.61622226", "0.61622226", "0.61622226", "0.61561984", "0.61561984", "0.61561984", "0.61561984", "0.61561984", "0.61561984", "0.61561984", "0.61561984", "0.6071378", ...
0.5913492
29
Copyright 2017 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS I...
function Ud() { var a = H();return Pb && !!$b && 11 == $b || /Edge\/\d+/.test(a); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function me(e,t,a,s){var n,i=arguments.length,r=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,a):s;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,s);else for(var d=e.length-1;d>=0;d--)(n=e[d])&&(r=(i<3?n(r):i>3?n(t,a,r):n(t,a))||r);return i>3&&r&&Object.definePro...
[ "0.57512176", "0.5345903", "0.52893716", "0.5242048", "0.5074461", "0.50543845", "0.50521696", "0.5051502", "0.5051502", "0.5027637", "0.4989611", "0.498545", "0.49730507", "0.49567991", "0.4916299", "0.48886392", "0.4876151", "0.48606881", "0.48606881", "0.48490617", "0.4849...
0.0
-1
Copyright 2018 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS I...
function yg() { this.b = null;this.a = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function me(e,t,a,s){var n,i=arguments.length,r=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,a):s;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,s);else for(var d=e.length-1;d>=0;d--)(n=e[d])&&(r=(i<3?n(r):i>3?n(t,a,r):n(t,a))||r);return i>3&&r&&Object.definePro...
[ "0.5676421", "0.5331158", "0.52144086", "0.5159942", "0.50609404", "0.50609404", "0.50272703", "0.5010954", "0.50075173", "0.49805543", "0.49349123", "0.4913257", "0.4901761", "0.4898656", "0.48451033", "0.48356208", "0.48282546", "0.48129523", "0.47906247", "0.47881243", "0....
0.0
-1
Portions of this code are from MochiKit, received by The Closure Authors under the MIT license. All other code is Copyright 20052009 The Closure Authors. All Rights Reserved.
function qh(a, b) { this.g = [];this.v = a;this.u = b || null;this.f = this.a = !1;this.c = void 0;this.m = this.w = this.i = !1;this.h = 0;this.b = null;this.l = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "transient protected internal function m189() {}", "static private internal function m121() {}", "static final private internal function m106() {}", "protected internal function m252() {}", "transient private protected internal ...
[ "0.70165133", "0.682409", "0.64743537", "0.6454304", "0.63657933", "0.63591665", "0.62854725", "0.62560505", "0.6183157", "0.60627335", "0.6007949", "0.5904859", "0.5879616", "0.5859123", "0.58283687", "0.5816589", "0.58119327", "0.57961977", "0.5786329", "0.5773027", "0.5771...
0.0
-1
Gives you an instance of a Logger to capture messages according to Firebase's logging scheme.
function Logger(name) { this.name = name; /** * The log level of the given Logger instance. */ this._logLevel = defaultLogLevel; /** * The log handler for the Logger instance. */ this._logHandler = defaultLogHandler; /** *...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLogger() {\n if (logger) return logger;\n var ccLogger = ccHandler(serializer);\n logger = new logger$1.Logger('@firebase/performance/cc');\n logger.logHandler = ccLogger;\n return logger;\n}", "function getLogger() {\r\n if (logger) {\r\n return logger;\r\n }\r\n var ccLogger = ...
[ "0.69847864", "0.6932374", "0.65856093", "0.6470139", "0.6422159", "0.63105905", "0.62534165", "0.6230862", "0.6199978", "0.61954194", "0.6027098", "0.60160494", "0.5992496", "0.59455204", "0.5933633", "0.5930959", "0.59271234", "0.58996165", "0.5881013", "0.5873659", "0.5840...
0.5479256
67
Build a destructive iterator for the value list
function iteratorFor(items) { var iterator = { next: function next() { var value = items.shift(); return { done: value === undefined, value: value }; } }; if (support.iterable) { iterator[Symbol.iterator] = function () { return iterator; }; } return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static createIteratorFromValue(value){\n return (function(){\n let used = false;\n\n return {\n next: function(){\n try {\n return used ? {done: true} : {value: value, done: false};\n ...
[ "0.6567051", "0.61971587", "0.6129268", "0.60959846", "0.6081213", "0.6081213", "0.60518825", "0.60518825", "0.60518825", "0.60518825", "0.60518825", "0.60395825", "0.6019784", "0.6000144", "0.593555", "0.59003186", "0.5864537", "0.58550805", "0.57782644", "0.57182074", "0.56...
0.0
-1
Copy properties from source to target (recursively allows extension of Objects and Arrays). Scalar values in the target are overwritten. If target is undefined, an object of the appropriate type will be created (and returned). We recursively copy all child properties of plain Objects in the source so that namespace lik...
function deepExtend(target, source) { if (!(source instanceof Object)) { return source; } switch (source.constructor) { case Date: // Treat Dates like scalars; if the target date object had any child // properties - they will be lost! var dateValue = sourc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deepExtend(target, source) {\n if (!(source instanceof Object)) {\n return source;\n }\n\n switch (source.constructor) {\n case Date:\n // Treat Dates like scalars; if the target date object had any child\n // properties - they will be lost!\n var da...
[ "0.75014603", "0.74398065", "0.7425828", "0.7425828", "0.7425828", "0.7425828", "0.7425828", "0.7425828", "0.7419184", "0.7419184", "0.73876894", "0.736244", "0.73570776", "0.7340579", "0.7340579", "0.7340579", "0.7340579", "0.7340579", "0.7340579", "0.7340579", "0.7340579", ...
0.7410317
21
TODO: Really needed (for JSCompiler type checking)?
function patchProperty(obj, prop, value) { obj[prop] = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Js(e){return(Js=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e})(e)}", "function Type() {}", "__eval__(__source__, __boundValues__) { return...
[ "0.62902296", "0.58050174", "0.5695141", "0.56580913", "0.56333554", "0.5606612", "0.5565383", "0.5545024", "0.5512546", "0.55076134", "0.55066526", "0.5505603", "0.54781395", "0.5472474", "0.5468769", "0.5468146", "0.54635763", "0.5463289", "0.5453843", "0.54421264", "0.5437...
0.0
-1
Export for faking in tests
function patchCapture(captureFake) { var result = captureStackTrace; captureStackTrace = captureFake; return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setup() {}", "setup() {}", "setup() {}", "setup() {}", "function fakeUsage() {\n var fakeObj = fake('example');\n fakeObj.mock('foo').map([], 'bar');\n fakeObj.foo();\n }", "function AeUtil() {}", "async setup() { }", "function MockedProvider() {\n /* ... */\n}", "expected(_...
[ "0.63395375", "0.62538314", "0.62538314", "0.62538314", "0.59652007", "0.592908", "0.59203243", "0.5870511", "0.58335674", "0.5803979", "0.5803955", "0.5799477", "0.5797888", "0.5797888", "0.5751915", "0.5734973", "0.5734036", "0.5698406", "0.567787", "0.5670397", "0.56570923...
0.0
-1
Helper to make a Subscribe function (just like Promise helps make a Thenable).
function createSubscribe(executor, onNoObservers) { var proxy = new ObserverProxy(executor, onNoObservers); return proxy.subscribe.bind(proxy); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "subscribe(fn) {\n return this._subscribe(fn);\n }", "subscribe() {}", "subscribe(s) { return dispatcher.subscribe(s); }", "function subscribe ( util, uri, handler ) {\n var ws = util.connection ? util.connection : util;\n var p = Packet\n .make()\n .uri( uri )\...
[ "0.7111695", "0.69480175", "0.6911661", "0.6881512", "0.6807628", "0.6789229", "0.6763905", "0.66531384", "0.6646185", "0.6622463", "0.6600869", "0.6600869", "0.6600869", "0.6600869", "0.6600869", "0.6600869", "0.6600869", "0.6600869", "0.6600869", "0.6600869", "0.65936077", ...
0.65715325
39
Turn synchronous function into one called asynchronously.
function async(fn, onError) { return function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } Promise.resolve(true).then(function () { fn.apply(void 0, args); }).catch(function (error) { if (o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function MyAsyncFn () {}", "async function asyncFunction(arg) {\r\n return arg;\r\n}", "async function fn(){ //This is the newer way of doing an async function\n return 'hello';\n}", "async function asyncFn(){\n\n return 1;\n}", "async function f(){\n return something\n}", "function async(f...
[ "0.7155934", "0.7116087", "0.70804554", "0.68879116", "0.68725556", "0.6768867", "0.67274386", "0.6606676", "0.6605907", "0.6605907", "0.6598512", "0.6598512", "0.65512455", "0.65512455", "0.65438145", "0.65246886", "0.65200365", "0.6504154", "0.6503758", "0.64964813", "0.649...
0.5909797
63
Return true if the object passed in implements any of the named methods.
function implementsAnyMethods(obj, methods) { if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' || obj === null) { return false; } for (var _i = 0, methods_1 = methods; _i < methods_1.length; _i++) { var method = methods_1[_i]; if (method in obj && typeof obj...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function implementsAnyMethods(obj, methods) {\r\n if (typeof obj !== 'object' || obj === null) {\r\n return false;\r\n }\r\n var object = obj;\r\n for (var _i = 0, methods_1 = methods; _i < methods_1.length; _i++) {\r\n var method = methods_1[_i];\r\n if (method in object && typeof...
[ "0.7897867", "0.7897867", "0.7897867", "0.7887639", "0.7887639", "0.7887639", "0.7887639", "0.78607833", "0.7840518", "0.7840518", "0.7840518", "0.7840518", "0.7840518", "0.7840518", "0.7840518", "0.7840518", "0.7840518", "0.7840518", "0.78380656", "0.78380656", "0.78380656",...
0.77802324
43
v8 likes predictible objects
function Item(fun, array) { this.fun = fun; this.array = array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareLike(a,b){\n var al = a.idLikesProp.length;\n var bl = b.idLikesProp.length;\n if(al > bl) return -1;\n if(bl > al) return 1;\n return 0;\n}", "function lookAround() {\n var objectDescription = \"\"\n tj.see().then(function(objects) {\n objects.forEach(function(each) {\n ...
[ "0.527866", "0.52612406", "0.51951283", "0.518796", "0.51302594", "0.5044646", "0.48934332", "0.4857401", "0.484017", "0.48302925", "0.482028", "0.4812441", "0.4808473", "0.47852293", "0.47828078", "0.47574478", "0.47493434", "0.4739314", "0.47239366", "0.4703992", "0.4703992...
0.0
-1
Take a potentially misbehaving resolver function and make sure onFulfilled and onRejected are only called once. Makes no guarantees about asynchrony.
function doResolve(fn, self) { var done = false; try { fn(function (value) { if (done) return; done = true; resolve(self, value); }, function (reason) { if (done) return; done = true; reject(self, reason); }); } catch (ex) { if (done) return; done = true; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doResolve(fn, onFulfilled, onRejected) {\n var done = false;\n try {\n fn(function (value) {\n if (done) return;\n done = true;\n onFulfilled(value);\n }, function (reason) {\n if (done) return;\n done = true;\n onRejected(reaso...
[ "0.7080868", "0.70743054", "0.7044705", "0.7042484", "0.7042484", "0.7042484", "0.7034746", "0.7033968", "0.7033968", "0.7033968", "0.7033968", "0.7033968", "0.7017375", "0.6962614", "0.6962614", "0.6962614", "0.6962614", "0.6810403", "0.62816465", "0.6168662", "0.60255283", ...
0.5627307
73
inlined Object.is polyfill to avoid requiring consumers ship their own /eslintdisable noselfcompare
function is(x, y) { // SameValue algorithm if (x === y) { // Steps 1-5, 7-10 // Steps 6.b-6.e: +0 != -0 return x !== 0 || 1 / x === 1 / y; } else { // Step 6.a: NaN == NaN return x !== x && y !== y; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isObject$1(obj) {\n // incase of arrow function and array\n return Object(obj) === obj && String(obj) === '[object Object]' && !isFunction(obj) && !isArray(obj);\n }", "function isObject$1(obj) {\n ...
[ "0.67325807", "0.66350085", "0.6609975", "0.66011983", "0.65996516", "0.65650445", "0.6507408", "0.64692605", "0.64640933", "0.6412933", "0.6371315", "0.63672847", "0.63672847", "0.63672847", "0.63672847", "0.6358507", "0.632842", "0.6323558", "0.63232696", "0.62977177", "0.6...
0.0
-1
Equivalent of `typeof` but with special handling for array and regexp.
function getPropType(propValue) { var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue); if (Array.isArray(propValue)) { return 'array'; } if (propValue instanceof RegExp) { // Old webkits (at least until Android 4.0) return 'function' rather than // 'objec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sc_typeof( x ) {\n return typeof x;\n}", "static type(arg)\n {\n const types = [\n 'array', 'boolean', 'function', 'number',\n 'null', 'object', 'regexp', 'symbol', 'string',\n 'undefined'\n ]\n\n var type = Object.prototype.toString.call(arg),\...
[ "0.6908362", "0.6774889", "0.6606997", "0.65384954", "0.64926404", "0.6489072", "0.6489072", "0.6449892", "0.6449892", "0.6428727", "0.64280385", "0.6402795", "0.6402795", "0.63939744", "0.63939744", "0.63939744", "0.63939744", "0.63939744", "0.63939744", "0.63939744", "0.639...
0.0
-1
This handles more types than `getPropType`. Only used for error messages. See `createPrimitiveTypeChecker`.
function getPreciseType(propValue) { if (typeof propValue === 'undefined' || propValue === null) { return '' + propValue; } var propType = getPropType(propValue); if (propType === 'object') { if (propValue instanceof Date) { return 'date'; } else if (propValue instanceof RegExp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for type...
[ "0.6876589", "0.68531567", "0.68531567", "0.68531567", "0.68531567", "0.68519515", "0.68464226", "0.68464226", "0.68464226", "0.68464226", "0.68464226", "0.68464226", "0.68464226", "0.68464226", "0.68464226", "0.68464226", "0.68464226", "0.68464226", "0.68464226", "0.68464226",...
0.0
-1
Returns a string that is postfixed to a warning about an invalid type. For example, "undefined" or "of type array"
function getPostfixForTypeWarning(value) { var type = getPreciseType(value); switch (type) { case 'array': case 'object': return 'an ' + type; case 'boolean': case 'date': case 'regexp': return 'a ' + type; default: return type; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _undefinedCoerce() {\n return '';\n}", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case \"array\":\n case \"object\":\n return \"an \" + type;\n case \"boolean\":\n ...
[ "0.660086", "0.65664715", "0.65607077", "0.65607077", "0.65607077", "0.65607077", "0.6523554", "0.65228945", "0.6507182", "0.6507182", "0.6507182", "0.6507182", "0.6507182", "0.6502548", "0.6491066", "0.6479036", "0.6479036", "0.6479036", "0.6479036", "0.6479036", "0.6479036"...
0.0
-1
Returns class name of the object, if any.
function getClassName(propValue) { if (!propValue.constructor || !propValue.constructor.name) { return ANONYMOUS; } return propValue.constructor.name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getClassName(obj) {\n var funcNameRegex = /function\\s+(.+?)\\s*\\(/;\n var results = funcNameRegex.exec(obj['constructor'].toString());\n return (results && results.length > 1) ? results[1] : '';\n }", "getClassName() {\n return this.constructor\n .className;\n...
[ "0.7730571", "0.74697196", "0.74697196", "0.74258965", "0.7164231", "0.71448183", "0.7083163", "0.7080694", "0.6995368", "0.6971116", "0.6901662", "0.6883398", "0.67147285", "0.66557264", "0.6639163", "0.6611592", "0.6611592", "0.6611592", "0.6611592", "0.6600893", "0.6599787...
0.0
-1
During execution of guarded functions we will capture the first error which we will rethrow to be handled by the top level error handler.
function rethrowCaughtError(){if(hasRethrowError){var error=rethrowError;hasRethrowError=false;rethrowError=null;throw error;}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _tryEachErrorHandler(next, ctx) {\n if (ctx.ix >= ctx.steps.length) return next(ctx.err2 || ctx.err, 'done'); else { ctx.next = next; _tryStepContext(ctx, _tryNext); }\n }", "function rethrow(){\n if(DEBUG){\n var back = new error;\n return function(err){\n if(err){\n back...
[ "0.64132214", "0.63276243", "0.6323648", "0.6162804", "0.6153157", "0.6153157", "0.6153157", "0.6153157", "0.6153157", "0.6153157", "0.6153157", "0.6153157", "0.6153157", "0.6153157", "0.6153157", "0.6153157", "0.6153157", "0.6153157", "0.61225873", "0.6121533", "0.6083926", ...
0.63459426
7
Recomputes the plugin list using the injected plugins and plugin ordering.
function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected. return;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);!(pluginIndex>-1)?invariant(false,'EventPluginRegistry: Cannot inject e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "orderPlugins() {\r\n debug('orderPlugins:before', this.pluginNames);\r\n const runLast = this._plugins\r\n .filter(p => p.requirements.has('runLast'))\r\n .map(p => p.name);\r\n for (const name of runLast) {\r\n const index = this._plugins.findIndex(p => p.name...
[ "0.7994167", "0.747035", "0.7168887", "0.7135859", "0.7135859", "0.7135859", "0.71282715", "0.7122214", "0.7118275", "0.71168816", "0.71168816", "0.71168816", "0.7100578", "0.7100578", "0.7100578", "0.709077", "0.709077", "0.70790946", "0.7074301", "0.7074301", "0.7065544", ...
0.70910096
19
Standard/simple iteration through an event's collected dispatches.
function executeDispatchesInOrder(event){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function forEachEventDispatch(event,cb){var dispatchListeners=event._dispatchListeners;var dispatchIDs=event._dispatchIDs;if(\"production\"!==process.env.NODE_ENV){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break...
[ "0.6340201", "0.6318283", "0.6216154", "0.6129209", "0.6122544", "0.6122544", "0.6122544", "0.6122544", "0.6122544", "0.6122544", "0.6122544", "0.6122544", "0.6119329", "0.6119329", "0.61154145", "0.60784554", "0.60784554", "0.60784554", "0.60784554", "0.60784554", "0.6078455...
0.0
-1
Given a DOM node, return the closest ReactDOMComponent or ReactDOMTextComponent instance ancestor.
function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is // unmounted, potentially). return null;}}var inst=node[interna...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n ...
[ "0.73241985", "0.73241985", "0.73241985", "0.73241985", "0.73241985", "0.73241985", "0.73241985", "0.73241985", "0.73241985", "0.73241985", "0.73241985", "0.73241985", "0.73241985", "0.73241985", "0.7308156", "0.7308156", "0.7308156", "0.7308156", "0.7308156", "0.7308156", "0...
0.73721355
3
Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent instance, or null if the node was not rendered by this React.
function getInstanceFromNode$1(node){var inst=node[internalInstanceKey];if(inst){if(inst.tag===HostComponent||inst.tag===HostText){return inst;}else{return null;}}return null;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n if (node instanceof react__WEBPACK_IMPORTED_MODULE_0__.Component) {\n return react_dom__WEBPACK_IMPORTED_MODULE_1__.findDOMNode(node);\n }\n return null;\n}", "function findFirstReactDOMImpl(node) {\n\t\t // This n...
[ "0.75961375", "0.73800486", "0.7349611", "0.7349611", "0.7349611", "0.7349611", "0.7349611", "0.7349611", "0.7349611", "0.7349611", "0.7349611", "0.7349611", "0.7349611", "0.7349611", "0.7349611", "0.7349611", "0.7349611", "0.7349611", "0.7329588", "0.7329588", "0.7329588", ...
0.0
-1
Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding DOM node.
function getNodeFromInstance$1(inst){if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber this, is just the state node right now. We assume it will be // a host component or host text. return inst.stateNode;}// Without this first invariant, passing a non-DOM-component triggers the next // invariant for a missi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findFirstReactDOMImpl(node) {\n\t\t // This node might be from another React instance, so we make sure not to\n\t\t // examine the node cache here\n\t\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t\t if (node.nodeType !== 1) {\n\t\t // Not a DOMElement, therefore not a...
[ "0.6786204", "0.67785287", "0.6772284", "0.67672324", "0.67672324", "0.6752643", "0.6743332", "0.674241", "0.674241", "0.674241", "0.674241", "0.674241", "0.674241", "0.674241", "0.67411697", "0.67411697", "0.67411697", "0.67411697", "0.67411697", "0.67411697", "0.6733316", ...
0.0
-1
Return the lowest common ancestor of A and B, or null if they are in different trees.
function getLowestCommonAncestor(instA,instB){var depthA=0;for(var tempA=instA;tempA;tempA=getParent(tempA)){depthA++;}var depthB=0;for(var tempB=instB;tempB;tempB=getParent(tempB)){depthB++;}// If A is deeper, crawl up. while(depthA-depthB>0){instA=getParent(instA);depthA--;}// If B is deeper, crawl up. while(depthB-d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLowestCommonAncestor(instA, instB) {\n\t !('_nativeNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : invariant(false) : void 0;\n\t !('_nativeNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromIns...
[ "0.8276824", "0.8276824", "0.8276824", "0.8272346", "0.8272346", "0.8272346", "0.825413", "0.8228758", "0.8228758", "0.8228758", "0.8228758", "0.8199549", "0.81989896", "0.81840426", "0.81840426", "0.81840426", "0.81840426", "0.81840426", "0.81840426", "0.81840426", "0.818404...
0.81065786
79
Return if A is an ancestor of B. Return the parent instance of the passedin instance. Simulates the traversal of a twophase, capture/bubble event dispatch.
function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i=void 0;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isAncestor(instA, instB) {\n\t !('_nativeNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;\n\t !('_nativeNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : in...
[ "0.74996895", "0.74996895", "0.74996895", "0.74897283", "0.74897283", "0.74897283", "0.7472096", "0.73996335", "0.73996335", "0.73996335", "0.73996335", "0.73996335", "0.73996335", "0.73996335", "0.73996335", "0.73996335", "0.735526", "0.735526", "0.7267361", "0.71526486", "0...
0.0
-1
Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that should would receive a `mouseEnter` or `mouseLeave` event. Does not invoke the callback on the nearest common ancestor because nothing "entered" or "left" that element.
function traverseEnterLeave(from,to,fn,argFrom,argTo){var common=from&&to?getLowestCommonAncestor(from,to):null;var pathFrom=[];while(true){if(!from){break;}if(from===common){break;}var alternate=from.alternate;if(alternate!==null&&alternate===common){break;}pathFrom.push(from);from=getParent(from);}var pathTo=[];while...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_handleMouseEnter() {\n this._hovered.next(this);\n }", "_elementMouseEnterHandler() {\n const that = this;\n\n if (that.clickMode === 'hover' && !that.disabled && !that.readonly) {\n that._handleMouseInteraction();\n }\n }", "_elementMouseEnterHandler() {\n ...
[ "0.50958073", "0.4923776", "0.4923776", "0.48828086", "0.4879105", "0.4879105", "0.48694754", "0.4865299", "0.47985366", "0.47767362", "0.4727795", "0.4724397", "0.4718455", "0.47084516", "0.47027516", "0.46615142", "0.46477535", "0.46370202", "0.4634212", "0.4634212", "0.459...
0.4734754
17
Some event types have a notion of different registration names for different "phases" of propagation. This finds listeners by a given phase.
function listenerAtPhase(inst,event,propagationPhase){var registrationName=event.dispatchConfig.phasedRegistrationNames[propagationPhase];return getListener(inst,registrationName);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listenerAtPhase(inst, event, propagationPhase) {\n\t\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t\t return getListener(inst, registrationName);\n\t\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t\t var registrationName = event.dispat...
[ "0.6933093", "0.6933093", "0.6925909", "0.6925909", "0.6901375", "0.6901375", "0.6901375", "0.6901375", "0.6901375", "0.6901375", "0.6901375", "0.6901375", "0.6901375", "0.6901375", "0.6901375", "0.6901375", "0.6901375", "0.6901375", "0.6901375", "0.6901375", "0.6901375", "...
0.6932303
12
A small set of propagation patterns, each of which will accept a small amount of information, and generate a set of "dispatch ready event objects" which are sets of events that have already been annotated with a set of dispatched listener functions/ids. The API is designed this way to discourage these propagation strat...
function accumulateDirectionalDispatches(inst,phase,event){{!inst?warningWithoutStack$1(false,'Dispatching inst must not be null'):void 0;}var listener=listenerAtPhase(inst,event,phase);if(listener){event._dispatchListeners=accumulateInto(event._dispatchListeners,listener);event._dispatchInstances=accumulateInto(event....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function accumulateDirectionalDispatches(inst,upwards,event){if(process.env.NODE_ENV!=='production'){process.env.NODE_ENV!=='production'?warning(inst,'Dispatching inst must not be null'):void 0;}var phase=upwards?PropagationPhases.bubbled:PropagationPhases.captured;var listener=listenerAtPhase(inst,event,phase);if...
[ "0.6351379", "0.6351379", "0.62488556", "0.6234077", "0.60864353", "0.60864353", "0.60864353", "0.60864353", "0.60864353", "0.595973", "0.595973", "0.5952979", "0.5928029", "0.5928029", "0.5927833", "0.5927833", "0.5927833", "0.5927833", "0.5927833", "0.5927833", "0.5927833",...
0.59452534
12
Collect dispatches (must be entirely collected before dispatching see unit tests). Lazily allocate the array to conserve memory. We must loop through each event and perform the traversal for each one. We cannot perform a single traversal for the entire collection of events because each event may have a different target...
function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function executeDispatchesInOrder(event){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances...
[ "0.60375905", "0.60375905", "0.60375905", "0.60375905", "0.60375905", "0.59032416", "0.58940375", "0.58940375", "0.58940375", "0.58940375", "0.5876829", "0.5833313", "0.5833313", "0.5833313", "0.5833313", "0.5833313", "0.5833313", "0.5833313", "0.5833313", "0.5833313", "0.579...
0.0
-1
Accumulates without regard to direction, does not look for phased registration names. Same as `accumulateDirectDispatchesSingle` but without requiring that the `dispatchMarker` be the same as the dispatched ID.
function accumulateDispatches(inst,ignoredDirection,event){if(inst&&event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners=accumulateInto(event._dispatchListeners,listener);event._disp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulate...
[ "0.74679923", "0.74679923", "0.74679923", "0.74679923", "0.74679923", "0.74679923", "0.74679923", "0.74679923", "0.74679923", "0.74679923", "0.74679923", "0.74679923", "0.74679923", "0.74679923", "0.74679923", "0.74679923", "0.74679923", "0.74679923", "0.74679923", "0.74679923"...
0.0
-1
Do not uses the below two methods directly! Instead use constants exported from DOMTopLevelEventTypes in ReactDOM. (It is the only module that is allowed to access these methods.)
function unsafeCastStringToDOMTopLevelType(topLevelType){return topLevelType;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleTopLevel(topLevelType,targetInst,nativeEvent,nativeEventTarget){var events=extractEvents(topLevelType,targetInst,nativeEvent,nativeEventTarget);runEventQueueInBatch(events);}", "function handleTopLevel(topLevelType,targetInst,nativeEvent,nativeEventTarget){var events=extractEvents(topLevelType,tar...
[ "0.64468443", "0.64468443", "0.64468443", "0.63354677", "0.6324221", "0.62607867", "0.62196535", "0.6146904", "0.6146904", "0.6146904", "0.6146904", "0.6146904", "0.6097845", "0.6097845", "0.60790896", "0.59543264", "0.5935093", "0.5894347", "0.58936274", "0.58936274", "0.589...
0.0
-1
Return whether a native keypress event is assumed to be a command. This is required because Firefox fires `keypress` events for key commands (cut, copy, selectall, etc.) even though no character is inserted.
function isKeypressCommand(nativeEvent){return(nativeEvent.ctrlKey||nativeEvent.altKey||nativeEvent.metaKey)&&// ctrlKey && altKey is equivalent to AltGr, and is not a command. !(nativeEvent.ctrlKey&&nativeEvent.altKey);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isKeypressCommand(nativeEvent) {\n\t return (\n\t (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey)\n\t );\n\t}", "function isKeypressCommand(nativeEvent...
[ "0.8016589", "0.8016589", "0.8016589", "0.8016589", "0.8016589", "0.8016589", "0.8016589", "0.8008223", "0.799938", "0.79982495", "0.79982495", "0.79982495", "0.79982495", "0.79982495", "0.79982495", "0.79982495", "0.79982495", "0.79982495", "0.79982495", "0.79982495", "0.799...
0.0
-1
Get the value for a property on a node. Only used in DEV for SSR validation. The "expected" argument is used as a hint of what the expected value is. Some properties have multiple equivalent values.
function getValueForProperty(node,name,expected,propertyInfo){{if(propertyInfo.mustUseProperty){var propertyName=propertyInfo.propertyName;return node[propertyName];}else{var attributeName=propertyInfo.attributeName;var stringValue=null;if(propertyInfo.type===OVERLOADED_BOOLEAN){if(node.hasAttribute(attributeName)){var...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getValueForProperty(node,name,expected){{var propertyInfo=getPropertyInfo(name);if(propertyInfo){var mutationMethod=propertyInfo.mutationMethod;if(mutationMethod||propertyInfo.mustUseProperty){return node[propertyInfo.propertyName];}else{var attributeName=propertyInfo.attributeName;var stringValue=null;if...
[ "0.81585205", "0.81585205", "0.8143505", "0.8068335", "0.8068335", "0.8064425", "0.80600667", "0.80600667", "0.80600667", "0.80600667", "0.80600667", "0.80600667", "0.80600667", "0.80600667", "0.80600667", "0.80600667", "0.80600667", "0.80600667", "0.80600667", "0.80600667", ...
0.78714687
90
Get the value for a attribute on a node. Only used in DEV for SSR validation. The third argument is used as a hint of what the expected value is. Some attributes have multiple equivalent values.
function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}if(!node.hasAttribute(name)){return expected===undefined?undefined:null;}var value=node.getAttribute(name);if(value===''+expected){return expected;}return value;}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getValueForAttribute(node,name,expected){{if(!isAttributeNameSafe(name)){return;}// If the object is an opaque reference ID, it's expected that\n// the next prop is different than the server value, so just return\n// expected\nif(isOpaqueHydratingObject(expected)){return expected;}if(!node.hasAttribute(na...
[ "0.73298323", "0.73298323", "0.7326527", "0.732314", "0.732314", "0.732314", "0.732314", "0.732314", "0.732314", "0.732314", "0.732314", "0.732314", "0.732314", "0.732314", "0.732314", "0.732314", "0.732314", "0.732314", "0.73162776", "0.72653466", "0.72653466", "0.72653466...
0.7426572
7
around this limitation, we use an opaque type that can only be obtained by passing the value through getToStringValue first.
function toString(value){return''+value;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get stringValue() {}", "__typeToString(value) {\n if (helpers_1.isNullOrUndefined(value)) {\n return value;\n }\n else if (typeof value === 'string') {\n return (value.length > 0) ? `\"${value}\"` : '\"\"';\n }\n else if (typeof value === 'number') {\n ...
[ "0.66021305", "0.65279466", "0.64090204", "0.613257", "0.6110995", "0.60871893", "0.60189444", "0.59371245", "0.58975637", "0.58842117", "0.5880046", "0.58630496", "0.58445084", "0.58295125", "0.58239096", "0.5776287", "0.57746315", "0.57608354", "0.5747429", "0.5727408", "0....
0.55542046
49
Implements an host component that allows setting these optional props: `checked`, `value`, `defaultChecked`, and `defaultValue`. If `checked` or `value` are not supplied (or null/undefined), user actions that affect the checked state or value will trigger updates to the element. If they are supplied (and not null/undef...
function getHostProps(element,props){var node=element;var checked=props.checked;var hostProps=_assign({},props,{defaultChecked:undefined,defaultValue:undefined,value:undefined,checked:checked!=null?checked:node._wrapperState.initialChecked});return hostProps;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(props) {\n super(props);\n this.value = props.value;\n this.id = RadioButton.idGenerator(this.value);\n this.groupName = props.groupName;\n this.optional = {};\n if (typeof props.onChangeCallback === 'function') {\n this.optional.onChangeCallback =\n...
[ "0.6890401", "0.63897663", "0.6258759", "0.62114686", "0.6131906", "0.6131906", "0.6131906", "0.6131906", "0.6131906", "0.6131906", "0.6131906", "0.6131906", "0.6131906", "0.6131906", "0.6131906", "0.6131906", "0.6131906", "0.6131906", "0.6130953", "0.6111307", "0.6089885", ...
0.6786971
7
For number inputs, the display value loses trailing decimal points. For email inputs, Chrome raises "The specified value is not a valid email address". Here we check to see if the defaultValue has actually changed, avoiding these problems when the user is inputting text
function setDefaultValue(node,type,value){if(// Focused number inputs synchronize on blur. See ChangeEventPlugin.js type!=='number'||node.ownerDocument.activeElement!==node){if(value==null){node.defaultValue=toString(node._wrapperState.initialValue);}else if(node.defaultValue!==toString(value)){node.defaultValue=toStri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shouldSetInputTextToDefaultValue (props) {\n let result = (this.previousDefaultValue != props.defaultValue) || (this.previousChangeIndicator != props.changeIndicator)\n return result\n }", "function setDefaultValue(node,type,value){if(// Focused number inputs synchronize on blur. See ChangeEventPlugin.js\...
[ "0.6748244", "0.6745956", "0.6745956", "0.66758955", "0.66758955", "0.6567232", "0.65263164", "0.6493208", "0.6483082", "0.6483082", "0.6483082", "0.6483082", "0.6460759", "0.6460759", "0.6460759", "0.6460759", "0.6460759", "0.6460759", "0.6460759", "0.6460759", "0.6460759", ...
0.668249
6
SECTION: handle `change` event
function shouldUseChangeEvent(elem){var nodeName=elem.nodeName&&elem.nodeName.toLowerCase();return nodeName==='select'||nodeName==='input'&&elem.type==='file';}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "change(/*event*/) {\n this._super(...arguments);\n this._parse();\n }", "handleChange(event) {\n this.dispatchEvent(new CustomEvent('change', {detail: event.target.value}));\n }", "onchange() {}", "function onChange() {\n\t\t__debug_452( 'Received a change event.' );\n\t\tself.render();\n\t}...
[ "0.7854437", "0.77068484", "0.7598262", "0.7521723", "0.7511005", "0.7504069", "0.7448793", "0.7420877", "0.7401912", "0.7386296", "0.73666596", "0.73555636", "0.73510677", "0.73496395", "0.73438835", "0.7339759", "0.73381084", "0.73354316", "0.73326874", "0.7328343", "0.7321...
0.0
-1
(For IE <=9) Starts tracking propertychange events on the passedin element and override the value property so that we can distinguish user events from value changes in JS.
function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElementValue=target.value;activeElementValueProp=Object.getOwnPropertyDescriptor(target.constructor.prototype,'value');// Not guarded in a canDefineProperty check: IE8 supports defineProperty only\n// on...
[ "0.72815424", "0.719423", "0.719423", "0.7045778", "0.7033005", "0.70243186", "0.69352555", "0.69352555", "0.69352555", "0.69352555", "0.69352555", "0.69352555", "0.69352555", "0.69352555", "0.69352555", "0.69352555", "0.69352555", "0.69352555", "0.6852122", "0.68518627", "0....
0.7499227
8
(For IE <=9) Removes the event listeners from the currentlytracked element, if any exists.
function stopWatchingForValueChange(){if(!activeElement){return;}activeElement.detachEvent('onpropertychange',handlePropertyChange);activeElement=null;activeElementInst=null;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_removeEventListeners() {\n this.currentEventListeners.forEach(listener => {\n this.domElement.removeEventListener(listener.event, listener.callBack);\n });\n this.currentEventListeners = null;\n }", "function removeListeners(useCapturing) {\r\r\n // get all div in list\r\r\...
[ "0.7509986", "0.7134042", "0.71030164", "0.7084824", "0.7084824", "0.7074644", "0.7054328", "0.7043545", "0.70386237", "0.7013113", "0.70039946", "0.69831365", "0.697547", "0.6941512", "0.6922025", "0.6917149", "0.69129825", "0.68990177", "0.68634945", "0.6861883", "0.6861661...
0.0
-1
(For IE <=9) Handles a propertychange event, sending a `change` event if the value of the active element has changed.
function handlePropertyChange(nativeEvent){if(nativeEvent.propertyName!=='value'){return;}if(getInstIfValueChanged(activeElementInst)){manualDispatchChangeEvent(nativeEvent);}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('on...
[ "0.71687317", "0.71687317", "0.71687317", "0.71687317", "0.71687317", "0.71687317", "0.71687317", "0.71687317", "0.71687317", "0.71687317", "0.71687317", "0.71687317", "0.69440717", "0.6840082", "0.68314457", "0.6743528", "0.667276", "0.66622555", "0.66622555", "0.6652715", "...
0.66947204
27
SECTION: handle `click` event
function shouldUseClickEvent(elem){// Use the `click` event to detect changes to checkbox and radio inputs. // This approach works across all browsers, whereas `change` does not fire // until `blur` in IE8. var nodeName=elem.nodeName;return nodeName&&nodeName.toLowerCase()==='input'&&(elem.type==='checkbox'||elem.type=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleClick( event ){ }", "handleClick() {}", "function handleClick(){\n console.log(\"clicked\");\n}", "function handleClick(event)\n{\n}", "click() { }", "function clickHandler(){\n console.log('I am clicked');\n}", "function clickHandler(event) {\n\tindexChangeSections(event);\n\ttabChangeSect...
[ "0.8123866", "0.7879277", "0.7531671", "0.7500634", "0.7475805", "0.7402668", "0.73915786", "0.7379595", "0.7379595", "0.7331232", "0.7330436", "0.7245654", "0.72390676", "0.72122186", "0.7116352", "0.7082111", "0.7062615", "0.7056091", "0.7017624", "0.7006748", "0.6982211", ...
0.0
-1
Older browsers (Safari <= 10, iOS Safari <= 10.2) do not support getModifierState. If getModifierState is not supported, we map it to a set of modifier keys exposed by the event. In this case, Lockkeys are not supported. Translation from modifier key to the associated property in the event.
function modifierStateGetter(keyArg){var syntheticEvent=this;var nativeEvent=syntheticEvent.nativeEvent;if(nativeEvent.getModifierState){return nativeEvent.getModifierState(keyArg);}var keyProp=modifierKeyToProp[keyArg];return keyProp?!!nativeEvent[keyProp]:false;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function modifierStateGetter(keyArg){ /*jshint validthis:true */var syntheticEvent=this;var nativeEvent=syntheticEvent.nativeEvent;if(nativeEvent.getModifierState){return nativeEvent.getModifierState(keyArg);}var keyProp=modifierKeyToProp[keyArg];return keyProp?!!nativeEvent[keyProp]:false;}", "function modifier...
[ "0.78773606", "0.78773606", "0.7797534", "0.76025754", "0.7566912", "0.7566912", "0.7566912", "0.7530796", "0.74900687", "0.74900687", "0.74900687", "0.74900687", "0.74900687", "0.74900687", "0.74900687", "0.74900687", "0.74900687", "0.74900687", "0.74900687", "0.74900687", "...
0.7976579
11
inlined Object.is polyfill to avoid requiring consumers ship their own
function is(x,y){return x===y&&(x!==0||1/x===1/y)||x!==x&&y!==y// eslint-disable-line no-self-compare ;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function i(e){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction(e){return null!=e&&\"object\"==typeof e&&!1===Array.isArray(e)}(e)&&\"[object Object]\"===Object.prototype.toString.call(e)}", ...
[ "0.7044135", "0.6979357", "0.68574303", "0.6821805", "0.68029666", "0.67803156", "0.6729492", "0.67206", "0.6709456", "0.66839457", "0.6676559", "0.6676559", "0.6676559", "0.66488636", "0.6640003", "0.6640003", "0.6640003", "0.6640003", "0.6625777", "0.6623136", "0.6623136", ...
0.0
-1
Performs equality by iterating through keys on an object and returning false when any key has values which are not strictly equal between the arguments. Returns true when the values of all keys are strictly equal.
function shallowEqual(objA,objB){if(is(objA,objB)){return true;}if((typeof objA==='undefined'?'undefined':_typeof(objA))!=='object'||objA===null||(typeof objB==='undefined'?'undefined':_typeof(objB))!=='object'||objB===null){return false;}var keysA=Object.keys(objA);var keysB=Object.keys(objB);if(keysA.length!==keysB.l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function equalForKeys(a, b, keys) {\n if (!angular.isArray(keys) && angular.isObject(keys)) {\n keys = protoKeys(keys, [\"$$keys\", \"$$values\", \"$$equals\", \"$$validates\", \"$$new\", \"$$parent\"]);\n }\n if (!keys) {\n keys = [];\n for (var n in a) keys.push(n)...
[ "0.65732783", "0.65732783", "0.6468339", "0.6454703", "0.64346886", "0.63351655", "0.62950313", "0.62711096", "0.62403786", "0.6222752", "0.6213266", "0.6182621", "0.61569595", "0.6129296", "0.6127958", "0.6072991", "0.6034009", "0.6013137", "0.60031307", "0.59769714", "0.597...
0.0
-1
`ReactInstanceMap` maintains a mapping from a public facing stateful instance (key) and the internal representation (value). This allows public methods to accept the user facing instance as an argument and map them back to internal methods. Note that this module is currently shared and assumed to be stateless. If this ...
function get(key){return key._reactInternalFiber;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapWrapper(key)\n{\n\tthis.key = key;\n}", "function Map() {\n this.container = new Object();\n}", "function Map() {\r\n this.keys = [];\r\n this.values = [];\r\n}", "function Map() {\n\tthis.keys = [];\n\tthis.values = [];\n\n\t// add a key / value pair to map\n\tthis.add = function(key, v...
[ "0.56250936", "0.5444014", "0.54394263", "0.54297894", "0.52931684", "0.5229124", "0.52213204", "0.5153877", "0.5149647", "0.5146485", "0.5124302", "0.5117343", "0.5113928", "0.51124424", "0.5056032", "0.50448793", "0.50252193", "0.50252193", "0.49983275", "0.49983275", "0.49...
0.4917855
38
Find the deepest React component completely containing the root of the passedin instance (for use when entire React trees are nested within each other). If React trees are not nested, returns null.
function findRootContainerNode(inst){// TODO: It may be a good idea to cache this to prevent unnecessary DOM // traversal, but caching is difficult to do correctly without using a // mutation observer to listen for all DOM changes. while(inst.return){inst=inst.return;}if(inst.tag!==HostRoot){// This can happen if we're...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n ...
[ "0.6876151", "0.6876151", "0.6876151", "0.6876151", "0.6876151", "0.6876151", "0.6876151", "0.6876151", "0.6876151", "0.6876151", "0.6876151", "0.6876151", "0.6876151", "0.6876151", "0.6797642", "0.6797642", "0.6797642", "0.6797642", "0.6797642", "0.6797642", "0.6797642", "...
0.0
-1
Implements an host component that warns when `selected` is set.
function validateProps(element,props){{// This mirrors the codepath above, but runs for hydration too. // Warn about invalid children here so that client and hydration are consistent. // TODO: this seems like it could cause a DEV-only throw for hydration // if children contains a non-element object. We should try to av...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get _shouldUpdateSelection(){return this.selected!=null;}", "get selected() { return this._selected; }", "get selected() { return this._selected; }", "get selected() { return this._selected; }", "get selected() { return this._selected; }", "get selected() { return this._selected; }", "get selected() { ...
[ "0.5835138", "0.5717058", "0.5717058", "0.5717058", "0.5717058", "0.5717058", "0.5717058", "0.5717058", "0.5717058", "0.5717058", "0.5717058", "0.5717058", "0.5717058", "0.56534386", "0.55851144", "0.5576835", "0.5574898", "0.55625105", "0.55625105", "0.5542894", "0.55244917"...
0.0
-1
Validation function for `value` and `defaultValue`.
function checkSelectPropTypes(props){ReactControlledValuePropTypes.checkPropTypes('select',props);for(var i=0;i<valuePropNames.length;i++){var propName=valuePropNames[i];if(props[propName]==null){continue;}var isArray=Array.isArray(props[propName]);if(props.multiple&&!isArray){warning$1(false,'The `%s` prop supplied to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "'validateValue'(value) {}", "function checkValue(value, defaultValue) {\n return (value ? value : defaultValue)\n }", "function validateInput(\n value,\n { float, canBeNegative, canBeEmpty, defaultValue }\n) {\n if (`${value}`.length > 0) {\n const valueAsNumber = float ? parseFloat(value) : pa...
[ "0.7436162", "0.6856192", "0.65868", "0.6431272", "0.64279246", "0.64279246", "0.6416799", "0.6416799", "0.6416799", "0.6316331", "0.6230596", "0.6195563", "0.616348", "0.61238676", "0.6050824", "0.6044303", "0.6036909", "0.59743184", "0.59359854", "0.58691984", "0.58653325",...
0.0
-1
Implements a host component that allows optionally setting the props `value` and `defaultValue`. If `multiple` is false, the prop must be a stringable. If `multiple` is true, the prop must be an array of stringables. If `value` is not supplied (or null/undefined), user actions that change the selected option will trigg...
function getHostProps$2(element,props){return _assign({},props,{value:undefined});}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectValueType(props,propName,componentName){if(props[propName]==null){return null;}if(props.multiple){if(!Array.isArray(props[propName])){return new Error(\"The `\"+propName+\"` prop supplied to <select> must be an array if \"+\"`multiple` is true.\");}}else {if(Array.isArray(props[propName])){return ne...
[ "0.60985404", "0.6063396", "0.5824173", "0.5824173", "0.57353365", "0.5712244", "0.57057315", "0.57057315", "0.57057315", "0.57057315", "0.57057315", "0.56855667", "0.56825453", "0.5640067", "0.56325287", "0.56325287", "0.56325287", "0.56325287", "0.56325287", "0.56325287", "...
0.0
-1
Implements a host component that allows setting `value`, and `defaultValue`. This differs from the traditional DOM API because value is usually set as PCDATA children. If `value` is not supplied (or null/undefined), user actions that affect the value will trigger updates to the element. If `value` is supplied (and not ...
function getHostProps$3(element,props){var node=element;!(props.dangerouslySetInnerHTML==null)?invariant(false,'`dangerouslySetInnerHTML` does not make sense on <textarea>.'):void 0;// Always set children to the same thing. In IE9, the selection range will // get reset if `textContent` is mutated. We could add a check...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set value(val) {\n if (this.#el) this.#el.value = val;\n else this.#value = val;\n }", "setValue(value){\n const thisWidget = this;\n const newValue = thisWidget.parseValue(value);\n \n /* TODO: Add validation */\n if(newValue !=thisWidget.value && thisWidget.isValid(newValue)){\n this...
[ "0.64213157", "0.5995463", "0.59781355", "0.59781355", "0.59781355", "0.59781355", "0.59781355", "0.59781355", "0.59781355", "0.5954646", "0.5930495", "0.5902076", "0.588062", "0.588062", "0.588062", "0.588062", "0.588062", "0.588062", "0.588062", "0.5823171", "0.57667893", ...
0.0
-1
Assumes there is no parent namespace.
function getIntrinsicNamespace(type){switch(type){case'svg':return SVG_NAMESPACE;case'math':return MATH_NAMESPACE;default:return HTML_NAMESPACE$1;}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getParentObject(){\r\n var obj = parent;\r\n if (namespace !== \"\") {\r\n for (var i = 0, ii = namespace.split(\".\"); i < ii.length; i++) {\r\n obj = obj[ii[i]];\r\n }\r\n }\r\n return obj.easyXDM;\r\n}", "function namespaceHTMLInternal() {\n instructionState.lF...
[ "0.59294087", "0.5788852", "0.5788852", "0.5788852", "0.5788852", "0.5788852", "0.5788852", "0.57438385", "0.56890935", "0.5673484", "0.56610936", "0.5640146", "0.5580239", "0.544239", "0.5442175", "0.5410278", "0.5397606", "0.53690296", "0.53592485", "0.5327534", "0.532705",...
0.0
-1
Hyphenates a camelcased CSS property name, for example: > hyphenateStyleName('backgroundColor') hyphenateStyleName('MozTransition') hyphenateStyleName('msTransition') < "mstransition" As Modernizr suggests ( an `ms` prefix is converted to `ms`.
function hyphenateStyleName(name){return name.replace(uppercasePattern,'-$1').toLowerCase().replace(msPattern,'-ms-');}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "function hyphenateStyleName(name) {\n return n...
[ "0.7950004", "0.7950004", "0.7950004", "0.7950004", "0.7950004", "0.7950004", "0.7950004", "0.7950004", "0.7950004", "0.7950004", "0.7950004", "0.7950004", "0.7950004", "0.7950004", "0.7950004", "0.7950004", "0.7950004", "0.7950004", "0.7950004", "0.7950004", "0.7950004", "...
0.8186882
4
Operations for dealing with CSS properties. This creates a string that is expected to be equivalent to the style attribute generated by serverside rendering. It bypasses warnings and security checks so it's not safe to use this value for anything other than comparison. It is only used in DEV for SSR validation.
function createDangerousStringForStyles(styles){{var serialized='';var delimiter='';for(var styleName in styles){if(!styles.hasOwnProperty(styleName)){continue;}var styleValue=styles[styleName];if(styleValue!=null){var isCustomProperty=styleName.indexOf('--')===0;serialized+=delimiter+hyphenateStyleName(styleName)+':';...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get styles () {\n return css`${unsafeCSS(style)}`\n }", "get cssText() {\n var properties = [];\n for (var i = 0, length = this.length; i < length; ++i) {\n var name = this[i];\n var value = this.getPropertyValue(name);\n var priority = this.getPropertyPriority(name);\n if (p...
[ "0.6746066", "0.6613922", "0.6602744", "0.6524541", "0.6524541", "0.6438197", "0.6406999", "0.63668555", "0.62984747", "0.6197879", "0.6182385", "0.6169909", "0.61696804", "0.61696804", "0.61656594", "0.61147296", "0.60756344", "0.60756344", "0.60755336", "0.60755336", "0.607...
0.5843909
62
Renderers that don't support persistence can reexport everything from this module.
function shim(){invariant(false,'The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.');}// Persistence (when unsupported)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shim() {\n invariant(false, 'The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.');\n } // Persistence (when unsupported)", "function shim() {\n invariant(false, 'The current renderer does not support persistence. This erro...
[ "0.6056067", "0.6056067", "0.6056067", "0.6020133", "0.6020133", "0.6020133", "0.6020133", "0.58904916", "0.5828549", "0.5826907", "0.5709882", "0.5709882", "0.5657355", "0.5584319", "0.5584319", "0.5584319", "0.5584319", "0.5584319", "0.5584319", "0.5584319", "0.5584319", ...
0.62715775
2
1 unit of expiration time represents 10ms.
function msToExpirationTime(ms){// Always add an offset so that we don't clash with the magic number for NoWork. return MAGIC_NUMBER_OFFSET-(ms/UNIT_SIZE|0);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function msToExpirationTime(ms){// Always add an offset so that we don't clash with the magic number for NoWork.\nreturn(ms/UNIT_SIZE|0)+MAGIC_NUMBER_OFFSET;}", "function msToExpirationTime(ms){// Always add an offset so that we don't clash with the magic number for NoWork.\nreturn(ms/UNIT_SIZE|0)+MAGIC_NUMBER_O...
[ "0.69083685", "0.69083685", "0.69083685", "0.69083685", "0.6728504", "0.66832036", "0.66832036", "0.66832036", "0.6663674", "0.66431606", "0.66385615", "0.65983444", "0.65983444", "0.65983444", "0.6567885", "0.65556103", "0.65173113", "0.6494671", "0.6494671", "0.6494671", "0...
0.68177795
4
The following attributes are only used by interaction tracing builds. They enable interactions to be associated with their async work, And expose interaction metadata to the React DevTools Profiler plugin. Note that these attributes are only defined when the enableSchedulerTracing flag is enabled. Exported FiberRoot ty...
function createFiberRoot(containerInfo,isConcurrent,hydrate){// Cyclic construction. This cheats the type system right now because // stateNode is any. var uninitializedFiber=createHostRootFiber(isConcurrent);var root=void 0;if(enableSchedulerTracing){root={current:uninitializedFiber,containerInfo:containerInfo,pending...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createFiberRoot(containerInfo,isConcurrent,hydrate){// Cyclic construction. This cheats the type system right now because\n// stateNode is any.\nvar uninitializedFiber=createHostRootFiber(isConcurrent);var root=void 0;{root={current:uninitializedFiber,containerInfo:containerInfo,pendingChildren:null,earli...
[ "0.5403074", "0.501894", "0.501894", "0.50066847", "0.50066847", "0.49931163", "0.49931163", "0.49931163", "0.49931163", "0.49931163", "0.49729648", "0.49729648", "0.49729648", "0.49729648", "0.49729648", "0.49729648", "0.49729648", "0.49729648", "0.49729648", "0.49729648", "...
0.57750165
0
TODO: Offscreen updates should never suspend. However, a promise that suspended inside an offscreen subtree should be able to ping at the priority of the outer render.
function markPendingPriorityLevel(root,expirationTime){// If there's a gap between completing a failed root and retrying it, // additional updates may be scheduled. Clear `didError`, in case the update // is sufficient to fix the error. root.didError=false;// Update the latest and earliest pending times var earliestPen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "if (\n workInProgressSuspendedReason === SuspendedOnData &&\n workInProgressRoot === root\n ) {\n // Mark the root as ready to continue rendering.\n workInProgressSuspendedReason = SuspendedAndReadyToContinue;\n }", "async _enq...
[ "0.6279164", "0.5831592", "0.5645547", "0.5618422", "0.5553275", "0.5536617", "0.5518966", "0.54060096", "0.5393215", "0.53856635", "0.5385072", "0.53362244", "0.53362244", "0.5301369", "0.52907246", "0.5246852", "0.5243641", "0.52426386", "0.52426386", "0.5228701", "0.522870...
0.48313922
89
to be able to optimize each path individually by branching early. This needs a compiler or we can do it manually. Helpers that don't need this branching live outside of this function.
function ChildReconciler(shouldTrackSideEffects){function deleteChild(returnFiber,childToDelete){if(!shouldTrackSideEffects){// Noop. return;}// Deletions are added in reversed order so we add it to the front. // At this point, the return fiber's effect list is empty except for // deletions, so we can just append the d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "optimiseSetOperation(path, nextValue) {\n // console.log('optimiseSetOperation', path, nextValue)\n // If target value is not a plain value, unable to optimise\n if (typeof nextValue === 'object') {\n // console.log(\"Not optimisable because next value is object\")\n return false;\n } // Chec...
[ "0.56938905", "0.55985314", "0.5439052", "0.5374248", "0.53719616", "0.5370415", "0.53631437", "0.53431183", "0.5274606", "0.5250422", "0.5237999", "0.5236706", "0.521821", "0.52163726", "0.5207558", "0.52072245", "0.5190481", "0.5186431", "0.5182813", "0.5167651", "0.5149536...
0.0
-1
Warns if there is a duplicate or missing key
function warnOnInvalidKey(child,knownKeys){{if((typeof child==='undefined'?'undefined':_typeof(child))!=='object'||child===null){return knownKeys;}switch(child.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:warnForMissingKey(child);var key=child.key;if(typeof key!=='string'){break;}if(knownKeys===null){knownK...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkDuplicates(error) {\n if (error.name === \"MongoError\" && error.code === 11000) {\n // check if the error from Mongodb is duplication error\n // eslint-disable-next-line no-useless-escape\n const regex = /index\\:\\ (?:.*\\.)?\\$?(?:([_a-z0-9]*)(?:_\\d*)|([_a-z0-9]*))\\s*dup key/i;\n c...
[ "0.64586234", "0.63743407", "0.62774295", "0.61566454", "0.61478174", "0.61425227", "0.61372644", "0.61251426", "0.61251426", "0.6114083", "0.6114083", "0.6114083", "0.61133426", "0.61059004", "0.6096614", "0.60936666", "0.6082668", "0.5989997", "0.59782195", "0.59782195", "0...
0.61219513
9
itself. They will be added to the sideeffect list as we pass through the children and the parent.
function reconcileChildFibers(returnFiber,currentFirstChild,newChild,expirationTime){// This function is not recursive. // If the top level item is an array, we treat it as a set of children, // not as a fragment. Nested arrays on the other hand will be treated as // fragment nodes. Recursion happens at the normal flow...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ChildReconciler(shouldTrackSideEffects) {\n function deleteChild(returnFiber, childToDelete) {\n if (!shouldTrackSideEffects) // Noop.\n return;\n // Deletions are added in reversed order so we add it to the front.\n // At this point, the return fiber's ...
[ "0.6270052", "0.6207396", "0.61424965", "0.61410725", "0.61407506", "0.61407506", "0.61407506", "0.6133052", "0.6133052", "0.6133052", "0.6133052", "0.61278206", "0.61278206", "0.61144173", "0.6083676", "0.60557383", "0.60557383", "0.60557383", "0.60557383", "0.60513395", "0....
0.0
-1
By default, return `true` to log errors to the console. Forks can return `false` if this isn't desirable.
function showErrorDialog(capturedError){return true;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function log (msg : string, err : any = false) : boolean {\n\tif (QUIET) return false\n\tif (err) {\n\t\tconsole.error(msg, err)\n\t} else {\n\t\tconsole.log(msg)\n\t}\n\treturn true\n}", "isErr() {\n return true;\n }", "isErr() {\n return false;\n }", "function logError(err) { if(console...
[ "0.5841752", "0.5626627", "0.54532874", "0.5435985", "0.5388693", "0.52739596", "0.52606153", "0.521972", "0.52030414", "0.52020115", "0.5161493", "0.51220864", "0.50915825", "0.50780183", "0.5064728", "0.5037048", "0.5015287", "0.50104046", "0.4995979", "0.4994261", "0.49851...
0.0
-1
Capture errors so they don't interrupt unmounting.
function safelyCallComponentWillUnmount(current$$1,instance){{invokeGuardedCallback(null,callComponentWillUnmountWithTimer,null,current$$1,instance);if(hasCaughtError()){var unmountError=clearCaughtError();captureCommitPhaseError(current$$1,unmountError);}}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "simulateUnmount() {\n this.volumeUnmountListener(this.volumeInfo_.volumeId);\n }", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)errorOrDestroy(dest,er);}// Make sure our error handler is attached before userland ones.", "functi...
[ "0.6382642", "0.5924542", "0.58511907", "0.58511907", "0.58511907", "0.58496785", "0.5823018", "0.5823018", "0.5823018", "0.5767682", "0.5741241", "0.5741241", "0.5741241", "0.5741241", "0.5741241", "0.56881076", "0.56881076", "0.56589913", "0.56378233", "0.56378233", "0.5637...
0.57305086
16
deletion, so don't let them throw. Hostoriginating errors should interrupt deletion, so it's okay
function commitUnmount(current$$1){onCommitUnmount(current$$1);switch(current$$1.tag){case FunctionComponent:case ForwardRef:case MemoComponent:case SimpleMemoComponent:{var updateQueue=current$$1.updateQueue;if(updateQueue!==null){var lastEffect=updateQueue.lastEffect;if(lastEffect!==null){var firstEffect=lastEffect.n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteErrHandler(error, result) {\n\tif (error) {\n\t\tlog(\"cannot delete data\")\n\t\tthrow error\n\t} else {\n\t\tlog(\"Delete Success\") \n\t}\n}", "remove () {\n // cleanup\n }", "delete() {}", "detach() {\n throw new Error('Not Implemented');\n }", "detach() {\n throw new Er...
[ "0.65547734", "0.6395657", "0.6280557", "0.6153434", "0.6153434", "0.60908616", "0.60908616", "0.60645497", "0.60639924", "0.60639924", "0.5951789", "0.5949893", "0.59108114", "0.5875467", "0.5855062", "0.5827057", "0.5824024", "0.58122593", "0.58100647", "0.5797361", "0.5781...
0.0
-1
onYield is called upon exiting. We use these in lieu of returning a tuple. I've also chosen not to inline them into renderRoot because these will eventually be lifted into the renderer.
function onFatal(root){root.finishedWork=null;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "exitYield_stmt(ctx) {\n\t}", "exitYield_expr(ctx) {\n\t}", "function hzYield() {\n\t\treturn t.callExpression(\n\t\t\tt.memberExpression(\n\t\t\t\tt.identifier(\"hzUserLib\"),\n\t\t\t\tt.identifier(\"yield\")\n\t\t\t),\n\t\t\t[t.ObjectExpression([\n\t\t\t\tt.ObjectProperty(t.identifier(\"value\"), t.identifier...
[ "0.56866634", "0.5684245", "0.5497083", "0.5296737", "0.5290775", "0.52903396", "0.52688825", "0.5127838", "0.5015035", "0.49599028", "0.49599028", "0.49599028", "0.49599028", "0.4956098", "0.49541187", "0.49217808", "0.4916253", "0.48688143", "0.48666376", "0.48553962", "0.4...
0.0
-1
It's up to the renderer to call renderRoot at some point in the future.
function requestWork(root,expirationTime){addRootToSchedule(root,expirationTime);if(isRendering){// Prevent reentrancy. Remaining work will be scheduled at the end of // the currently rendering batch. return;}if(isBatchingUpdates){// Flush work at the end of the batch. if(isUnbatchingUpdates){// ...unless we're inside ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_render() {\n this._reactComponent = this._getReactComponent();\n if (!this._root) this._root = createRoot(this._container.getElement()[0]);\n this._root.render(this._reactComponent);\n }", "_renderNewRootComponent(/* instance, ... */) { }", "function completeRender() {\n\t\t\t\t\t\tvar...
[ "0.7567403", "0.734714", "0.7108107", "0.7062153", "0.6986511", "0.69759756", "0.6908444", "0.6891713", "0.6869012", "0.6835855", "0.67799586", "0.6750756", "0.67459285", "0.6744858", "0.66837424", "0.6667817", "0.6663176", "0.66528493", "0.6623243", "0.6623243", "0.6623243",...
0.0
-1
Don't add it. See `./inlinetyped.js` for an explanation.
function createPortal$1(children,containerInfo,// TODO: figure out the API for cross-renderer implementation. implementation){var key=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;return{// This tag allow us to uniquely identify this as a React Portal $$typeof:REACT_PORTAL_TYPE,key:key==null?null:''+ke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ignore() { }", "function notInlineUseCase() { console.log('Not an inline use case');}", "function IGNORE() {\r\n //Do not delete.\r\n }", "get Ignore() {}", "function skipHello(){saidHello=true;}", "function reserved(){}", "function Noop() {}", "function Noop() {}", "function Noo...
[ "0.68530124", "0.62983644", "0.61769766", "0.6062427", "0.60414135", "0.5965747", "0.59498113", "0.59498113", "0.59498113", "0.59405136", "0.59405136", "0.5831074", "0.5831074", "0.5831074", "0.5831074", "0.5831074", "0.5831074", "0.5831074", "0.580174", "0.579486", "0.578146...
0.0
-1
AsyncMode should be deprecated
function isAsyncMode(object) { { if (!hasWarnedAboutDeprecatedIsAsyncMode) { hasWarnedAboutDeprecatedIsAsyncMode = true; lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setAsync(){\n this.async = true;\n }", "function isAsyncMode(object){{if(!hasWarnedAboutDeprecatedIsAsyncMode){hasWarnedAboutDeprecatedIsAsyncMode=true;lowPriorityWarning$1(false,'The ReactIs.isAsyncMode() alias has been deprecated, '+'and will be removed in React 17+. Update your code to use '+'ReactI...
[ "0.71772456", "0.71477026", "0.71477026", "0.71477026", "0.707457", "0.6901749", "0.6824169", "0.6809441", "0.6809441", "0.6793582", "0.6785743", "0.67846984", "0.6757779", "0.6750946", "0.6745032", "0.6745032", "0.67303115", "0.6702358", "0.6701896", "0.6701896", "0.6701896"...
0.67276573
22
connect is a facade over connectAdvanced. It turns its args into a compatible selectorFactory, which has the signature: (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps connect passes its args to connectAdvanced as options, which will in turn pass them to selectorFactory each time a Connect component ...
function match(arg, factories, name) { for (var i = factories.length - 1; i >= 0; i--) { var result = factories[i](arg); if (result) return result; } return function (dispatch, options) { throw new Error("Invalid value of type " + (typeof arg === "undefined" ? "undefined" : _typeof(arg)) + " for " + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createConnect() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapS...
[ "0.7501837", "0.75000197", "0.74194384", "0.74194384", "0.74166214", "0.7413978", "0.7372918", "0.7372918", "0.7372918", "0.7372918", "0.7372918", "0.7372918", "0.7372918", "0.73706967", "0.73706967", "0.73706967", "0.73706967", "0.73284143", "0.73284143", "0.73284143", "0.73...
0.0
-1
different options opens up some testing and extensibility scenarios
function createConnect(_temp) { var _ref = _temp === void 0 ? {} : _temp, _ref$connectHOC = _ref.connectHOC, connectHOC = _ref$connectHOC === void 0 ? _connectAdvanced2.default : _ref$connectHOC, _ref$mapStateToPropsF = _ref.mapStateToPropsFactories, mapStateToPropsFactories = _ref$mapStateToP...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testOptions ( options ) {\n\n\t\t// To prove a fix for #537, freeze options here.\n\t\t// If the object is modified, an error will be thrown.\n\t\t// Object.freeze(options);\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tpadding: 0,\n\t\t\tanimate: true,\n\t\t\tanimationDuration: 300,\n\t...
[ "0.6037481", "0.60318357", "0.60318357", "0.59998536", "0.5954973", "0.5954973", "0.5954973", "0.59449977", "0.59152806", "0.5906259", "0.5872966", "0.5872966", "0.58575654", "0.5854597", "0.5854597", "0.5834004", "0.5834004", "0.5827216", "0.5819405", "0.5818854", "0.5802200...
0.0
-1
If pure is true, the selector returned by selectorFactory will memoize its results, allowing connectAdvanced's shouldComponentUpdate to return false if final props have not changed. If false, the selector will always return a new object and shouldComponentUpdate will always return true.
function finalPropsSelectorFactory(dispatch, _ref2) { var initMapStateToProps = _ref2.initMapStateToProps, initMapDispatchToProps = _ref2.initMapDispatchToProps, initMergeProps = _ref2.initMergeProps, options = (0, _objectWithoutPropertiesLoose3.default)(_ref2, ["initMapStateToProps", "initMapDispat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function finalPropsSelectorFactory(dispatch, _ref2) {\n\t var initMapStateToProps = _ref2.initMapStateToProps,\n\t initMapDispatchToProps = _ref2.initMapDispatchToProps,\n\t initMergeProps = _ref2.initMergeProps,\n\t options = _objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatch...
[ "0.5797441", "0.5797441", "0.57838345", "0.57838345", "0.57838345", "0.57836396", "0.57836396", "0.57836396", "0.57836396", "0.576929", "0.576929", "0.5766167", "0.5763229", "0.5762632", "0.5762632", "0.5762632", "0.5762632", "0.5762632", "0.5762632", "0.5762632", "0.5762632"...
0.0
-1
to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine whether mapToProps needs to be invoked when props have changed. A length of one signals that mapToProps does not depend on props from the parent component. A length of zero is assumed to mean mapToProps is getting args via a...
function getDependsOnOwnProps(mapToProps) { return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1; } // Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapToProps() {\n return {};\n}", "function mapToProps() {\n return {};\n}", "function wrapMapToPropsFunc(mapToProps,methodName){return function initProxySelector(dispatch,_ref){var displayName=_ref.displayName;var proxy=function mapToPropsProxy(stateOrDispatch,ownProps){return proxy.dependsOnOwn...
[ "0.6489741", "0.6489741", "0.6218233", "0.606265", "0.590817", "0.5817902", "0.5804757", "0.5800119", "0.5768706", "0.5768706", "0.5768706", "0.5768706", "0.5768706", "0.5763125", "0.5763125", "0.5763125", "0.5763125", "0.5747114", "0.5740582", "0.5734682", "0.5734682", "0....
0.0
-1
this function wraps mapToProps in a proxy function which does several things: Detects whether the mapToProps function being called depends on props, which is used by selectorFactory to decide if it should reinvoke on props changes. On first call, handles mapToProps if returns another function, and treats that new funct...
function wrapMapToPropsFunc(mapToProps, methodName) { return function initProxySelector(dispatch, _ref) { var displayName = _ref.displayName; var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) { return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy....
[ "0.78341955", "0.78341955", "0.78341955", "0.78341955", "0.78341955", "0.7808309", "0.77904975", "0.77780414", "0.7770664", "0.7768067", "0.77630585", "0.77630585", "0.77630585", "0.77630585", "0.77630585", "0.77630585", "0.77630585", "0.7734753", "0.77338624", "0.77272743", ...
0.772841
19
Base class helpers for the updating state of a component.
function Component(props, context, updater) { this.props = props; this.context = context; // If a component has string refs, we will assign a different object later. this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the // renderer. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n BaseState.update.call(this);\n }", "_update() {\n // Call subclass lifecycle method\n const stateNeedsUpdate = this.needsUpdate();\n // End lifecycle method\n debug(TRACE_UPDATE, this, stateNeedsUpdate);\n\n if (stateNeedsUpdate) {\n this._updateState();\n }\n }", "func...
[ "0.7217204", "0.67610246", "0.66769236", "0.66106635", "0.6540022", "0.65259355", "0.6489663", "0.64705694", "0.645821", "0.63847154", "0.6354757", "0.63347685", "0.63053316", "0.6304944", "0.62717897", "0.6266675", "0.621649", "0.6214279", "0.6194085", "0.6189877", "0.615812...
0.0
-1
Convenience component with default shallow equality check for sCU.
function PureComponent(props, context, updater) { this.props = props; this.context = context; // If a component has string refs, we will assign a different object later. this.refs = emptyObject; this.updater = updater || ReactNoopUpdateQueue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useStrictEquality(b, a) {\n return a === b;\n }", "get shallowCopy() {\n return this.shallowCopy$();\n }", "function defaultEqualityCheck(a, b) {\n return !a && !b || a === b;\n }", "equals() {\n return false;\n }", "equals() {\n return false;\n }", ...
[ "0.60843265", "0.57952434", "0.5671108", "0.56589365", "0.56589365", "0.5633363", "0.5590532", "0.5590532", "0.5586668", "0.5547976", "0.54892313", "0.5485994", "0.5483492", "0.5483492", "0.5474289", "0.5474289", "0.5474289", "0.54541457", "0.54541457", "0.544192", "0.5399826...
0.0
-1
an immutable object with a single mutable value
function createRef() { var refObject = { current: null }; { Object.seal(refObject); } return refObject; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function immutableObjectTest(){\n\nlet test= {'name': 'vishal', 'age':27};\n//Object.freeze(test);\nlet test2= test;\n\ntest.age = 26;\nconsole.log(test);\nconsole.log(test2);\nconsole.log(test === test2);\n\n\n\n\n}", "static set one(value) {}", "function makeImmutableObject(obj) {\n\t if (!globalConfig.us...
[ "0.6674448", "0.66609514", "0.6358345", "0.6347869", "0.6347869", "0.6263268", "0.6230736", "0.6136926", "0.61048114", "0.5915378", "0.5889688", "0.580687", "0.5776291", "0.5763881", "0.57248324", "0.56947106", "0.566211", "0.5636481", "0.56181127", "0.5606209", "0.5606209", ...
0.0
-1
Create and return a new ReactElement of the given type. See
function createElement(type, config, children) { var propName = void 0; // Reserved names are extracted var props = {}; var key = null; var ref = null; var self = null; var source = null; if (config != null) { if (hasValidRef(config)) { ref = config.r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createElement(type,config,children){var propName;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;{warnIfStringRefCannotBeAutoConverted(config);}}if(hasValidKey(config)){key=''+config.key;}self=con...
[ "0.68920434", "0.6835192", "0.6767826", "0.6757532", "0.6745889", "0.6745889", "0.6745889", "0.6745889", "0.6745889", "0.6745889", "0.6745889", "0.6745889", "0.6745889", "0.65640503", "0.65581757", "0.6406998", "0.6406998", "0.6406998", "0.6406998", "0.6406998", "0.63805515",...
0.0
-1
Return a function that produces ReactElements of a given type. See
function cloneAndReplaceKey(oldElement, newKey) { var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); return newElement; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getElementConstructor(type) {\n return JSXElement;\n }", "wrap(type = this.type, props) {\n if (props) {\n if (typeof props === \"string\") props = { className: props };\n else props = this.normalizeProps(props);\n }\n this.elements = [ React.createElement(type, props, ...this.elements) ];...
[ "0.68819296", "0.6601521", "0.65016764", "0.65016764", "0.65016764", "0.65016764", "0.65016764", "0.65016764", "0.65016764", "0.65016764", "0.65016764", "0.6265616", "0.6179337", "0.594783", "0.59200126", "0.58835655", "0.5865281", "0.57792324", "0.5642274", "0.5633928", "0.5...
0.0
-1
Clone and return a new ReactElement using element as the starting point. See
function cloneElement(element, config, children) { !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0; var propName = void 0; // Original props are copied var props = _assign({}...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cloneElement(element,config,children){if(!!(element===null||element===undefined)){{throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \"+element+\".\");}}var propName;// Original props are copied\nvar props=_assign({},element.props);// Reserved names are extracted\...
[ "0.69129634", "0.68905437", "0.6693122", "0.6693122", "0.66918975", "0.664537", "0.664537", "0.664537", "0.664537", "0.664537", "0.664537", "0.664537", "0.664537", "0.664537", "0.664537", "0.664537", "0.664537", "0.664537", "0.6632562", "0.6612735", "0.6612735", "0.6612735"...
0.6517866
100
Flatten a children object (typically specified as `props.children`) and return an array with appropriately rekeyed children. See
function toArray(children) { var result = []; mapIntoWithKeyPrefixInternal(children, result, null, function (child) { return child; }); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toArrayChildren(children) {\n var ret = [];\n React__default.Children.forEach(children, function (child) {\n ret.push(child);\n });\n return ret;\n }", "function toArray(children){var result=[];mapIntoWithKeyPrefixInternal(children,result,null,function(child){return child;}...
[ "0.77542424", "0.75192744", "0.743348", "0.74058104", "0.74058104", "0.74058104", "0.74058104", "0.74058104", "0.74058104", "0.7396765", "0.7396765", "0.7396765", "0.7395814", "0.7395814", "0.7395814", "0.7395814", "0.7395814", "0.7395814", "0.7395814", "0.7395814", "0.738232...
0.73997086
23
This is a dummy function to check if the function name has been altered by minification. If the function has been minified and NODE_ENV !== 'production', warn the user.
function isCrushed() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uglify(name) {\n console.log(\"Hello \" + name);\n}", "function keepNonMinified(file) {\n\tvar keep = true;\n\tif(file.path.match('.js$')) {\n\t\tvar minPath = file.path.replace('.js', '.min.js');\n\t\tkeep = !exists(minPath);\n\t}\n\treturn keep;\n}", "function markFuncFreeze(fun, opt_name) {\n /...
[ "0.60268617", "0.57781506", "0.5717464", "0.5680803", "0.5680803", "0.5637184", "0.5637184", "0.5621175", "0.5575853", "0.5548215", "0.5529817", "0.5520376", "0.5520376", "0.5520376", "0.5520376", "0.5520376", "0.55096394", "0.5493174", "0.5485926", "0.54793435", "0.54786927"...
0.0
-1