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 fade out menu and go to the game page.
function playFunction() { $(document).ready(function () { $("#newgame").click(function () { $("#menu").fadeOut("500"); }); }); gamecount = 0; wincount = 0; losecount = 0; document.getElementById("wincount").innerHTML = 'Win Count: ' + wincount; document.getElement...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function goToMenu() {\n stopTTS();\n cStatus = undefined;\n cStatus = new CurrentStatus();\n $('#quiz').hide('slow');\n $('#game').hide('slow');\n $('#menu').show('slow');\n}", "function pauseGame()\n {\n toMenu();\n }", "function startGame() {\n $(menu).animate({ opacity: \"0\" }, 800, f...
[ "0.7328642", "0.7245241", "0.7085339", "0.7050445", "0.69972986", "0.6991285", "0.6927603", "0.6917915", "0.6866738", "0.68317753", "0.67675936", "0.6735646", "0.672853", "0.665933", "0.6648439", "0.6643567", "0.6585244", "0.65846074", "0.65845436", "0.65700346", "0.656561", ...
0.0
-1
logic for highscore board
function highscoreFunction() { var txt; var i; $("#\\scoreboard").modal({ backdrop: 'static', keyboard: false, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newHighScore()\n{\n if(score>highScores[0].score||score>highScores[1].score||score>highScores[2].score)\n {\n console.log((\"\\n \")+chalk.bold.bgRed(\" Wow! You have made a new high score! \\n Send me a screenshot and I'll update it. \"));\n }\n}", "function checkForHighscore(score) {\n ...
[ "0.7123785", "0.70328623", "0.69122916", "0.68067896", "0.67713684", "0.67246914", "0.6709439", "0.66645813", "0.6648419", "0.6621909", "0.6609624", "0.6562712", "0.6536996", "0.65350056", "0.6504344", "0.6498695", "0.6493012", "0.64906603", "0.6482026", "0.6481267", "0.64766...
0.0
-1
close game tab function
function quitFunction() { self.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeTab1() {\n // close rocket section\n descriptionRocketEarth.classList.remove('displayYes')\n descriptionRocketEarth.classList.add('displayNone')\n imgChevronRockEarth.src = 'images/earthChevron.png'\n //close datas sections\n descriptionDatasEarth.classList.r...
[ "0.7548923", "0.75136507", "0.73678553", "0.73230976", "0.730451", "0.7261084", "0.7232483", "0.7175669", "0.7034781", "0.7019329", "0.697715", "0.69439256", "0.6923937", "0.6893786", "0.68709594", "0.68289346", "0.68255574", "0.68157876", "0.6809333", "0.6802496", "0.6786141...
0.6470026
56
recover password component module
function recoveryComponentModule(app){ //recovery component controller function recoveryComponentController(AuthService){ let vm = this; vm.email = ""; //email in form //method on form submit that calls RecoverAcc in AuthService vm.recoverAccount = ()=>{ AuthServic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleRecoverPassword(){\n if(emailValid()){\n console.log(`send me my password to: ${email}`)\n setEmail('')\n }else{\n console.log('invalid')\n }\n }", "recoverPassword({ Bert }, { email }) {\n // Call forgot password procedure\n Accounts....
[ "0.7155374", "0.6810902", "0.6676745", "0.65880895", "0.6587489", "0.64969546", "0.64703214", "0.645708", "0.6425438", "0.6401412", "0.6400371", "0.6360507", "0.635255", "0.6336568", "0.6303662", "0.6300037", "0.62983185", "0.62324506", "0.6221762", "0.61801714", "0.61787707"...
0.0
-1
No comments for easy reading
function insertionSortList2(head) { var before = { val: -Number.MAX_VALUE, next: null}; while(head) { var prev = before; while (prev.next && prev.next.val < head.val){ prev = prev.next; } var next = head.next; head.next = prev.next; prev.next = head; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static tag_lines(raw)\r\n {\r\n let lines = [];\r\n let next_is_def = false;\r\n let in_code_block = false;\r\n let in_quote_block = false;\r\n for (const [index, value] of raw.entries())\r\n {\r\n let trimmed = value.trim();\r\n if (in_code_block)...
[ "0.58495355", "0.5803348", "0.57868963", "0.57212806", "0.5702927", "0.56188065", "0.56148475", "0.5565247", "0.5534841", "0.55209875", "0.54988766", "0.548868", "0.5470517", "0.5463618", "0.5424826", "0.54241437", "0.5405398", "0.5369727", "0.5365642", "0.5360932", "0.536093...
0.0
-1
grab data, add to array of objects, make card, display draw winner area
function submitEntry(){ let name = document.getElementById("userName").value.trim(); let initTickets = Number(document.getElementById("userInitialTickets").value) || 0; let dollar = Number(document.getElementById("userDollar").value) || 0; let bits = Number(document.getElementById("userBits").value) || 0; let...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawCard(data) {\n document.getElementById('calledUNO').style.display = 'none';\n document.getElementById('unoButton').style.display = 'block';\n\n //reorganize own cards\n ownCards = $('#ownCards');\n ownCards.html(\"\");\n document.getElementById('minEmptyIndex').value = 0;\n var ca...
[ "0.69330204", "0.69246954", "0.69133747", "0.6834875", "0.681623", "0.6814937", "0.67477065", "0.6720912", "0.6637267", "0.65678704", "0.65428907", "0.6538546", "0.6533249", "0.65231067", "0.649713", "0.64457744", "0.64450216", "0.6444737", "0.64265347", "0.641213", "0.640797...
0.0
-1
will round down values so fractions do not count
function ticketCalc(dollar, bits, currency, subs, initTickets){ let tickets = initTickets; tickets += (ticketRates.dollar == "NA") ? 0 : Math.floor(dollar/ticketRates.dollar) tickets += (ticketRates.bits == "NA") ? 0 : Math.floor(bits/ticketRates.bits) tickets += (ticketRates["stream currency"] == "N...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function downRound(v) {\n return Math.round(v - 0.0001);\n }", "function HGC_roundup(value) {\n\tvar decplaces = config.get(\"hgc_decimal_places\", 5);\n\treturn Math.ceil(value * Math.pow(10, decplaces)) / Math.pow(10, decplaces);\n}", "function halfUp(x) { return Math.round(x) + 0.5; }", "functi...
[ "0.7114212", "0.68771094", "0.6848786", "0.68329406", "0.6832635", "0.68077207", "0.6610203", "0.66001457", "0.65814084", "0.6555856", "0.64515257", "0.6434062", "0.6429245", "0.6322141", "0.631518", "0.62928647", "0.6256463", "0.62521774", "0.62490284", "0.6244883", "0.62365...
0.0
-1
for deleting a single number
delete(){ this.currentOperand = this.currentOperand.toString().slice(0, -1) /** * How do you slice in JavaScript? The slice() method extracts parts of a string and returns the extracted parts in a new string. Use the start and end parameters to specify the part of the string you want to extract. The first ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteNumber() {\n screen.textContent = screen.textContent.toString().slice(0, -1);\n}", "deleteNumber() {\n //Sets curent operand equal to the current operand\n //toString() method -> converts number into a string\n //.slice() method -> removes the last value of a string(from 0 index to the...
[ "0.7225542", "0.7225446", "0.7170927", "0.6885198", "0.6772567", "0.6742457", "0.67097545", "0.6609527", "0.6565477", "0.6382393", "0.6362471", "0.6336478", "0.63081515", "0.6301464", "0.6273189", "0.62593716", "0.62360257", "0.62306446", "0.61970544", "0.61943525", "0.618445...
0.0
-1
to add number to the string when user clicks/inputs number
appendNumber(number){ if(number === "." && this.currentOperand.includes(".")) return this.currentOperand = this.currentOperand.toString() + number.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addNumber(event){ \n let str = event.target.id;\n number = str.charAt(3);\n let text =document.getElementById(\"txt\");\n text.value=text.value+number; \n \n}", "function putNumber(num){ // for buttons\n line.value = line.value + num.toString();\n}", "function handleNumberClick(i...
[ "0.80559736", "0.77709985", "0.75599927", "0.7516603", "0.7348646", "0.7347798", "0.71824384", "0.7138211", "0.70573103", "0.7053683", "0.7039533", "0.7033913", "0.70004", "0.69940555", "0.6981371", "0.6966487", "0.6965832", "0.6962009", "0.69606733", "0.6953506", "0.69247085...
0.0
-1
to update the value inside of the output
updateDisplay(){ this.currentOperandTextElement.innerText = this.getDisplayNumber(this.currentOperand) if(this.operation != null) { this.previousOperandTextElement.innerText = `${this.getDisplayNumber(this.previousOperand)} ${this.operation}` } else { this.previousOperandTextElemen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n\t\tthis.output = this.tempOutput;\n\t}", "function setOutput (value) {\n document.getElementById(\"output\").innerHTML += value;\n }", "function updateOutput(el, val) {\n el.textContent = val;\n}", "updateOutput(output) {\n this.output = output;\n }", "function updateOutputData() {\n ...
[ "0.74972343", "0.71077394", "0.70743877", "0.70059997", "0.6876991", "0.67535573", "0.6687743", "0.65888333", "0.6567917", "0.65473765", "0.64957285", "0.6431211", "0.6384369", "0.6350538", "0.6335796", "0.6309937", "0.6268181", "0.6253637", "0.6250898", "0.6238551", "0.62205...
0.0
-1
constructor() sets up our starting properties
constructor(x, y) { this.x = x; this.y = y; this.size = 80; this.vx = 0; this.vy = 0; this.speed = 5; this.jitteriness = 0.1; this.alive = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n super();\n this._init();\n }", "constructor() {\n this.init();\n }", "constructor() {\r\n super()\r\n this.init()\r\n }", "constructor()\n {\n this.init();\n }", "constructor() {\n this._initialize();\n }", "init(){}", "co...
[ "0.7738462", "0.74991316", "0.7487585", "0.7458069", "0.7445181", "0.7295079", "0.72593236", "0.7236672", "0.7214187", "0.721337", "0.71902615", "0.71902615", "0.7184644", "0.7184644", "0.7184644", "0.7184644", "0.7184644", "0.7175449", "0.71580714", "0.71287155", "0.71287155...
0.0
-1
MOVES BEES AROUND AT RANDOM
move() { let r = random(0, 1); if (r < this.jitteriness) { this.vx = random(-this.speed, this.speed); this.vy = random(-this.speed, this.speed); } this.x = this.x + this.vx; this.y = this.y + this.vy; this.x = constrain(this.x, 0, width); this.y = constrain(this.y, height/5, he...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "move() {\r\n this.x += Math.random() * 4 - 2;\r\n this.y += Math.random() * 4 - 2;\r\n }", "move() {\r\n this.x += Math.random() * 4 - 2;\r\n this.y += Math.random() * 4 - 2;\r\n }", "move() {\n this.x += random(-5, 5);\n this.y += random(...
[ "0.7783087", "0.7783087", "0.76044077", "0.75924", "0.7529681", "0.7528167", "0.7525169", "0.75189966", "0.7455872", "0.7350621", "0.7341479", "0.73285234", "0.7231092", "0.7128503", "0.7092282", "0.7086551", "0.7062928", "0.70344067", "0.70189244", "0.69831973", "0.697383", ...
0.6651432
47
Generate a json payload from a layer collection of a map
function serialize (layersCollection) { return layersCollection.chain() .map(_calculateLayerJSON) .compact() .value(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapToJson(map) {\n return JSON.stringify([...map]);\n}", "function serializeMap(map) {\n if (map === null || map === undefined) return null;\n\n var meta = {\n geometries: {},\n materials: {},\n textures: {},\n images: {}...
[ "0.6077734", "0.58913064", "0.58010674", "0.5733071", "0.5732192", "0.55657214", "0.5484625", "0.547894", "0.54577273", "0.542985", "0.5425517", "0.53715974", "0.53686315", "0.53562886", "0.53547305", "0.529625", "0.52862674", "0.5280343", "0.5262334", "0.5262334", "0.5248866...
0.63502496
0
Create a Placeholder Node
function Node(prev, value, next) { this.prev = prev; this.value = value; this.next = next; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createTNodePlaceholder(tView, previousTNodes, index) {\n var tNode = createTNodeAtIndex(tView, index, 64\n /* Placeholder */\n , null, null);\n addTNodeAndUpdateInsertBeforeIndex(previousTNodes, tNode);\n return tNode;\n }", "function createTNodePlaceholder(tView,...
[ "0.7280304", "0.71829545", "0.71125585", "0.6983387", "0.6983387", "0.6983387", "0.6983387", "0.6983387", "0.6983387", "0.6871535", "0.67577237", "0.6711385", "0.66324365", "0.65866935", "0.6571635", "0.65532833", "0.65304124", "0.6508558", "0.6508558", "0.6457764", "0.618994...
0.0
-1
Creates a new observer in a nonstopped state.
function AbstractObserver() { this.isStopped = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Observer() {\n if (this === undefined) {\n return new Observer();\n }\n this.observers = [];\n}", "function Observer() {}", "constructor(observer) {\n this.observer = observer;\n }", "function createObserverFlags() {\n return __assign(__assign({}, createFlags()), { valid: true...
[ "0.63337404", "0.6153829", "0.5924969", "0.57853353", "0.5758125", "0.5758125", "0.55391794", "0.5517304", "0.54899466", "0.54899466", "0.54885745", "0.54885745", "0.54885745", "0.54865545", "0.54127055", "0.53834546", "0.5381836", "0.5372066", "0.5368686", "0.5368686", "0.53...
0.5649481
10
Swap out for Array.findIndex
function arrayIndexOfComparer(array, item, comparer) { for (var i = 0, len = array.length; i < len; i++) { if (comparer(array[i], item)) { return i; } } return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findIndex(arr, val) {\n\n}", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n }", "function looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr...
[ "0.7875267", "0.744985", "0.74374187", "0.74374187", "0.74374187", "0.74374187", "0.74055105", "0.73785365", "0.7367658", "0.73522145", "0.73179567", "0.73179567", "0.73179567", "0.73179567", "0.73179567", "0.73179567", "0.73179567", "0.73179567", "0.73179567", "0.73179567", ...
0.0
-1
Fix subscriber to check for undefined or function returned to decorate as Disposable
function fixSubscriber(subscriber) { return subscriber && isFunction(subscriber.dispose) ? subscriber : isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fixSubscriber(subscriber) {\n\t return subscriber && isFunction(subscriber.dispose) ? subscriber :\n\t isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;\n\t }", "function fixSubscriber(subscriber) {\n\t return subscriber && isFunction(subscriber.dispose) ? subs...
[ "0.7148464", "0.7148464", "0.7148464", "0.7148464", "0.7148464", "0.71377957", "0.70697045", "0.6199943", "0.61753887", "0.61753887", "0.5846921", "0.5846921", "0.5787097", "0.5508618", "0.5472895", "0.5463261", "0.5451596", "0.5350599", "0.5339641", "0.5277935", "0.52666247"...
0.71777195
6
Creates a subject that can only receive one value and that value is cached for all future observations.
function AsyncSubject() { __super__.call(this); this.isDisposed = false; this.isStopped = false; this.hasValue = false; this.observers = []; this.hasError = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Subject() {\n // our subject keeps a record of its subscribers\n this.subscribers = new Set();\n // clients can can subscribe to it\n this.subscribe = (subscriber) => {\n this.subscribers.add(subscriber);\n // provite the ability to unsubscribe\n return {\n unsu...
[ "0.60960764", "0.6065348", "0.555646", "0.54352623", "0.5422303", "0.53921163", "0.53591806", "0.53474236", "0.52501637", "0.52501637", "0.51623327", "0.5159307", "0.5149975", "0.514517", "0.5118387", "0.5105487", "0.5095743", "0.50881076", "0.50881076", "0.50881076", "0.5088...
0.489169
41
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
Cf. isStrictRecord. Adds the error messages accumulation aspect.
function isStrictRecordE(recordSpec) { assertContract(isObject, [recordSpec], 'isStrictRecordE : record specification argument must' + ' be a valid object!'); return allPassE([ // 1. no extra properties, i.e. all properties in obj are in recordSpec // return true if recordSpec.keys - obj.keys is em...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "record(errors) {\n this.set(errors)\n }", "addError(field, errorMessage) {\n if (this.errors[field] === undefined)\n this.errors[field] = [errorMessage];\n else\n this.errors[field].push(errorMessage);\n }", "function _returnGroupFieldErrors(record) {\n const...
[ "0.52653265", "0.5219529", "0.5092838", "0.50822294", "0.50690347", "0.5042634", "0.5027523", "0.49216416", "0.4872962", "0.4862856", "0.48609117", "0.48361647", "0.481667", "0.4810591", "0.4797044", "0.4787566", "0.47684968", "0.4698835", "0.46961075", "0.46757022", "0.46586...
0.46423215
23
Cf. isRecord. Adds the error messages accumulation aspect.
function isRecordE(recordSpec) { assertContract(isObject, [recordSpec], 'isRecordE : record specification argument must' + ' be a valid object!'); return allPassE([ // 2. the properties in recordSpec all pass their corresponding predicate // pipe(obj => mapR(key => recordSpec[key](obj[key]), keys(r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "record(errors) {\n this.set(errors)\n }", "function _returnGroupFieldErrors(record) {\n const errorLog = [];\n if (string.isEmpty(record.group_name)) {\n errorLog.push(_missingField(\"group name\"));\n }\n return errorLog;\n}", "addError(field, errorMessage) {\n if (this.err...
[ "0.6179116", "0.58815444", "0.5605162", "0.5511536", "0.54495883", "0.54168975", "0.53984725", "0.53554493", "0.5333491", "0.5309326", "0.52748454", "0.5273779", "0.5241107", "0.5238655", "0.5230612", "0.52061266", "0.5155315", "0.5128459", "0.50893664", "0.5074827", "0.50744...
0.0
-1
Decorate `R.all` from ramda with validation error messages
function allE(predicate) { return function (...args) { const arrayOfValues = args[0] || []; const result = __WEBPACK_IMPORTED_MODULE_0_ramda__["reduce"]((acc, value) => { const booleanOrErrorMessage = predicate(value); if (isTrue(booleanOrErrorMessage)) { return acc } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function allE(predicate) {\n return function (...args) {\n const arrayOfValues = args[0] || [];\n\n const result = __WEBPACK_IMPORTED_MODULE_0_ramda__[\"reduce\"]((acc, value) => {\n const booleanOrErrorMessage = predicate(value);\n\n if (isTrue(booleanOrErrorMessage)) {\n return acc\n ...
[ "0.6064289", "0.59061116", "0.5635101", "0.5635101", "0.5635101", "0.5552268", "0.5200357", "0.5177201", "0.5160276", "0.5088366", "0.5088286", "0.5066607", "0.5045574", "0.50260526", "0.50223327", "0.5005895", "0.5004713", "0.49786893", "0.49621227", "0.49345383", "0.4934538...
0.60231435
1
decorateWith(decoratingFn, fnToDecorate), where log :: fn > fn such as both have same name and possibly throw exception if that make sense to decoratingFn
function decorateWithOne(decoratorSpec, fnToDecorate) { const fnToDecorateName = getFunctionName(fnToDecorate); return NamedFunction(fnToDecorateName, [], ` const args = [].slice.call(arguments); const decoratingFn = makeFunctionDecorator(decoratorSpec); return decoratingFn(args, fnToDecorateName...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrap(fn) {\n\n return function () {\n try {\n return fn.apply(this, arguments);\n }\n catch (err) {\n log(err);\n }\n };\n}", "function wrapfunction(fn,message){if(typeof fn!=='function'){throw new TypeError('argument fn must be a function');}return fn;}", "function wrapfunctio...
[ "0.60226977", "0.5771449", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5586076", ...
0.62193793
1
Cf. isStrictRecord. Adds the error messages accumulation aspect.
function isStrictRecordE(recordSpec) { assertContract(isObject, [recordSpec], 'isStrictRecordE : record specification argument must' + ' be a valid object!'); return allPassE([ // 1. no extra properties, i.e. all properties in obj are in recordSpec // return true if recordSpec.keys - obj.keys is em...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "record(errors) {\n this.set(errors)\n }", "addError(field, errorMessage) {\n if (this.errors[field] === undefined)\n this.errors[field] = [errorMessage];\n else\n this.errors[field].push(errorMessage);\n }", "function _returnGroupFieldErrors(record) {\n const...
[ "0.52653265", "0.5219529", "0.5092838", "0.50822294", "0.50690347", "0.5042634", "0.5027523", "0.49216416", "0.4872962", "0.4862856", "0.48609117", "0.48361647", "0.481667", "0.4810591", "0.4797044", "0.4787566", "0.47684968", "0.4698835", "0.46961075", "0.46757022", "0.46586...
0.46423215
24
Cf. isRecord. Adds the error messages accumulation aspect.
function isRecordE(recordSpec) { assertContract(isObject, [recordSpec], 'isRecordE : record specification argument must' + ' be a valid object!'); return allPassE([ // 2. the properties in recordSpec all pass their corresponding predicate // pipe(obj => mapR(key => recordSpec[key](obj[key]), keys(r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "record(errors) {\n this.set(errors)\n }", "function _returnGroupFieldErrors(record) {\n const errorLog = [];\n if (string.isEmpty(record.group_name)) {\n errorLog.push(_missingField(\"group name\"));\n }\n return errorLog;\n}", "addError(field, errorMessage) {\n if (this.err...
[ "0.6179116", "0.58815444", "0.5605162", "0.5511536", "0.54495883", "0.54168975", "0.53984725", "0.53554493", "0.5333491", "0.5309326", "0.52748454", "0.5273779", "0.5241107", "0.5238655", "0.5230612", "0.52061266", "0.5155315", "0.5128459", "0.50893664", "0.5074827", "0.50744...
0.0
-1
Decorate `R.all` from ramda with validation error messages
function allE(predicate) { return function (...args) { const arrayOfValues = args[0] || []; const result = __WEBPACK_IMPORTED_MODULE_0_ramda__["reduce"]((acc, value) => { const booleanOrErrorMessage = predicate(value); if (isTrue(booleanOrErrorMessage)) { return acc } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function allE(predicate) {\n return function (...args) {\n const arrayOfValues = args[0] || [];\n\n const result = __WEBPACK_IMPORTED_MODULE_0_ramda__[\"reduce\"]((acc, value) => {\n const booleanOrErrorMessage = predicate(value);\n\n if (isTrue(booleanOrErrorMessage)) {\n return acc\n ...
[ "0.60231435", "0.59061116", "0.5635101", "0.5635101", "0.5635101", "0.5552268", "0.5200357", "0.5177201", "0.5160276", "0.5088366", "0.5088286", "0.5066607", "0.5045574", "0.50260526", "0.50223327", "0.5005895", "0.5004713", "0.49786893", "0.49621227", "0.49345383", "0.493453...
0.6064289
0
decorateWith(decoratingFn, fnToDecorate), where log :: fn > fn such as both have same name and possibly throw exception if that make sense to decoratingFn
function decorateWithOne(decoratorSpec, fnToDecorate) { const fnToDecorateName = getFunctionName(fnToDecorate); return NamedFunction(fnToDecorateName, [], ` const args = [].slice.call(arguments); const decoratingFn = makeFunctionDecorator(decoratorSpec); return decoratingFn(args, fnToDecorateName...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrap(fn) {\n\n return function () {\n try {\n return fn.apply(this, arguments);\n }\n catch (err) {\n log(err);\n }\n };\n}", "function wrapfunction(fn,message){if(typeof fn!=='function'){throw new TypeError('argument fn must be a function');}return fn;}", "function wrapfunctio...
[ "0.60226977", "0.5771449", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5709963", "0.5586076", ...
0.62193793
0
Returns true if the HTML5 history API is supported. Taken from Modernizr. changed to avoid false negatives for Windows Phones:
function supportsHistory() { var ua = navigator.userAgent; if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) { return false; } return window.history && 'pushState' in window.hi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function supportsHistory() { // 60\n var ua = navigator.userAgent; // 61\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf(...
[ "0.84577197", "0.8437402", "0.8437402", "0.8437402", "0.8437402", "0.8437402", "0.8437402", "0.8437402", "0.8437402", "0.8437402", "0.8437402", "0.8437402", "0.8437402", "0.8437402", "0.8437402", "0.8437402", "0.8437402", "0.8437402", "0.8437402", "0.8437402", "0.8437402", ...
0.83612156
43
Returns false if using go(n) with hash history causes a full page reload.
function supportsGoWithoutReloadUsingHash() { var ua = navigator.userAgent; return ua.indexOf('Firefox') === -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changed()\n {\n if (window.location.hash !== this.lastHash)\n {\n this.lastHash = window.location.hash;\n return true;\n }\n else\n {\n return false;\n }\n }", "function checkHash() {\r\n if (location.hash && $this.find(l...
[ "0.6853592", "0.6627107", "0.6169394", "0.61218673", "0.61203706", "0.6109625", "0.6105205", "0.6105017", "0.6095695", "0.6089655", "0.6070026", "0.6031158", "0.6027591", "0.6025375", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", ...
0.0
-1
dont want to go through the trouble of typing this as it is notoriously shapeshifting
function isEventName(x) { return __WEBPACK_IMPORTED_MODULE_0_ramda__["both"](__WEBPACK_IMPORTED_MODULE_1__contracts_src_index__["x" /* isString */], isNotEmpty)(x); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Transform$7() {}", "shift(x, y) {\n this.x += x;\n this.y += y;\n }", "shift(x, y)\n\t{\n\t\tthis.x += x;\n\t\tthis.y += y;\n\t}", "shapeShift (params) {\n let meshIndex = params.meshIndex\n\n // Increase index to shapeshift\n meshIndex++\n\n // If at end of array, loop round\n ...
[ "0.57461584", "0.55962557", "0.5546577", "0.55115575", "0.5431237", "0.5356589", "0.5356367", "0.5356367", "0.52512974", "0.52496594", "0.5239952", "0.51527286", "0.51519275", "0.50888306", "0.50835097", "0.5051077", "0.50398916", "0.5034055", "0.5028778", "0.50275826", "0.50...
0.0
-1
this function routes a model to all other models. all functions that are routed have a property `.conversion` attached to the returned synthetic function. This property is an array of strings, each with the steps in between the 'from' and 'to' color models (inclusive). conversions that are not possible simply are not i...
function buildGraph() { var graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3 var models = Object.keys(conversions); for (var len = models.length, i = 0; i < len; i++) { graph[models[i]] = { // http://jsperf.com/1-vs-infinity // micro-opt, but this is simple. distance: -1, parent...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function applyModelMethod(listModelMethods, modelName, color){\n\n /// check if model exists\n if( modelName in listModelMethods){\n\n return listModelMethods[modelName]( color );\n\n /// else convert through RGB if possible\n }else{\n\n if ( modelName=='RGB' || 'RGB' in Color.convertModels[modelName] ){...
[ "0.53943527", "0.5018502", "0.49245542", "0.48956913", "0.48724517", "0.48599735", "0.48599735", "0.48429817", "0.4806638", "0.4805221", "0.47499967", "0.46058553", "0.45866397", "0.4573729", "0.45583662", "0.45374277", "0.45293838", "0.45099354", "0.45099354", "0.45082292", ...
0.0
-1
Return entries (for example, of a map) with spacing, indentation, and comma without surrounding punctuation (for example, braces)
function printIteratorEntries( // Flow 0.51.0: property `@@iterator` of $Iterator not found in Object // To allow simplistic getRecordIterator in immutable.js iterator, config, indentation, depth, refs, printer) { var separator = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : ': '; var result ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatValue(value, indent) {\n if (value[0] === '{' && _.last(value) === '}') {\n let spaces = ' '.repeat(indent);\n return value.replace(/\\,\\s\\'/g, ',\\n'+ spaces +'\\'');\n }\n return value;\n }", "function delimitedIndent({ closing, align = true, units...
[ "0.5682215", "0.56272554", "0.5574983", "0.55546045", "0.5520566", "0.55168796", "0.5319848", "0.5256702", "0.5246431", "0.52098316", "0.52098316", "0.52098316", "0.52098316", "0.52098316", "0.51368326", "0.5102304", "0.5087773", "0.50831246", "0.50700736", "0.5069939", "0.50...
0.47353017
97
Return values (for example, of a set) with spacing, indentation, and comma without surrounding punctuation (braces or brackets)
function printIteratorValues(iterator, config, indentation, depth, refs, printer) { var result = ''; var current = iterator.next(); if (!current.done) { result += config.spacingOuter; var indentationNext = indentation + config.indent; while (!current.done) { result += indentationNext + printe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatValue(value, indent) {\n if (value[0] === '{' && _.last(value) === '}') {\n let spaces = ' '.repeat(indent);\n return value.replace(/\\,\\s\\'/g, ',\\n'+ spaces +'\\'');\n }\n return value;\n }", "print () {\n return this.ranges.reduce((acc, cur, id...
[ "0.56794524", "0.5527331", "0.55212617", "0.54439294", "0.5333553", "0.5333553", "0.5333553", "0.52831846", "0.5258964", "0.5258964", "0.52575356", "0.5218083", "0.5203908", "0.5166728", "0.5158787", "0.5158502", "0.51342815", "0.5120181", "0.5120181", "0.5120181", "0.5120181...
0.5165366
14
Return items (for example, of an array) with spacing, indentation, and comma without surrounding punctuation (for example, brackets)
function printListItems(list, config, indentation, depth, refs, printer) { var result = ''; if (list.length) { result += config.spacingOuter; var indentationNext = indentation + config.indent; for (var i = 0; i < list.length; i++) { result += indentationNext + printer(list[i], config, indentati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrayFormatter(list) {\n let out = [];\n for (let i = 0; i < list.length; i++) {\n if (i === list.length-2 && list.length > 1) {\n out.push(list[i]);\n out.push('and');\n out.push(list[i+1]);\n break;\n } else if (list.length > 1){\n out.push(list[i]+',')...
[ "0.61083287", "0.5935392", "0.5815304", "0.5741189", "0.5549211", "0.5511684", "0.5490711", "0.5478478", "0.5470074", "0.5470074", "0.54546887", "0.5453761", "0.544186", "0.54278773", "0.5380071", "0.5378576", "0.53762186", "0.5350113", "0.53316885", "0.52951247", "0.5280046"...
0.53860486
14
Return properties of an object with spacing, indentation, and comma without surrounding punctuation (for example, braces)
function printObjectProperties(val, config, indentation, depth, refs, printer) { var result = ''; var keys$$1 = _Object$keys(val).sort(); var symbols = getSymbols(val); if (symbols.length) { keys$$1 = keys$$1.filter(function (key) { return !isSymbol$1(key); }).concat(symbols); } if (keys$$1....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printObjectProperties(val, config, indentation, depth, refs, printer) {\n var result = '';var keys$$1 = _Object$keys(val).sort();var symbols = getSymbols(val);if (symbols.length) {\n keys$$1 = keys$$1.filter(function (key) {\n return !isSymbol(key);\n }).concat(symbols);\n }if (keys...
[ "0.6625558", "0.6617245", "0.6617245", "0.64435506", "0.6429753", "0.6405705", "0.62823296", "0.60473526", "0.59472036", "0.589493", "0.58924997", "0.5883766", "0.5878765", "0.58707345", "0.5857018", "0.58445203", "0.580339", "0.57766026", "0.57609284", "0.5752909", "0.573697...
0.65417683
3
Copyright (c) 2014present, Facebook, Inc. All rights reserved. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
function escapeHTML(str) { return str.replace(/</g, '&lt;').replace(/>/g, '&gt;'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidMount() {\n // if this is the first time the home screen is loading\n // we must initialize Facebook\n if (!window.FB) {\n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '280945375708713',\n cookie : true, // enable cookies to allow the s...
[ "0.6089163", "0.5845265", "0.57973343", "0.5677412", "0.5677213", "0.5589815", "0.5562765", "0.5452331", "0.54350245", "0.54197353", "0.54194784", "0.54075015", "0.5396538", "0.5381096", "0.5370261", "0.5359414", "0.5318016", "0.5263697", "0.5236381", "0.5236381", "0.5204551"...
0.0
-1
Allows to compose model update functions (a la monad chain operation)
function chainModelUpdates(arrayModelUpdateFn) { return function chainedModelUpdates(model, eventData, actionResponse, settings) { return __WEBPACK_IMPORTED_MODULE_0_ramda__["flatten"](__WEBPACK_IMPORTED_MODULE_0_ramda__["map"]( modelUpdateFn => modelUpdateFn(model, eventData, actionResponse, settings), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update( options ) {\n return ( request, reply ) => {\n\n let _handler = ( request, options ) => {\n\n debug( 'update' );\n\n return new Promise( done => {\n\n options.getCriteria( request, done )\n\n } ).then(criteria=> {\n\n var Mod...
[ "0.63172036", "0.6196551", "0.6143935", "0.6143935", "0.6143935", "0.6032889", "0.5968839", "0.58958596", "0.587928", "0.5803205", "0.57513744", "0.57391554", "0.5690025", "0.5657333", "0.5578463", "0.5572161", "0.5550866", "0.5498097", "0.54929703", "0.547946", "0.5479044", ...
0.67678535
0
Shortcut to avoid defining over and over the same action response (success, error) logic
function makeDefaultActionResponseProcessing(config) { __WEBPACK_IMPORTED_MODULE_1__contracts_src_index__["a" /* assertContract */](__WEBPACK_IMPORTED_MODULE_3__types__["j" /* isDefaultActionResponseHandlerConfig */], [config], 'Configuration for action response handling must be of the shape :: {' + ' succes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function executing_success(){\n\t\t\t\t\t\t\tvar ret = null;\n\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\tif App.HTTP['METHOD'] is called with the 'success' field settled, the next conditional is executed\n\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\tif (typeof function_success != \"undefined\") {\n\t\t\t\t\t\t\t\tif (typeof function_...
[ "0.6359224", "0.6288385", "0.61042434", "0.61042434", "0.6091038", "0.60906726", "0.60350114", "0.5989375", "0.5980541", "0.5966226", "0.5937884", "0.59260046", "0.5894344", "0.588265", "0.586886", "0.58586276", "0.58586276", "0.58522195", "0.5843221", "0.58323336", "0.583233...
0.5496511
71
Remote repository data fetching
function fetchUserApplication(domainQuery, opportunityKey, userKey) { return domainQuery.getCurrent(__WEBPACK_IMPORTED_MODULE_0__domain__["h" /* USER_APPLICATION */], { userKey, opportunityKey }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadRemoteData() {\n\n\t\t// The comment service returns a promise.\n\t\tUserservice.getUsers().then(function(Users) {\n\n\t\t\tapplyRemoteData(Users);\n\n\t\t});\n\n\t}", "function loadRemoteData() {\n\n\t\t// The comment service returns a promise.\n\t\tUserservice.getComments().then(function(Comments)...
[ "0.64571667", "0.64000773", "0.6361239", "0.62797886", "0.623158", "0.6225365", "0.6124775", "0.6103638", "0.6082907", "0.60186213", "0.59900934", "0.59566903", "0.59455544", "0.5922557", "0.58827597", "0.58581746", "0.5827476", "0.5821064", "0.5812652", "0.58114076", "0.5792...
0.0
-1
Returns a new createHistory function that can be used to create history objects that know how to use the beforeunload event in web browsers to cancel navigation.
function useBeforeUnload(createHistory) { return function (options) { var history = createHistory(options); var stopBeforeUnloadListener = undefined; var beforeUnloadHooks = []; function getBeforeUnloadPromptMessage() { var message = undefined; for (var i = 0, len = beforeUnloadHooks.le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useBeforeUnload(createHistory) {\n\t return function (options) {\n\t var history = createHistory(options);\n\n\t var stopBeforeUnloadListener = undefined;\n\t var beforeUnloadHooks = [];\n\n\t function getBeforeUnloadPromptMessage() {\n\t var message = undefined;\n\n\t for (var i = ...
[ "0.70113", "0.69710094", "0.68317175", "0.6742008", "0.6703513", "0.6702155", "0.6702155", "0.6676185", "0.6676185", "0.6676185", "0.6676185", "0.66624725", "0.66366965", "0.66366965", "0.66366965", "0.66366965", "0.66366965", "0.663598", "0.663598", "0.66313547", "0.66276777...
0.6719352
6
Returns a new createHistory function that may be used to create history objects that know how to handle URL queries.
function useQueries(createHistory) { return function () { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; var history = createHistory(options); var stringifyQuery = options.stringifyQuery; var parseQueryString = options.parseQueryString; if (typeof stringi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useQueries(createHistory) { // 31\n return function () { // 32\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n var stringifyQuery = options.stringifyQuery; ...
[ "0.70573777", "0.70034605", "0.66788316", "0.6418089", "0.6408501", "0.6402545", "0.6402545", "0.6402221", "0.6402221", "0.6307533", "0.6307533", "0.628708", "0.62775135", "0.62736976", "0.62736976", "0.62736976", "0.62736976", "0.62736976", "0.62736976", "0.62736976", "0.627...
0.6148637
50
Override all read methods with queryaware versions.
function listenBefore(hook) { return history.listenBefore(function (location, callback) { _runTransitionHook2['default'](hook, addQuery(location), callback); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async readByUsername(username) {\n return await super.read({ username })\n }", "_decorateRead () {\n this.relatedQuery.where(this.toKey, this.parent[this.fromKey])\n }", "function CustomQuery() {\n\n}", "function ConversationQuery()\n{\n this.readParameterName = 'read';\n \n this.read...
[ "0.58500993", "0.5552771", "0.52974683", "0.5289815", "0.5265061", "0.5264605", "0.5210653", "0.51795566", "0.51795566", "0.51795566", "0.5165009", "0.5165009", "0.5165009", "0.5165009", "0.5165009", "0.5165009", "0.5163401", "0.5162852", "0.5150899", "0.5150899", "0.514865",...
0.0
-1
Override all write methods with queryaware versions.
function push(location) { history.push(appendQuery(location, location.query)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "write() {\n const statement = this.dbConnector.statements.set(this.params, this.writeBuffer);\n this.dbConnector.query(statement, this.onWriteResult.bind(this), [], true);\n }", "queryUpdateHook() { }", "patchKnexClient() {\n const query = MonkeyPatchable_1.MonkeyPatchable.Client.protot...
[ "0.57920986", "0.5006048", "0.49241138", "0.48631558", "0.4856456", "0.48446587", "0.4841641", "0.48345873", "0.48345873", "0.48160714", "0.47926757", "0.478859", "0.47767988", "0.47638872", "0.4763226", "0.4746835", "0.4741128", "0.4741128", "0.4741128", "0.4741128", "0.4741...
0.0
-1
Helpers NOTE : only useful in connection with router, which is not used here
function filterNull(driver) { return function filteredDOMDriver(sink$) { return driver(sink$.tap(x => console.log(`merged DOM (driver input): ${__WEBPACK_IMPORTED_MODULE_11__rxcc_utils__["b" /* convertVNodesToHTML */](x)}`, x)).filter(x => x)); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "router() { return rtr; }", "init() {\n this.router.post('/generate', (request, response, next) => {\n this.generateKeys(request, response, next);\n });\n this.router.get('/keys/:platform', (request, response, next) => {\n this.getKeys(request, response, next);\n ...
[ "0.6157873", "0.59095484", "0.56892157", "0.56804365", "0.56108963", "0.553547", "0.5522522", "0.55172545", "0.55164707", "0.55083907", "0.55064434", "0.54741913", "0.54329044", "0.54207706", "0.5412222", "0.54086536", "0.5379921", "0.53545606", "0.5354422", "0.53313607", "0....
0.0
-1
Note : in the case of a routing, ProcessApplication will be called with the keys in setting
function ProcessApplication(sources) { const emptyUserApplicationModel = getEmptyUserApplicationModel(); if (!emptyUserApplicationModel.userApplication) { throw 'Internal error'; } emptyUserApplicationModel.userApplication.opportunityKey = __WEBPACK_IMPORTED_MODULE_3__fixtures__["b" /* fakeOpportunityKey *...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processRoutes()\n {\n if(!app.routes){\n Ext.global.console.warn(\"No routes were found. Consider defining routes object in your Ext.application definition.\");\n return;\n }\n \n Ext.iterate(app.routes, function(route, value)\n {\n va...
[ "0.6211368", "0.61649007", "0.5603862", "0.55994457", "0.5582233", "0.5525023", "0.55189127", "0.5512388", "0.5506664", "0.5450415", "0.54463744", "0.5397557", "0.5373068", "0.5353232", "0.53441864", "0.5321324", "0.5315976", "0.5288696", "0.5253164", "0.52522886", "0.5240869...
0.0
-1
Removes all keyvalue entries from the hash.
function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n var map = this._map;\n var keys = Object.keys(map);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n map[key].clear();\n }\n }", "function clear() {\n this.keys.forEach((key) => {\n this._store[key] = undefined;\n delete this._store[key];\n });\n}", ...
[ "0.6734509", "0.6623458", "0.6511452", "0.64546496", "0.6215805", "0.62014014", "0.61394125", "0.6111554", "0.603054", "0.59680474", "0.59352255", "0.59063524", "0.59063524", "0.59063524", "0.5905507", "0.589964", "0.589964", "0.589964", "0.5863853", "0.5863853", "0.5863853",...
0.0
-1
Removes all keyvalue entries from the list cache.
function listCacheClear() { this.__data__ = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear() {\n\t\t this.__data__ = [];\n\t\t this.size = 0;\n\t\t}", "function listCacheClear() ...
[ "0.7357779", "0.7357779", "0.7357779", "0.7357779", "0.7317932", "0.72645503", "0.72645503", "0.7262977", "0.72569066", "0.72569066", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7234546",...
0.0
-1
Removes all keyvalue entries from the map.
function mapCacheClear() { this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), 'string': new Hash }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n var map = this._map;\n var keys = Object.keys(map);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n map[key].clear();\n }\n }", "clear() {\n log.map(\"Clearing the map of all the entries\");\n this._map.clear();\n }", "function multiMapRemo...
[ "0.7590112", "0.70694387", "0.6735414", "0.6652174", "0.6530006", "0.6267597", "0.62582785", "0.62582785", "0.62582785", "0.617115", "0.617115", "0.617115", "0.6166302", "0.61519635", "0.614778", "0.614778", "0.614778", "0.614778", "0.614778", "0.614778", "0.614778", "0.614...
0.0
-1
Removes all keyvalue entries from the stack.
function stackClear() { this.__data__ = new ListCache; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear () {\n this._dict = {}\n this._stack = [this._dict]\n }", "function stackClear(){this.__data__={'array':[],'map':null};}", "function stackClear(){this.__data__={'array':[],'map':null};}", "function stackClear(){this.__data__={'array':[],'map':null};}", "function stackClear() {\n\t this.__...
[ "0.63577217", "0.63291264", "0.63291264", "0.63291264", "0.62734073", "0.62274295", "0.62274295", "0.62274295", "0.62274295", "0.62274295", "0.62274295", "0.62274295", "0.62171006", "0.62171006", "0.62171006", "0.62171006", "0.62171006", "0.62171006", "0.62171006", "0.62171006"...
0.0
-1
Removes all keyvalue entries from the hash.
function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n var map = this._map;\n var keys = Object.keys(map);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n map[key].clear();\n }\n }", "function clear() {\n this.keys.forEach((key) => {\n this._store[key] = undefined;\n delete this._store[key];\n });\n}", ...
[ "0.6734509", "0.6623458", "0.6511452", "0.64546496", "0.6215805", "0.62014014", "0.61394125", "0.6111554", "0.603054", "0.59680474", "0.59352255", "0.59063524", "0.59063524", "0.59063524", "0.5905507", "0.589964", "0.589964", "0.589964", "0.5863853", "0.5863853", "0.5863853",...
0.0
-1
Removes all keyvalue entries from the list cache.
function listCacheClear() { this.__data__ = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear() {\n\t\t this.__data__ = [];\n\t\t this.size = 0;\n\t\t}", "function listCacheClear() ...
[ "0.7357779", "0.7357779", "0.7357779", "0.7357779", "0.7317932", "0.72645503", "0.72645503", "0.7262977", "0.72569066", "0.72569066", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7234546",...
0.0
-1
Removes all keyvalue entries from the map.
function mapCacheClear() { this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), 'string': new Hash }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n var map = this._map;\n var keys = Object.keys(map);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n map[key].clear();\n }\n }", "clear() {\n log.map(\"Clearing the map of all the entries\");\n this._map.clear();\n }", "function multiMapRemo...
[ "0.7590112", "0.70694387", "0.6735414", "0.6652174", "0.6530006", "0.6267597", "0.62582785", "0.62582785", "0.62582785", "0.617115", "0.617115", "0.617115", "0.6166302", "0.61519635", "0.614778", "0.614778", "0.614778", "0.614778", "0.614778", "0.614778", "0.614778", "0.614...
0.0
-1
This method returns `undefined`.
function noop() { // No operation performed. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function returnUndefined() {}", "value() { return undefined; }", "function _undefined() {\n return exports.PREFIX.undefined;\n}", "function f () {\n return undefined;\n }", "_get(key) { return undefined; }", "get None() {}", "get None() {}", "get None() {}", "get None() {}", "_get_value() ...
[ "0.7349204", "0.67813563", "0.6498075", "0.6468386", "0.6265139", "0.6195519", "0.6195519", "0.6195519", "0.6195519", "0.5957684", "0.5942946", "0.5942946", "0.59360754", "0.5919196", "0.5828133", "0.5788914", "0.57824624", "0.5770755", "0.5736466", "0.5725097", "0.57073194",...
0.0
-1
Note : must be shared, used twice here NOTE : we cannot group matchedRoute$ and changedRouteEvents$ in one, as one needs a Replay and the other one needs just a share : changedRouteEvents$ really is an event, we don't want it to trigger in a delayed manner. Tests proved that this leads to children componnt emitting val...
function makeRoutedSinkFromCache(sinkName) { return function makeRoutedSinkFromCache(params) { let cached$, preCached$, prefix$ if (params != null) { // Case : new route matches component configured route if (cachedSinks[sinkName] != null) { // Case : the component produces a ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function notifySubscribers() {\n var eventPayload = {\n routeObj: getCurrentRoute(), // { route:, data: }\n fragment: getURLFragment()\n };\n\n _subject.onNext(eventPayload);\n }", "_bindEvents () {\n this.channel.on('route', this.navigate)\n }", "matchRouter() {\n Ro...
[ "0.5606876", "0.5525321", "0.5265135", "0.5202621", "0.51625633", "0.51167166", "0.5041249", "0.50404656", "0.5024097", "0.49741954", "0.49729288", "0.49689674", "0.49568826", "0.49562854", "0.49533913", "0.49527213", "0.49502096", "0.49464253", "0.49276137", "0.4904251", "0....
0.45184147
98
Test to see if a value matches the corresponding rule.
function validateRule(rule, value) { // For a given rule, get the first letter of the string name of its // constructor function. "R" -> RegExp, "F" -> Function (these shouldn't // conflict with any other types one might specify). Note: instead of // getting .toString from a new object {} or Object.prot...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function match(value, rule) {\n if (rule.length < 2)\n throw (`Matching rule '${rule}' has incorrect format`);\n\n const m = rule.substring(1).trim();\n\n switch (rule.charAt(0)) {\n case '=': return value === m;\n case '!': return value !== m;\n case '>': return value > m;\n ...
[ "0.7319595", "0.6770917", "0.6757597", "0.6442376", "0.6409928", "0.6409928", "0.6366495", "0.63567185", "0.6325052", "0.6300086", "0.61963254", "0.6097363", "0.59308773", "0.58895123", "0.5889082", "0.58805436", "0.5854788", "0.5850225", "0.5838364", "0.5827553", "0.58042514...
0.63410115
8
Detach an observer from an object
function unobserve(root, observer) { observer.unobserve(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "detach(observer){\n var index = this.observers.indexOf(observer);\n this.observers.splice(index);\n }", "detach(observer) {\n const observerIndex = this.#observers.indexOf(observer);\n this.#observers.splice(observerIndex, 1);\n console.log('Subject1: detached observer.');\n }", "_disconnectOb...
[ "0.8325246", "0.76803374", "0.7273938", "0.71346384", "0.71346384", "0.71292233", "0.7076311", "0.7076311", "0.7009245", "0.67973995", "0.6755808", "0.66890305", "0.6654646", "0.66166866", "0.65712655", "0.65415394", "0.648395", "0.64733124", "0.64733124", "0.64733124", "0.64...
0.70212454
8
Observes changes made to an object, which can then be retieved using generate
function observe(obj, callback) { var patches = []; var root = obj; var observer; var mirror = getMirror(obj); if (!mirror) { mirror = new Mirror(obj); beforeDict.push(mirror); } else { observer = getObserverFromMirror(mirror, c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }", "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n...
[ "0.6304848", "0.6304848", "0.62953997", "0.62450284", "0.623443", "0.59476274", "0.59176093", "0.589367", "0.5877752", "0.58311915", "0.57755023", "0.57755023", "0.5768497", "0.5748701", "0.5693525", "0.5693525", "0.56621015", "0.5653163", "0.56433034", "0.5620747", "0.557157...
0.0
-1
Generate an array of patches from an observer
function generate(observer) { var mirror; for (var i = 0, ilen = beforeDict.length; i < ilen; i++) { if (beforeDict[i].obj === observer.object) { mirror = beforeDict[i]; break; } } _generate(mirror.value, observer.object, observer.p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get patches() {return [];}", "function generate(observer) {\r\n var mirror;\r\n for (var i = 0, length = beforeDict.length; i < length; i++) {\r\n if (beforeDict[i].obj === observer.object) {\r\n mirror = beforeDict[i];\r\n break;\r\n }\r\n }\r\n _generate(m...
[ "0.6927552", "0.65395826", "0.6472753", "0.6472753", "0.62490106", "0.60783637", "0.54294676", "0.539193", "0.5325508", "0.52798253", "0.5276885", "0.5260606", "0.52049744", "0.5103646", "0.50216943", "0.49669978", "0.49554372", "0.49519414", "0.4934737", "0.4934737", "0.4887...
0.6531621
2
Dirty check if obj is different from mirror, generate patches and update mirror
function _generate(mirror, obj, patches, path) { if (obj === mirror) { return; } if (typeof obj.toJSON === "function") { obj = obj.toJSON(); } var newKeys = _objectKeys(obj); var oldKeys = _objectKeys(mirror); var changed = false; v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _generate(mirror, obj, patches, path) {\n\t if (obj === mirror) {\n\t return;\n\t }\n\t if (typeof obj.toJSON === \"function\") {\n\t obj = obj.toJSON();\n\t }\n\t var newKeys = _objectKeys(obj);\n\t var oldKeys = _objectKeys(mirror);\n\t ...
[ "0.76962465", "0.76962465", "0.76392627", "0.7591714", "0.75890374", "0.7524355", "0.7516997", "0.7501178", "0.74828756", "0.7480059", "0.74648577", "0.7435165", "0.6085327", "0.6012172", "0.6009701", "0.5979488", "0.58880424", "0.58880424", "0.5884316", "0.57500815", "0.5675...
0.75957423
3
3x faster than cached /^\d+$/.test(str)
function isInteger(str) { var i = 0; var len = str.length; var charCode; while (i < len) { charCode = str.charCodeAt(i); if (charCode >= 48 && charCode <= 57) { i++; continue; } return false; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hasNumber(inputString) {\r\n return /\\d/.test(inputString);\r\n }", "function containsNumber(s) {\n return s.match(/[1-9]/);\n}", "function hasNumbers(string){\n\t\tvar regex = /\\d/g;\n\t\treturn regex.test(string);\n\t}", "function allNumbers(str, len){\r\n\tif (str.length == len) {\r\n\t\tvar m=st...
[ "0.7218296", "0.72009104", "0.7106549", "0.7064377", "0.70574665", "0.7036048", "0.6950177", "0.6929586", "0.69160056", "0.6913426", "0.68874", "0.6878226", "0.6822459", "0.6821202", "0.6803936", "0.67691445", "0.6756793", "0.6675038", "0.6650382", "0.6648199", "0.6628466", ...
0.5965279
88
Escapes a json pointer path
function escapePathComponent(path) { if (path.indexOf('/') === -1 && path.indexOf('~') === -1) return path; return path.replace(/~/g, '~0').replace(/\//g, '~1'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function escapeJsonPath(str) {\n return str.replace(/~/g, \"~1\").replace(/\\//g, \"~0\")\n}", "function escapeJsonPointerToken(token) {\n return querystring_browser__WEBPACK_IMPORTED_MODULE_10___default.a.escape(token.replace(/~/g, '~0').replace(/\\//g, '~1'));\n}", "function escapeJsonPointerToken(token)...
[ "0.785269", "0.75015193", "0.74629325", "0.7118782", "0.66589457", "0.6381604", "0.6339883", "0.62935835", "0.6145881", "0.61422604", "0.6109955", "0.5950723", "0.58566606", "0.58064646", "0.57960474", "0.57313657", "0.5637991", "0.561005", "0.561005", "0.55828565", "0.553708...
0.5524605
22
Unescapes a json pointer path
function unescapePathComponent(path) { return path.replace(/~1/g, '/').replace(/~0/g, '~'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unescapeJsonPath(str) {\n return str.replace(/~0/g, \"\\\\\").replace(/~1/g, \"~\")\n}", "function unescapeJsonPointerToken(token) {\n if (typeof token !== 'string') {\n return token;\n }\n\n return querystring_browser__WEBPACK_IMPORTED_MODULE_10___default.a.unescape(token.replace(/~1/g, '/').r...
[ "0.76659846", "0.7128771", "0.7045485", "0.6812223", "0.65617275", "0.64811456", "0.5928143", "0.5890508", "0.5890508", "0.5851706", "0.5686251", "0.5646304", "0.55497485", "0.55497485", "0.55497485", "0.55497485", "0.55497485", "0.55497485", "0.5409742", "0.5375846", "0.5367...
0.5803788
10
Retrieves a value from a JSON document by a JSON pointer. Returns the value.
function getValueByPointer(document, pointer) { if (pointer == '') { return document; } var getOriginalDestination = { op: "_get", path: pointer }; applyOperation(document, getOriginalDestination); return getOriginalDestination.value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getValueByPointer(document, pointer) {\n if (pointer == '') {\n return document;\n }\n var getOriginalDestination = { op: \"_get\", path: pointer };\n applyOperation(document, getOriginalDestination);\n return getOriginalDestination.value;\n}", "function getValueByPointer(document,...
[ "0.682116", "0.682116", "0.6791412", "0.59633875", "0.5906425", "0.5575706", "0.5489855", "0.5467585", "0.541319", "0.53974557", "0.53687376", "0.5363257", "0.5353248", "0.529467", "0.526848", "0.52516955", "0.5214458", "0.5168803", "0.5157658", "0.51487684", "0.5123706", "...
0.6780969
3
Apply a JSON Patch on a JSON document. Returns an array of results of operations. Each element can either be a boolean (if op == 'test') or the removed object (operations that remove things) or just be undefined.
function apply(document, patch, validateOperation) { console.warn('jsonpatch.apply is deprecated, please use `applyPatch` for applying patch sequences, or `applyOperation` to apply individual operations.'); var results = new Array(patch.length); /* this code might be overkill, but will be remove...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function apply(tree, patches, validate) {\n\t var results = [], p = 0, plen = patches.length, patch, key;\n\t while (p < plen) {\n\t patch = patches[p];\n\t p++;\n\t // Find the object\n\t var path = patch.path || \"\";\n\t var keys = path.split(...
[ "0.6846997", "0.6846997", "0.6760469", "0.6745811", "0.67429155", "0.61025614", "0.6009046", "0.5969219", "0.59027106", "0.59027106", "0.583564", "0.5788726", "0.56235856", "0.54700565", "0.5324789", "0.52065015", "0.51714313", "0.5133635", "0.50998145", "0.50467", "0.5022432...
0.762489
0
Apply a single JSON Patch Operation on a JSON document. Returns the updated document. Suitable as a reducer.
function applyReducer(document, operation) { var operationResult = applyOperation(document, operation); if (operationResult.test === false) { throw new JsonPatchError("Test operation failed", 'TEST_OPERATION_FAILED', 0, operation, document); } return operationResult.newDocume...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function apply(document, patch, validateOperation) {\n console.warn('jsonpatch.apply is deprecated, please use `applyPatch` for applying patch sequences, or `applyOperation` to apply individual operations.');\n var results = new Array(patch.length);\n /* this code might be overkill, but will b...
[ "0.720648", "0.6863556", "0.6863556", "0.66978574", "0.6572558", "0.6528483", "0.65228283", "0.65228283", "0.6519018", "0.6327853", "0.578826", "0.57663375", "0.57510805", "0.5645429", "0.56314", "0.55752474", "0.5564826", "0.5532567", "0.55164254", "0.55120724", "0.5463244",...
0.67543054
3
provide scoped __extends for TypeScript's `extend` keyword so it will not provide global one during compilation
function __extends(d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments);...
[ "0.75143135", "0.73966944", "0.73966944", "0.73328936", "0.73328936", "0.73328936", "0.73328936", "0.693954", "0.6875706", "0.6827578", "0.6827578", "0.68009", "0.6628281", "0.6628281", "0.6594927", "0.65291137", "0.6485835", "0.641773", "0.6392073", "0.63771", "0.6174226", ...
0.6468758
17
Recursively checks whether an object has any undefined values inside.
function hasUndefined(obj) { if (obj === undefined) { return true; } if (obj) { if (_isArray(obj)) { for (var i = 0, len = obj.length; i < len; i++) { if (hasUndefined(obj[i])) { return true; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasUndefined(obj) {\r\n if (obj === undefined) {\r\n return true;\r\n }\r\n if (obj) {\r\n if (Array.isArray(obj)) {\r\n for (var i = 0, len = obj.length; i < len; i++) {\r\n if (hasUndefined(obj[i])) {\r\n return true;\r\n ...
[ "0.7645194", "0.7645194", "0.7621323", "0.75926137", "0.7577216", "0.7577216", "0.7540011", "0.75236124", "0.7433021", "0.694134", "0.686913", "0.68409723", "0.68409723", "0.68409723", "0.68409723", "0.68409723", "0.68409723", "0.68409723", "0.68409723", "0.68409723", "0.6778...
0.7493049
8
Create an array of patches from the differences in two objects
function compare(tree1, tree2) { var patches = []; _generate(tree1, tree2, patches, ''); return patches; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get patches() {return [];}", "function diff(fromArr, to) {\n // take the lame way out and return a \"patch\" that literally just removes\n // everything and then adds the entire contents of the \"to\" array using a\n // single splice.\n //\n // TODO: rewrite this!\n\n var i;\n var pat...
[ "0.7111465", "0.6786779", "0.65806496", "0.65806496", "0.6525222", "0.6525222", "0.6525222", "0.6525222", "0.6525222", "0.6525222", "0.6525222", "0.6525222", "0.6525222", "0.6525222", "0.6525222", "0.6525222", "0.6525222", "0.6525222", "0.6525222", "0.6525222", "0.65181184", ...
0.6025484
25
NOTE ADR: we don't use `m` here, we could but choose not to. As `m` will be use for logging, we have no interest in having a log for `InSlot` operations.
function InSlot(slotName, [component]) { return function InSlot(sources, settings) { const sinks = component(sources, settings); const vNodes$ = sinks[__WEBPACK_IMPORTED_MODULE_0__utils_src_index__["a" /* DOM_SINK */]]; sinks[__WEBPACK_IMPORTED_MODULE_0__utils_src_index__["a" /* DOM_SINK */]] = vNodes$.d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addEmptySlot(slot) {\n this.slotsInfo.push(slot);\n }", "onSlotChange(e) {\n console.log(e);\n }", "incrementSlotAvailability() {\n this.slotsAvailability++;\n }", "getSlots() {\n\t\treturn this.metadata.slots || {};\n\t}", "get availableSlots(){\n return this.aSlots\n }", "ge...
[ "0.5944179", "0.58587724", "0.5793578", "0.5546556", "0.5524345", "0.5509248", "0.53754205", "0.5340254", "0.5325077", "0.5294104", "0.52920985", "0.5290594", "0.5286144", "0.5267773", "0.5255354", "0.52428484", "0.52280295", "0.5183967", "0.51600945", "0.5155304", "0.5155304...
0.57092035
3
Events We just read the god damn values from the dom directly Events are executed prior to starting the state machine, so they can't take into account the model, hence also not the initial value for the fields. And the repository does not have the current value of the fields either. So only way is this
function aboutContinueEventFactory(sources, settings) { void settings; return sources.DOM.select(__WEBPACK_IMPORTED_MODULE_3__properties__["q" /* USER_APPLICATION_ABOUT_CONTINUE_BUTTON_SELECTOR */]).events('click').tap(__WEBPACK_IMPORTED_MODULE_5__rxcc_utils__["e" /* preventDefault */]).map(x => { void x; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadMySavedEdaFieldsModel(){\n return DefineEventService.getEventDefinition();\n }", "events() {\n\t\t\t\treturn {\n\t\t\t\t\t// Ordinary text fields\n\t\t\t\t\t'change input.form-control': () => {\n\t\t\t\t\t\t// Update the model based on changes in the view\n\t\t\t\t\t\tconst...
[ "0.59452987", "0.58978456", "0.5675117", "0.5673507", "0.5616766", "0.5542151", "0.5525869", "0.5525869", "0.5386471", "0.5344715", "0.5330315", "0.5324042", "0.5291125", "0.5277649", "0.5273564", "0.5206523", "0.5201835", "0.52014405", "0.52014405", "0.52014405", "0.5197613"...
0.0
-1
Creates and returns a history object that uses HTML5's history API (pushState, replaceState, and the popstate event) to manage history. This is the recommended method of managing history in browsers because it provides the cleanest URLs. Note: In browsers that do not support the HTML5 history API full page reloads will...
function createBrowserHistory() { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined; var forceR...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createBrowserHistory() {\r\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\r\n\t\r\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : unde...
[ "0.736502", "0.73305666", "0.73269993", "0.73181766", "0.7316236", "0.73088485", "0.7303365", "0.72981244", "0.72981244", "0.72981244", "0.72981244", "0.72981244", "0.72981244", "0.72981244", "0.72871566", "0.72871566", "0.7281749", "0.7281749", "0.7278339", "0.72759515", "0....
0.7248018
45
Override all read methods with basenameaware versions.
function listenBefore(hook) { return history.listenBefore(function (location, callback) { _runTransitionHook2['default'](hook, addBasename(location), callback); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async readByUsername(username) {\n return await super.read({ username })\n }", "get basename() {\n return typeof this.path === 'string' ? path__default[\"default\"].basename(this.path) : undefined\n }", "function getOverload() {\n /**\n * Overload Cldr.prototype.get().\n */\n superGet = Cl...
[ "0.5599691", "0.55655056", "0.53688526", "0.52226293", "0.5201119", "0.51804465", "0.51804465", "0.51790386", "0.51790386", "0.51790386", "0.51385564", "0.50133073", "0.49933138", "0.4965621", "0.49651924", "0.489265", "0.489265", "0.489265", "0.48909622", "0.4847756", "0.484...
0.0
-1
Override all write methods with basenameaware versions.
function push(location) { history.push(prependBasename(location)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_writing() {\n return { ...writeFiles(), ...super._missingPostWriting() };\n }", "function replaceWriteFiles(func) {\n _writeFiles = func;\n }", "set basename(basename) {\n assertNonEmpty(basename, 'basename');\n assertPart(basename, 'basename');\n this.path = path__default[\"default\"]....
[ "0.60107315", "0.5620717", "0.5556109", "0.52928275", "0.5260942", "0.5182526", "0.50870794", "0.50568515", "0.49969256", "0.49899554", "0.4698481", "0.4697085", "0.46969923", "0.4636332", "0.46133193", "0.45982495", "0.45865148", "0.4574015", "0.45580098", "0.4550556", "0.45...
0.0
-1
named nextTick for less confusing stack traces
function nextTick() { draining = true; var i, oldQueue; var len = queue.length; while (len) { oldQueue = queue; queue = []; i = -1; while (++i < len) { oldQueue[i](); } len = queue.length; } draining = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextTick(callback) {\n setTimeout(callback, 0);\n }", "function getNextTick(){tick = tick +1;return tick;}", "function nextTick(callback) {\n setTimeout(callback, 0);\n}", "function nextTick(callback) {\n setTimeout(callback, 0);\n}", "async onTick() {}", "tic...
[ "0.69275004", "0.68135226", "0.6763749", "0.6763749", "0.65847355", "0.62730217", "0.6224925", "0.6152692", "0.6126373", "0.6110301", "0.6095294", "0.6063777", "0.6044257", "0.6044257", "0.60179096", "0.59990233", "0.590383", "0.5894459", "0.5818318", "0.5804741", "0.57980645...
0.5557233
77
Abstracts constructing a Blob object, so it also works in older browsers that don't support the native Blob constructor. (i.e. old QtWebKit versions, at least). Abstracts constructing a Blob object, so it also works in older browsers that don't support the native Blob constructor. (i.e. old QtWebKit versions, at least)...
function createBlob(parts, properties) { /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */ parts = parts || []; properties = properties || {}; try { return new Blob(parts, properties); } catch (e) { if (e.name !== 'TypeError') { throw e; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBlob() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var BlobBuilder = getBlobBuilder();\r\n if (BlobBuilder !== undefined) {\r\n var bb = new BlobBuilder();\r\n for (var i = 0; i < args.length; i++) ...
[ "0.7334113", "0.7334113", "0.73315024", "0.7318614", "0.7318614", "0.7312992", "0.7295035", "0.7295035", "0.72721887", "0.7252708", "0.7252708", "0.7245591", "0.7245591", "0.72242063", "0.7220483", "0.7054994", "0.7009055", "0.7009055", "0.7009055", "0.6959781", "0.6959781", ...
0.6778917
39
Transform a binary string to an array buffer, because otherwise weird stuff happens when you try to work with the binary string directly. It is known. From (continues on next line) encodedecodeimagewithbase64breaksimage (20130421)
function _binStringToArrayBuffer(bin) { var length = bin.length; var buf = new ArrayBuffer(length); var arr = new Uint8Array(buf); for (var i = 0; i < length; i++) { arr[i] = bin.charCodeAt(i); } return buf; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function binaryStringToArrayBuffer(binary) {\n var length = binary.length;\n var buf = new ArrayBuffer(length);\n var arr = new Uint8Array(buf);\n var i = -1;\n while (++i < length) {\n arr[i] = binary.charCodeAt(i);\n }\n return buf;\n}", "function base64ToBuffer( str ) {\n\n\t\t\tva...
[ "0.7351354", "0.7312162", "0.7061801", "0.7061801", "0.7047508", "0.6969045", "0.6969045", "0.6969045", "0.6969045", "0.6969045", "0.6969045", "0.6969045", "0.6969045", "0.6969045", "0.6969045", "0.6969045", "0.6969045", "0.6969045", "0.6969045", "0.6969045", "0.6969045", "...
0.6735061
48
Blobs are not supported in all versions of IndexedDB, notably Chrome <37 and Android <5. In those versions, storing a blob will throw. Various other blob bugs exist in Chrome v3742 (inclusive). Detecting them is expensive and confusing to users, and Chrome 3742 is at very low usage worldwide, so we do a hacky userAgent...
function _checkBlobSupportWithoutCaching(idb) { return new Promise$1(function (resolve) { var txn = idb.transaction(DETECT_BLOB_SUPPORT_STORE, READ_WRITE); var blob = createBlob(['']); txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob, 'key'); txn.onabort = function (e) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkBlobSupport(txn) {\n return new PouchPromise(function (resolve) {\n var blob$$1 = createBlob(['']);\n var req = txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob$$1, 'key');\n\n req.onsuccess = function () {\n var matchedChrome = navigator.userAgent.match(/Chrome\\/(\\d+)/);\n v...
[ "0.7110401", "0.7075668", "0.70732397", "0.7041169", "0.7028068", "0.6927386", "0.6927386", "0.6908056", "0.6789292", "0.6777534", "0.67599654", "0.67455775", "0.674244", "0.66770464", "0.6625926", "0.65732425", "0.6567011", "0.6563297", "0.6563297", "0.6563297", "0.6563297",...
0.6506352
38
encode a blob for indexeddb engines that don't support blobs
function _encodeBlob(blob) { return new Promise$1(function (resolve, reject) { var reader = new FileReader(); reader.onerror = reject; reader.onloadend = function (e) { var base64 = btoa(e.target.result || ''); resolve({ __local_forage_encoded_blob: tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "apply_blob(blob) { return Base64.encode(blob) }", "encode(blob){\n this.init()\n if( blob.byteLength === undefined ) throw '·Not a byte array·'\n var str=''\n var m = (blob.length%3)\n if(m>0) m++ \n var n = 4*Math.floor(blob.length/3) + m\n var k=0\n ...
[ "0.75691396", "0.69735736", "0.69216675", "0.6909578", "0.6909578", "0.6909578", "0.6893833", "0.6873644", "0.6873644", "0.6618383", "0.6540103", "0.64902085", "0.6308658", "0.62876487", "0.6281143", "0.6271338", "0.6248291", "0.6248291", "0.6248291", "0.6248291", "0.6248291"...
0.68032855
17
decode an encoded blob
function _decodeBlob(encodedBlob) { var arrayBuff = _binStringToArrayBuffer(atob(encodedBlob.data)); return createBlob([arrayBuff], { type: encodedBlob.type }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _decodeBlob(encodedBlob) {\n var arrayBuff = _binStringToArrayBuffer(atob(encodedBlob.data));\n return createBlob([arrayBuff], { type: encodedBlob.type });\n }", "function _decodeBlob(encodedBlob) {\n\t var arrayBuff = _binStringToArrayBuffer(a...
[ "0.8146468", "0.8117164", "0.8117164", "0.8117164", "0.80790436", "0.80790436", "0.80248874", "0.7554386", "0.6700952", "0.6530237", "0.64144874", "0.63868856", "0.63868856", "0.63868856", "0.63868856", "0.6342241", "0.6337029", "0.63320774", "0.6328985", "0.6317221", "0.6296...
0.78791976
15
is this one of our fancy encoded blobs?
function _isEncodedBlob(value) { return value && value.__local_forage_encoded_blob; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _isEncodedBlob(value) {\n\t return value && value.__local_forage_encoded_blob;\n\t}", "function _isEncodedBlob(value) {\n\t return value && value.__local_forage_encoded_blob;\n\t}", "function _isEncodedBlob(value) {\n\t return value && value.__local_forage_encoded_blob;\n\t }", "func...
[ "0.7630183", "0.7630183", "0.7624709", "0.7624709", "0.7624709", "0.7577371", "0.7506363", "0.66517115", "0.656613", "0.6447214", "0.62912524", "0.6252887", "0.6186317", "0.6181536", "0.6181536", "0.6181536", "0.6181536", "0.6181536", "0.6181536", "0.6181536", "0.6181536", ...
0.75485253
14
Specialize the default `ready()` function by making it dependent on the current database operations. Thus, the driver will be actually ready when it's been initialized (default) and there are no pending operations on the database (initiated by some other instances).
function _fullyReady(callback) { var self = this; var promise = self._initReady().then(function () { var dbContext = dbContexts[self._dbInfo.name]; if (dbContext && dbContext.dbReady) { return dbContext.dbReady; } }); executeTwoCallbacks(promise, callback, callback...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkReady() {\n if (!this.ready) {\n throw new Error('Database is not ready yet. Please connect and wait.');\n }\n }", "function _fullyReady(callback) {\n var self = this;\n\n var promise = self._initReady().then(function () {\n var dbContext = dbContexts[self....
[ "0.6496487", "0.64191025", "0.6379439", "0.6379439", "0.6379439", "0.63302124", "0.6302096", "0.63015634", "0.63015634", "0.6281617", "0.62240714", "0.62240714", "0.62240714", "0.62240714", "0.62240714", "0.62240714", "0.62240714", "0.62240714", "0.61755115", "0.61755115", "0...
0.6045993
55
FF doesn't like Promises (microtasks) and IDDB store operations, so we have to do it with callbacks
function createTransaction(dbInfo, mode, callback) { try { var tx = dbInfo.db.transaction(dbInfo.storeName, mode); callback(null, tx); } catch (err) { if (!dbInfo.db || err.name === 'InvalidStateError') { return _tryReconnect(dbInfo).then(function () { var tx...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static fetchRestaurants(callback){\r\n //console.log(\"You have reached IndexedDB\");\r\n dbPromise.then(db => {\r\n const tx = db.transaction('restaurants');\r\n const store = tx.objectStore('restaurants');\r\n //console.log(store);\r\n return store.getAll();\r\n ...
[ "0.62919885", "0.6216401", "0.6216401", "0.6216401", "0.6216401", "0.6216401", "0.60167915", "0.59792733", "0.58549213", "0.58494675", "0.5838201", "0.5819095", "0.5807798", "0.5796043", "0.5773431", "0.5768535", "0.5732976", "0.57316417", "0.5728921", "0.5696994", "0.5685147...
0.0
-1
Open the IndexedDB database (automatically creates one if one didn't previously exist), using any options set in the config.
function _initStorage(options) { var self = this; var dbInfo = { db: null }; if (options) { for (var i in options) { dbInfo[i] = options[i]; } } // Initialize a singleton container for all running localForages. if (!dbContexts) { dbContexts = {};...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openDb() {\n\t\tconsole.log(\"openDb ...\");\n\t\tvar req = indexedDB.open(DB_NAME, DB_VERSION);\n\t\treq.onsuccess = function (evt) {\n\t\t\tdb = this.result;\n\t\t\tconsole.log(\"openDb DONE\");\n\t\t};\n\t\treq.onerror = function (evt) {\n\t\t\tconsole.error(\"openDb:\", evt.target.errorCode);\n\t\t};\...
[ "0.78277165", "0.75763685", "0.7370605", "0.7345638", "0.7306598", "0.72947603", "0.72428614", "0.71284723", "0.70234054", "0.6949358", "0.6949235", "0.69367164", "0.6907199", "0.68876076", "0.6865311", "0.68352437", "0.68319386", "0.6807489", "0.6774954", "0.67727786", "0.67...
0.0
-1
Iterate over all items stored in database.
function iterate(iterator, callback) { var self = this; var promise = new Promise$1(function (resolve, reject) { self.ready().then(function () { createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) { if (err) { return reject(err); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAll() {\n\t\treturn this.dao.all(`SELECT * FROM items`);\n\t}", "function all() {\n return database.slice();\n}", "function queryAllItems() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n // for (var i = 0; i < res.length; i++) {\n // console.log(\...
[ "0.66597366", "0.6321899", "0.62934005", "0.621165", "0.6195057", "0.61441606", "0.61441606", "0.61441606", "0.6124489", "0.6111007", "0.6098569", "0.6081372", "0.60706544", "0.6060651", "0.6051944", "0.60360587", "0.6035212", "0.6035212", "0.60302174", "0.60292774", "0.59881...
0.5795749
37
Converts a buffer to a string to store, serialized, in the backend storage library.
function bufferToString(buffer) { // base64-arraybuffer var bytes = new Uint8Array(buffer); var base64String = ''; var i; for (i = 0; i < bytes.length; i += 3) { /*jslint bitwise: true */ base64String += BASE_CHARS[bytes[i] >> 2]; base64String += BASE_CHARS[(bytes[i] & 3) <<...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bufferToString(buffer) {\n return String.fromCharCode.apply(null, new Uint8Array(buffer));\n}", "function bufferToString(buffer) {\n var str = '';\n for (var i = 0, l = buffer.length; i < l; i++) {\n str += String.fromCharCode(buffer[i]);\n }\n return str;\n}", "function arrayBufferToString(bu...
[ "0.72535586", "0.69806534", "0.6970191", "0.69659275", "0.69659275", "0.69659275", "0.6861668", "0.6837891", "0.6837891", "0.6763998", "0.664622", "0.66075975", "0.66075975", "0.65711546", "0.65212", "0.6517788", "0.65074164", "0.65074164", "0.65074164", "0.65074164", "0.6507...
0.67199725
17
Serialize a value, afterwards executing a callback (which usually instructs the `setItem()` callback/promise to be executed). This is how we store binary data with localStorage.
function serialize(value, callback) { var valueType = ''; if (value) { valueType = toString$1.call(value); } // Cannot use `value instanceof ArrayBuffer` or such here, as these // checks fail when running the tests using casper.js... // // TODO: See why those tests fail and use a be...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function storeObjectToLocalStorage (key, value){\n let value_serialize = JSON.stringify(value);\n console.log(value_serialize);\n window.localStorage.setItem (key, value_serialize);\n}", "static save(key, value) {\r\n value = JSON.stringify(value);\r\n \r\n localStorage.setItem(key, va...
[ "0.6624604", "0.66219985", "0.62766963", "0.6262893", "0.6217558", "0.6213909", "0.62092876", "0.61863464", "0.6038529", "0.60260844", "0.5990252", "0.5990252", "0.5990252", "0.5990252", "0.5990252", "0.5990252", "0.5990252", "0.59880966", "0.59880966", "0.59840065", "0.59621...
0.5718391
67
Deserialize data we've inserted into a value column/field. We place special markers into our strings to mark them as encoded; this isn't as nice as a meta field, but it's the only sane thing we can do whilst keeping localStorage support intact. Oftentimes this will just deserialize JSON content, but if we have a specia...
function deserialize(value) { // If we haven't marked this string as being specially serialized (i.e. // something other than serialized JSON), we can just return it and be // done with it. if (value.substring(0, SERIALIZED_MARKER_LENGTH) !== SERIALIZED_MARKER) { return JSON.parse(value); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deserialize(value) {\n // If we haven't marked this string as being specially serialized (i.e.\n // something other than serialized JSON), we can just return it and be\n // done with it.\n if (value.substring(0, SERIALIZED_MARKER_LENGTH) !== SERIALIZED_MARKER) {\n retu...
[ "0.731393", "0.7160532", "0.71592945", "0.71592945", "0.71592945", "0.7145271", "0.70951504", "0.7053579", "0.7053579", "0.60274535", "0.5934206", "0.5836853", "0.5798939", "0.57973814", "0.5780056", "0.5780056", "0.5780056", "0.5780056", "0.5780056", "0.5780056", "0.5780056"...
0.6885724
16
Includes code from: base64arraybuffer Copyright (c) 2012 Niklas von Hertzen Licensed under the MIT license. Open the WebSQL database (automatically creates one if one didn't previously exist), using any options set in the config.
function _initStorage$1(options) { var self = this; var dbInfo = { db: null }; if (options) { for (var i in options) { dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i]; } } var dbInfoPromise = new Promise$1(function (resolve, r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initializeDB() {\n\tdb = window.openDatabase( dbName, dbDescription, dbVersion, dbSizeMB * 1024 * 1024 );\n}", "function openDatabaseWithOpts(opts) {\n\t return opts.websql(opts.name, opts.version, opts.description, opts.size);\n\t}", "function initializeOpenDatabase() {\n try { // http://www.tutori...
[ "0.6656301", "0.6630129", "0.6429295", "0.6426135", "0.6426135", "0.6426135", "0.6426135", "0.6426135", "0.6426135", "0.6426135", "0.6392243", "0.6374463", "0.62007743", "0.61607516", "0.6150211", "0.6076607", "0.60385644", "0.5995895", "0.5972206", "0.5851508", "0.5807319", ...
0.0
-1
Deletes every item in the table. TODO: Find out if this resets the AUTO_INCREMENT number.
function clear$1(callback) { var self = this; var promise = new Promise$1(function (resolve, reject) { self.ready().then(function () { var dbInfo = self._dbInfo; dbInfo.db.transaction(function (t) { t.executeSql('DELETE FROM ' + dbInfo.storeName, [], function () ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delete_all(table, callback) {\n db.transaction(function(tx) {\n executeSqlLog(tx, \"DELETE FROM \" + table, callback);\n });\n }", "deleteTable(table) {\n\t\twhile (table.rows.length > 0) {\n\t\t\ttable.deleteRow(0);\n\t\t}\n\t}", "reset() {\n this.entities().forEach(e => e.delete()...
[ "0.67616105", "0.6497033", "0.6463595", "0.63726544", "0.6229425", "0.6202989", "0.6170655", "0.6146659", "0.6106779", "0.6099603", "0.6093097", "0.60857385", "0.6054793", "0.6037706", "0.60197186", "0.6010427", "0.59998095", "0.59877205", "0.59681946", "0.59563684", "0.59509...
0.0
-1
Does a simple `COUNT(key)` to get the number of items stored in localForage.
function length$1(callback) { var self = this; var promise = new Promise$1(function (resolve, reject) { self.ready().then(function () { var dbInfo = self._dbInfo; dbInfo.db.transaction(function (t) { // Ahhh, SQL makes this one soooooo easy. t.exe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function count(){\r\n\r\n\tvar n=0;\r\n\tObject.keys(this.datastore).forEach((key)=>\r\n\t{\r\n\t\t++n;\r\n\t});\r\n\treturn n;\r\n}", "GetItemCount() {}", "countItems(type) {\n let key = this.getKey(type)\n return this.items[key].length\n }", "function count() {\n var n=0; \n for (var key in th...
[ "0.7110103", "0.70822096", "0.67746973", "0.67601186", "0.65221345", "0.6424208", "0.64093363", "0.63929945", "0.63540477", "0.6353183", "0.6301488", "0.6283175", "0.62438244", "0.62381583", "0.6221953", "0.6210296", "0.61996305", "0.61996305", "0.61996305", "0.6197009", "0.6...
0.6104954
25
Return the key located at key index X; essentially gets the key from a `WHERE id = ?`. This is the most efficient way I can think to implement this rarelyused (in my experience) part of the API, but it can seem inconsistent, because we do `INSERT OR REPLACE INTO` on `setItem()`, so the ID of each key will change every ...
function key$1(n, callback) { var self = this; var promise = new Promise$1(function (resolve, reject) { self.ready().then(function () { var dbInfo = self._dbInfo; dbInfo.db.transaction(function (t) { t.executeSql('SELECT key FROM ' + dbInfo.storeName + ' WHERE id...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function key(n, callback) {\n var self = this;\n\n var promise = new Promise(function(resolve, reject) {\n self.ready().then(function() {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function(t) {\n t.executeSql('SELECT key FROM ' + ...
[ "0.6559184", "0.65407395", "0.6522033", "0.6522033", "0.6522033", "0.64557636", "0.64557636", "0.64557636", "0.64557636", "0.64557636", "0.64557636", "0.642663", "0.6413428", "0.63982415", "0.6364212", "0.62911344", "0.61726564", "0.6164577", "0.6156585", "0.6126074", "0.6112...
0.641443
14
Check if localStorage throws when saving an item
function checkIfLocalStorageThrows() { var localStorageTestKey = '_localforage_support_test'; try { localStorage.setItem(localStorageTestKey, true); localStorage.removeItem(localStorageTestKey); return false; } catch (e) { return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkIfLocalStorageThrows() {\n\t var localStorageTestKey = '_localforage_support_test';\n\n\t try {\n\t localStorage.setItem(localStorageTestKey, true);\n\t localStorage.removeItem(localStorageTestKey);\n\n\t return false;\n\t } catch (e) {\n\t return true;\n\t }\n...
[ "0.7500756", "0.73336613", "0.71359056", "0.6985884", "0.69241285", "0.6897494", "0.6868211", "0.6868211", "0.68483734", "0.68439984", "0.6809511", "0.6792948", "0.6788563", "0.67671573", "0.6753116", "0.67452586", "0.6726724", "0.6699453", "0.6628442", "0.66224366", "0.66205...
0.7511612
6
Check if localStorage is usable and allows to save an item This method checks if localStorage is usable in Safari Private Browsing mode, or in any other case where the available quota for localStorage is 0 and there wasn't any saved items yet.
function _isLocalStorageUsable() { return !checkIfLocalStorageThrows() || localStorage.length > 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isLocalStorageNameSupported() {\n // Safari, in Private Browsing Mode, looks like it supports localStorage but all calls to setItem\n // throw QuotaExceededError. We're going to detect this and just silently drop any calls to setItem\n // to avoid the entire page breaking, without having t...
[ "0.75224847", "0.7167196", "0.7063518", "0.70583946", "0.70353335", "0.6925414", "0.69201815", "0.69093966", "0.6901644", "0.6897147", "0.68864363", "0.6885355", "0.68552697", "0.6847467", "0.68289894", "0.6823734", "0.6823734", "0.6823734", "0.682017", "0.68189853", "0.68179...
0.7174206
7
Config the localStorage backend, using options set in the config.
function _initStorage$2(options) { var self = this; var dbInfo = {}; if (options) { for (var i in options) { dbInfo[i] = options[i]; } } dbInfo.keyPrefix = dbInfo.name + '/'; if (dbInfo.storeName !== self._defaultConfig.storeName) { dbInfo.keyPrefix += dbInf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function persistConfig(data) {\n localStorage.setItem(\"config\", data)\n }", "function _isLocalStorageUsable() {\n return !checkIfLocalStorageThrows() || localStorage.length > 0;\n } // Config the localStorage backend, using options set in the config.", "function storeSettings(){\n localSto...
[ "0.65063566", "0.6420327", "0.6306146", "0.6219054", "0.620001", "0.6111781", "0.6111781", "0.6111781", "0.6051649", "0.6023385", "0.60193974", "0.60101026", "0.59970784", "0.59851354", "0.59718704", "0.59297484", "0.59182024", "0.59182024", "0.59182024", "0.59182024", "0.591...
0.5999745
12
Remove all keys from the datastore, effectively destroying all data in the app's key/value store!
function clear$2(callback) { var self = this; var promise = self.ready().then(function () { var keyPrefix = self._dbInfo.keyPrefix; for (var i = localStorage.length - 1; i >= 0; i--) { var key = localStorage.key(i); if (key.indexOf(keyPrefix) === 0) { lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearAll(){\r\n\tObject.keys(this.datastore).forEach((key)=>\r\n\t{\r\n\t\tdelete this.datastore[key];\r\n\t});\t\r\n}", "clear() {\n for (const key of Object.keys(this.datastore)) {\n delete this.datastore[key];\n // this.remove(key);\n }\n }", "function clear()...
[ "0.8297291", "0.81149304", "0.78274983", "0.73083955", "0.70347816", "0.70217", "0.6950216", "0.694746", "0.69302887", "0.6915707", "0.67105407", "0.6708036", "0.6668547", "0.66368324", "0.65780777", "0.65493053", "0.6542786", "0.6521619", "0.65203714", "0.6510278", "0.651002...
0.0
-1
Retrieve an item from the store. Unlike the original async_storage library in Gaia, we don't modify return values at all. If a key's value is `undefined`, we pass that value to the callback function.
function getItem$2(key, callback) { var self = this; key = normalizeKey(key); var promise = self.ready().then(function () { var dbInfo = self._dbInfo; var result = localStorage.getItem(dbInfo.keyPrefix + key); // If a result was found, parse it from the serialized // strin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getItem(key, callback) {\n switch (dbBackend) {\n // Find the value for this key directly from IndexedDB and pass the\n // value to a callback function.\n case DB_TYPE_INDEXEDDB:\n indexedTransaction('readonly', function getItemBody(store) {\n ...
[ "0.72349966", "0.71480787", "0.7132903", "0.707675", "0.6839867", "0.68152153", "0.6770144", "0.6770144", "0.6759254", "0.6735491", "0.6619387", "0.65699065", "0.65699065", "0.65699065", "0.6561812", "0.6481466", "0.63683975", "0.63053966", "0.6290622", "0.62872005", "0.62763...
0.6710905
16
Iterate over all items in the store.
function iterate$2(iterator, callback) { var self = this; var promise = self.ready().then(function () { var dbInfo = self._dbInfo; var keyPrefix = dbInfo.keyPrefix; var keyPrefixLength = keyPrefix.length; var length = localStorage.length; // We use a dedicated iterator ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "* [Symbol.iterator] () {\n yield* this.items;\n }", "function loopStores(){\n for (var i = 0; i < storeObjects.length; i++){\n allLocations(storeObjects[i]);\n }\n}", "getItems(){\n\t\tthis.setState({\n\t\t\titems: ItemsStore.getAll(),\n\t\t\tprogess: this.getProgress(),\n\t\t});\n\t}", "get i...
[ "0.6496801", "0.640089", "0.6369517", "0.633805", "0.62468636", "0.6238684", "0.6234588", "0.6232207", "0.61178553", "0.60943496", "0.60943496", "0.60520077", "0.6015444", "0.6000116", "0.59732175", "0.59559786", "0.5950171", "0.59482133", "0.5944252", "0.5944252", "0.5938267...
0.0
-1
Same as localStorage's key() method, except takes a callback.
function key$2(n, callback) { var self = this; var promise = self.ready().then(function () { var dbInfo = self._dbInfo; var result; try { result = localStorage.key(n); } catch (error) { result = null; } // Remove the prefix from the key, i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function key$2(n, callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var result;\n try {\n result = localStorage.key(n);\n...
[ "0.7262396", "0.72590965", "0.72590965", "0.72590965", "0.7213818", "0.7213818", "0.7205996", "0.6337409", "0.62729645", "0.6160999", "0.60058385", "0.59653705", "0.5938348", "0.5938348", "0.5938348", "0.59376466", "0.5886646", "0.5868334", "0.5868334", "0.58624864", "0.58526...
0.71832335
15
Supply the number of keys in the datastore to the callback function.
function length$2(callback) { var self = this; var promise = self.keys().then(function (keys) { return keys.length; }); executeCallback(promise, callback); return promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function length(callback) {\n\t var self = this;\n\t var promise = self.keys().then(function (keys) {\n\t return keys.length;\n\t });\n\n\t executeCallback(promise, callback);\n\t return promise;\n\t }", "function length(callback) {\n\t var self = this;\n\t...
[ "0.6672817", "0.6672817", "0.6672817", "0.6671372", "0.64908874", "0.64908874", "0.64908874", "0.63942826", "0.63643354", "0.63326013", "0.63203424", "0.62916946", "0.62916946", "0.6273667", "0.6209182", "0.61701083", "0.61163706", "0.61163706", "0.6114747", "0.6075018", "0.6...
0.6361283
16
Remove an item from the store, nice and simple.
function removeItem$2(key, callback) { var self = this; key = normalizeKey(key); var promise = self.ready().then(function () { var dbInfo = self._dbInfo; localStorage.removeItem(dbInfo.keyPrefix + key); }); executeCallback(promise, callback); return promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove(item) {\n\t\tif (this._cache[item._id]) {\n\t\t\tdelete this._cache[item._id];\n\n\t\t\tthis.emit(events.CHANGE, item, this);\n\t\t}\n\t}", "removeItem(_item) { }", "function removeItem() {\n removeRequestedItem(requestedItem);\n }", "remove(item) {\n const id = this._generateId(item);\n ...
[ "0.73018867", "0.72687835", "0.72138053", "0.7127655", "0.7044618", "0.70313793", "0.70020777", "0.69687957", "0.69277745", "0.69219255", "0.6916464", "0.6912193", "0.6879388", "0.6864552", "0.6855857", "0.68321085", "0.6826973", "0.68258995", "0.68258995", "0.68183964", "0.6...
0.0
-1